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

feat: add audit mode and reporting in mutate and generate rules #63

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vishal-chdhry
Copy link
Member

Summary

This proposal discusses ways to capture mutate and generate rule results in existing policy reports.

Copy link
Contributor

@MariamFahmy98 MariamFahmy98 left a comment

Choose a reason for hiding this comment

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

Few questions:

  • I expect that those reports will be generated as a result of admission requests. Do we need to consider background scanning?
    IMO background scanning for standard mutation and standard generation isn't needed because we do have mutateExisting rules as well as generateExisting rules and we can generate reports for them too.

    That's why I have in mind:

    1. standard mutation rules --> admission reports
    2. standard generation --> admission reports
    3. mutateExisting rules --> background scan reports
    4. generateExisting rules --> background scan reports

    We need to discuss the effect of setting spec.background and spec.admission in each case.

  • Does the value of validationFailureAction has any effect on generating the reports specifically for mutation rules? Given that this field under the spec level is deprecated.

The `properties` field in policy report result is used to add information regarding mutation and generation. A `type` property is used to indicate if the report is for mutate, validate or generate.
For mutate rules, the policy report should indicate, minimally,:
- jsonpatch of the mutation
- target of the mutation
Copy link
Contributor

Choose a reason for hiding this comment

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

The target is only applicable for mutate existing rules.

@realshuting
Copy link
Member

I expect that those reports will be generated as a result of admission requests. Do we need to consider background scanning?
IMO background scanning for standard mutation and standard generation isn't needed because we do have mutateExisting rules as well as generateExisting rules and we can generate reports for them too.

That's why I have in mind:

standard mutation rules --> admission reports
standard generation --> admission reports
mutateExisting rules --> background scan reports
generateExisting rules --> background scan reports

Good point! The standard mutate rules are applied upon admission review, I don't think we need to refresh the reports for that during the background scan. For mutate existing and generate (regardless of generateExisting) rules, they are applied during the background scan so we do need to generate/refresh reports for these types of rules.

Signed-off-by: Vishal Choudhary <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants