nist_sync: regenerate CIS reference files to nested format - #14951
Open
ggbecker wants to merge 2 commits into
Open
nist_sync: regenerate CIS reference files to nested format#14951ggbecker wants to merge 2 commits into
ggbecker wants to merge 2 commits into
Conversation
PR ComplianceAsCode#14884 restructured the NIST 800-53 product control files (products/{rhel8,rhel9,rhel10}/controls/nist_800_53/*.yml) from flat to nested (enhancements under their base control) and updated sync_nist_split.py to emit nested output, but did not regenerate the auto-generated comparison files under shared/references/controls/, which were left in the old flat format. Since the weekly cis-nist-sync workflow always regenerates those reference files from scratch, every run was diffing a freshly-nested file against the stale flat one in git, producing a huge mechanical diff unrelated to any real CIS/NIST mapping change (see PR ComplianceAsCode#14932). Regenerate the reference files with the current script so they match the nested structure of the product control files. Verified semantically against the prior versions: control IDs and rule mappings are unchanged; the only change is 553 enhancements per product inheriting their parent's baseline level, the same mechanical change already applied to the product files in ComplianceAsCode#14884.
test_workflow_local.sh counted controls and rule selections with
fixed-indentation grep patterns ('^ - id:' and '^ -'), which
only matched the old flat control-file layout. Since ComplianceAsCode#14884 nested
enhancements under their base control, ids and rule lists shift
indentation depth, so the counters silently reported 0 for every
product.
Replace the grep counters with a small ruamel.yaml-based helper that
recursively walks the controls tree, so stats are correct regardless
of nesting depth.
ggbecker
requested review from
Mab879,
jan-cerny,
marcusburghardt and
vojtapolasek
as code owners
July 31, 2026 12:09
|
@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:
Review Hints
./build_product rhel8 rhel9 rhel10./utils/nist_sync/test_workflow_local.sh