Skip to content
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

SRG Import/Export Uses Policy Specific Content #9570

Merged
merged 4 commits into from
Sep 27, 2022

Conversation

Mab879
Copy link
Member

@Mab879 Mab879 commented Sep 26, 2022

Description:

Convert utils/import_srg_spreadsheet.py and utils/create_srg_export.py to use the policy_specific_content attribute of rules.

Rationale:

Use the fields introduced in #9553 to help with SRG import and cleaning up the code.

@Mab879 Mab879 added the Infrastructure Our content build system label Sep 26, 2022
@Mab879 Mab879 added this to the 0.1.65 milestone Sep 26, 2022
@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@jan-cerny jan-cerny changed the title SRG Imprt/Export Uses Policy Specific Content SRG Import/Export Uses Policy Specific Content Sep 27, 2022
@jan-cerny jan-cerny self-assigned this Sep 27, 2022
utils/import_srg_spreadsheet.py Outdated Show resolved Hide resolved
Comment on lines +413 to +419
psc = rule_object.policy_specific_content
if not psc:
return ""
stig = psc.get('stig')
if not stig:
return ""
return stig.get(key, "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it should pick the content from rule.yml if a policy specific key isn't present.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the new import process, my plan was to remove the existing keys once the existing content was migrated to policy files.

@codeclimate
Copy link

codeclimate bot commented Sep 27, 2022

Code Climate has analyzed commit 0d0d805 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 40.7% (0.0% change).

View more on Code Climate.

Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It picks the keys from custom policy file to the generated HTML table.

@jan-cerny jan-cerny merged commit 32da017 into ComplianceAsCode:master Sep 27, 2022
@Mab879 Mab879 deleted the export_import_srg_to_psc branch September 27, 2022 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Our content build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants