Customize Rules
Customizing lets you modify rule content (check commands, fixes, references) or add entirely new rules. This is different from tailoring, which selects which rules to include and sets ODV values.
How Merging Works
Section titled “How Merging Works”When you create a custom rule file, the project:
- Loads your custom version from
custom/rules/ - Loads the original rule from
rules/ - Uses your custom values where they differ
- Keeps original values for fields you didn’t customize
- Merges
tagsandreferences(concatenates rather than replaces)
Modify an Existing Rule
Section titled “Modify an Existing Rule”-
Create your custom rule file
Create a YAML file in
custom/rules/with the same filename as the original rule. -
Include only fields to customize
Add only the fields you want to change:
references:custom:MSCP:- MSCP-OS-001URL:- https://example.com/policy -
Generate your outputs
Terminal window ./scripts/generate_guidance.py baselines/YOUR_BASELINE.yamlThe custom values merge with the original rule automatically.
Add a New Rule
Section titled “Add a New Rule”-
Create your rule file
Create a new YAML file in
custom/rules/with your rule ID as the filename (e.g.,my_org_custom_rule.yaml). -
Define the required fields
Field Description idUnique rule identifier titleHuman-readable name discussionWhy this rule matters checkCommand to verify compliance resultExpected output format fixRemediation instructions tagsInclude your baseline tag -
Add payload support (if needed)
If your rule uses a configuration profile payload not in the project, add it to
includes/supported_payloads.yaml. -
Generate your baseline
Terminal window ./scripts/generate_baseline.py -k YOUR_TAG -
Generate your outputs
Terminal window ./scripts/generate_guidance.py baselines/YOUR_BASELINE.yaml
Informational Rules (No Check/Fix)
Section titled “Informational Rules (No Check/Fix)”For rules that explain a control but don’t require compliance checking, use the manual tag. These rules appear in guidance documents but not in compliance scripts.
id: my_org_policy_statementtitle: Organization Security Policydiscussion: | This control documents the organization's security policy requirements.check: |result: |fix: |tags: - manual - my_org_baselineFile Structure
Section titled “File Structure”Directorycustom/
Directoryrules/
- os_authenticated_root_enable.yaml - Override existing rule
- my_org_custom_rule.yaml - New custom rule
Next Steps
Section titled “Next Steps”- Tailoring Rules - Select rules and set ODV values
- Exempting Rules - Exclude rules from compliance checks