Importing Controls
When importing a profile or catalog for use in a Component Definition, SSP or other models as use cases arise.
Although implementation is incremental, all implementation must satisfy the NIST OSCAL Profile Resolution specification.
- Build import tree
- identify imports
- ensure each import is reachable
- cite blocked processing when an import is not found
- receive alternative links to blocked imports
- Enumerate control scope
- import and organize group/control hierarchy:
- ID: group or control ID {key}
- label: group or control label
- title: group or control title
- status: if a status prop is present, include it here
- source: the catalog that originally contained the control
- included-by: array of profiles that imported the control
- parameter-set-via: profiles that set the parameter constraint or value (via
set-parameters) - modified-via: profiles that have alter the control (via
modify) - cached_content: empty initially. populated when referenced.
- children: a nested array of any child control or group
- Groups can have child groups or child controls, but not both.
- Controls can only have child controls.
- ID: group or control ID {key}
- for scope use
include/excludewithall/by-id/matching; adjusted bywith-child-controls- scope-index: just IDs
- for organization use
merge/flat,merge/as-isormerge/custom- if a control is in scope it must be addressible and visible.
- With merge custom, any control not explicity addressed in organized into an “[Ungrouped]” group at the top.
- if a control is in scope it must be addressible and visible.
- import and organize group/control hierarchy:
- Individual controls are loaded and processed only when the
get_controlmethod is used.- Lookup the control in the scope array
- use the source to obtain the original content
- use the parameter-set-via map to acquire parameter settings
- use the modified-via map to acquire tailoring
get_control(id: str, raw: boolean = False)
idis the control ID itselfraw: IfTrue, return the original source content and all tailoring as separate constructs IfFalse(default) return only the final control after tailoring.