yaml_tools.templates¶
Template bits for generating SSG-style controls in YAML.
Attributes¶
Functions¶
|
Render an ID template string given a context dict. |
|
Transform control ID strings, add leading zeros in forward direction: |
Module Contents¶
- yaml_tools.templates.PROFILES: List = ['LOW', 'MODERATE', 'HIGH', 'PRIVACY']¶
- yaml_tools.templates.IMPACT_LVLS: List = ['low', 'moderate', 'high']¶
- yaml_tools.templates.CTL_FIELD_MAP: Dict¶
- yaml_tools.templates.PREAMBLE: str = Multiline-String¶
Show Value
""" policy: NIST title: Configuration Recommendations for Yocto- and OpenEmbedded-based Linux Variants id: nist_openembedded version: Revision 5 source: https://csrc.nist.gov/files/pubs/sp/800/53/r5/upd1/final/docs/sp800-53r5-control-catalog.xlsx levels: - id: low - id: moderate - id: high """
- yaml_tools.templates.ID_TEMPLATE: str = Multiline-String¶
Show Value
""" controls: - id: {{caps}} status: {{status}} notes: |- {{notes}} rules: [] description: |- {{description}} title: >- {{caps}} - {{name}} levels: [] """
- yaml_tools.templates.generate_control(context)[source]¶
Render an ID template string given a context dict.
- Parameters:
context (Dict)
- Return type:
Any
- yaml_tools.templates.xform_id(string, strip_trailing_zeros=False)[source]¶
Transform control ID strings, add leading zeros in forward direction:
AC-12(2) <==> ac-12.02
Caller should filter zero-length input or handle IndexError as needed.
- Parameters:
string (str)
strip_trailing_zeros (bool)
- Return type:
str