Skip to content

feat(helm): support custom policies with built-in scanner#1144

Open
yurrriq wants to merge 2 commits into
aquasecurity:mainfrom
yurrriq:custom-policies-with-builtin-scanner
Open

feat(helm): support custom policies with built-in scanner#1144
yurrriq wants to merge 2 commits into
aquasecurity:mainfrom
yurrriq:custom-policies-with-builtin-scanner

Conversation

@yurrriq

@yurrriq yurrriq commented Apr 20, 2022

Copy link
Copy Markdown
Contributor

Description

Add support for custom policies when using the custom scanner.

Related issues

Remove this section if you don't have related PRs.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

Comment thread deploy/helm/values.yaml

affinity: {}

additionalPolicies:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As far as I know, the Conftest is deprecated and planned for removal. If that's not the case, perhaps it would be good to unify this with conftest.library and conftest.policy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm also not attached to this name, but it seems to follow in the tradition of other charts in the wild.

kubernetes.namespace]))\n\n\tres := {\n\t\t\"msg\": msg,\n\t\t\"id\": __rego_metadata__.id,\n\t\t\"title\":
__rego_metadata__.title,\n\t\t\"severity\": __rego_metadata__.severity,\n\t\t\"type\":
__rego_metadata__.type,\n\t}\n}\n"
{{- with .Values.additionalPolicies }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It would be interesting to try to prevent collisions here. Otherwise our beloved YAML will let the last instance of a duplicate key win, which might produce unexpected results.

@codecov

codecov Bot commented Apr 20, 2022

Copy link
Copy Markdown

Codecov Report

Merging #1144 (ca46f4c) into main (421d81e) will decrease coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1144      +/-   ##
==========================================
- Coverage   57.90%   57.84%   -0.07%     
==========================================
  Files          71       71              
  Lines        9325     9325              
==========================================
- Hits         5400     5394       -6     
- Misses       3374     3379       +5     
- Partials      551      552       +1     
Impacted Files Coverage Δ
pkg/vulnerabilityreport/controller.go 56.09% <0.00%> (-1.22%) ⬇️
pkg/operator/controller/ciskubebenchreport.go 52.58% <0.00%> (-0.80%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 421d81e...ca46f4c. Read the comment docs.

@yurrriq yurrriq marked this pull request as ready for review April 22, 2022 16:22
@yurrriq

yurrriq commented Apr 27, 2022

Copy link
Copy Markdown
Contributor Author

For my use case, this could be obviated by #1145, but I imagine others might prefer this simpler approach. Supporting both seems prudent.

@yurrriq yurrriq force-pushed the custom-policies-with-builtin-scanner branch from da6e720 to d7f03df Compare April 27, 2022 16:35
@yurrriq yurrriq force-pushed the custom-policies-with-builtin-scanner branch from d7f03df to ca46f4c Compare May 4, 2022 18:00
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.

1 participant