-
Notifications
You must be signed in to change notification settings - Fork 756
Add per product control files #14060
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
Add per product control files #14060
Conversation
|
Skipping CI for Draft Pull Request. |
|
@ComplianceAsCode/suse-maintainers currently if same control id is in the product controls folder and the product controls it will fully override it for that product is that expected behavior you for? |
Hey @Mab879, yes, in the current context, it makes sense for the product controls to override the controls. |
|
/packit retest-failed |
This will allow us in the future to better separate product specific controls.
2761c9d to
08bbba8
Compare
vojtapolasek
left a comment
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.
Looks good, please see my specific comment.
ssg/controls.py
Outdated
| if policy in self.policies: | ||
| raise ValueError("Policy %s already exists" % policy) |
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.
This would be always True.
| if policy in self.policies: | |
| raise ValueError("Policy %s already exists" % policy) | |
| if policy.id in self.policies: | |
| raise ValueError(f"Policy {policy.id} was defined first at {self.policies[policy.id].filepath} and now another policy with the same ID is being loaded from {policy.filepath}.") |
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.
Always was false, but I moved this to a warning. I did not think this should be an error.
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.
You are correct. This is not about overriding of controls, but whole policies.
Products can override global policies if they want to.
|
/retest |
|
@Mab879: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions 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. |
|
I am waiving OCP tests, it looks like an infrastructure error. Moreover, we are not touching the ocp4 product. |
vojtapolasek
left a comment
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.
Looks good now, thank you.
2c08291
into
ComplianceAsCode:master
|
Hi @Mab879 , it broke a transformation workflow to OSCAL: https://github.com/ComplianceAsCode/content/actions/runs/19137808094/job/54694313641 Is that something experimental or already defined? If so, we probably need to also adapt integrations relying in control files. |
|
We might add inheritance vs the straight replacement of policies, but that is TBD. |
Description:
Adds the ability for control files to come from the product folder.
This is a very draft to get feedback. I plan on exploring inheritance vs the total overriding like today.
Rationale:
Fixes #14036
Review Hints: