nist_800_53: fix duplicate variables and ordering in sync, add missing rules#14823
Open
ggbecker wants to merge 1 commit into
Open
nist_800_53: fix duplicate variables and ordering in sync, add missing rules#14823ggbecker wants to merge 1 commit into
ggbecker wants to merge 1 commit into
Conversation
…g rules
Fix two bugs in utils/nist_sync/sync_nist_split.py:
- Deduplicate variable assignments by collecting into a set before sorting.
When cis_nist_mappings.json contains both a bare key ('var_x') and a
full assignment ('var_x=value') for the same variable, iterating and
calling extend() would add the same assignment twice per key.
- Sort the resulting variable list for deterministic output across runs.
Also add rsyslog_filecreatemode to the ac-3 block in rhel9 and rhel10
product control files, which was present in the CIS→NIST mappings but
missing from the human-maintained files, causing a CIS vs CIS-NIST
profile diff.
Regenerate all three product reference files (rhel8/rhel9/rhel10) with
the fixed script to reflect the corrected de-duplication and the updated
CIS→NIST mappings introduced in fab8d57.
|
@ggbecker: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This is a continuation of: nist_800_53: fix sync script variable lookup and complete CIS→NIST mappings #14785
Fix duplicate variable entries and non-deterministic ordering in
utils/nist_sync/sync_nist_split.py. Whencis_nist_mappings.jsoncontains both a bare key (var_x) and a full assignment (var_x=value) for the same variable, both strip to the same name andextend()would add the same assignment multiple times. Fixed by collecting into asetbefore sorting, ensuring stable, deduplicated output on every run.Add
rsyslog_filecreatemodeto theac-3block inproducts/rhel9/controls/nist_800_53/ac.ymlandproducts/rhel10/controls/nist_800_53/ac.yml. The rule was present incis_nist_mappings.jsonbut missing from the human-maintained product control files, causing a non-emptyCIS - CIS_NISTdiff.Regenerate
shared/references/controls/nist_800_53_cis_reference_{rhel8,rhel9,rhel10}/with the fixed script to reflect both the deduplication fix and the CIS→NIST mapping additions from fab8d57.Rationale:
var_auditd_space_left_action=cis_rhel9appearing 2–3 times in the same control block), making diffs noisy and the output non-idempotent across runs.rsyslog_filecreatemodein the product control files caused the CIS-NIST workflow to report that CIS-NIST did not fully cover CIS for rhel9 and rhel10.Review Hints:
shared/references/controls/are deduplication + sort order fixes plus thersyslog_filecreatemodeadditions; no rules were removed.sync_nist_split.pyfix is ingenerate_controls()around line 474: replacesextend()on a loop over asetwithset.update()+sorted().