Customizing 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
tags(concatenates),references(updates), andplatforms(merges) rather than replacing
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:
discussion: Customized discussionreferences:custom:CIO_Policy: refID-123tags:- CIO_Policy -
Generate your outputs (see command below)
Terminal window ./mscp.py guidance custom/baselines/YOUR_BASELINE.yamlTerminal 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/<section>with your rule ID as the filename (e.g.,os_my_org_custom_rule.yaml).New rule files must be placed in a section subfolder in order for mSCP to see them correctly.
-
Define the required fields
There are a number of required fields in order for mSCP to recognize a valid rule file.
Field Description idUnique rule identifier titleHuman-readable name discussionWhy this rule matters referencesReferences to policy documents references.nise.cceThis field is required, but can be a blank dictionary ‘{}’ platformsPlatform specific information platforms.<OS>OS can be macOS, iOS, visionOS platforms.<OS>.<VERSION>Version should be in the form of ‘27.0’, this can be a blank dictionary ‘{}’ tagsInclude your baseline tag -
Validate the rule files
This command will review all of the rule yaml files in the mSCP library and any found in the custom folders.
Terminal window # Validate Rules./mscp.py admin validate -
Generate your baseline and outputs
Terminal window # Generate baseline./mscp.py baseline -k YOUR_TAG# Generate outputs./mscp.py guidance custom/baselines/YOUR_BASELINE.yaml
Basic rule file structure
id: my_org_policy_statementtitle: Organization Security Policydiscussion: | This control documents the organization's security policy requirements.references: nist: cce: {}platforms: macOS: '27.0': {}tags: - my_org_baseline-
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 your rule uses a configuration profile payload not in the project, add it to
includes/supported_payloads.yaml. -
Generate your baseline and outputs
Terminal window # Generate baseline./scripts/generate_baseline.py -k YOUR_TAG# Generate outputs./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 do not get evaluated in compliance scripts.
id: my_org_policy_statementtitle: Organization Security Policydiscussion: | This control documents the organization's security policy requirements.tags: - manual - my_org_baselineFile Structure
Section titled “File Structure”Directorycustom/
Directoryrules/
Directoryos/ - Section folder for new custom rule
- os_my_org_custom_rule.yaml - New custom rule
Directorysystemsettings/ - Section folder for new custom rule
- system_settings_org_custom_rule.yaml - New custom rule
- icloud_drive_disable.yaml - Override existing rule
- os_authenticated_root_enable.yaml - Override existing rule
Next Steps
Section titled “Next Steps”- Tailoring Rules - Select rules and set ODV values
