-
Notifications
You must be signed in to change notification settings - Fork 9
Filter updated control files #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Filter updated control files #51
Conversation
Signed-off-by: Sophia Wang <[email protected]>
content_test_filtering.py
Outdated
if options.output == "json": | ||
controls_updates = {"controls": controls_files} | ||
try: | ||
with open('controls_updates.json', 'w', encoding='utf-8') as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that would be helpful to save the output for other changes, in profiles and maybe rules? If so, we could create a generic function to save files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap. Sounds good. Updated. All the updates will be saved to output.json
python content_test_filtering.py pr --base 4266a65aa118d6840c05d33d40a1612ad10bbf1c --remote_repo https://github.com/ComplianceAsCode/content --verbose --rule --profile --output json 13176 > output.json
@matusmarhefka and @comps , could you also take a look on this PR, please? |
Signed-off-by: Sophia Wang <[email protected]>
c09d7a2
to
9006a8a
Compare
I have no knowledge of this codebase, hopefully @matusmarhefka has some. |
I think it would be cleaner to add a separate option for filtering control files, e.g.
I looked at the mentioned automatus Actions code in CaC/content and it will most likely not cause an issue, but still I would prefer to have a separate option |
Thanks for your feedback. I will add the option "--control". |
The feature is trying to filter the updated control files.
The aim is to sync the control file updates to the OSCAL catalog via trestlebot tool. The
sync-cac-content catalog
input is the CaC content control file. So if there are any updates of the control file in CaC content, it will trigger the sync to update the OSCAL catalog.How to test:
python content_test_filtering.py pr --base 4266a65aa118d6840c05d33d40a1612ad10bbf1c --remote_repo https://github.com/ComplianceAsCode/content --verbose --rule --profile --output json 13176