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(checks): Deprecate remaining PSP checks #277

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

simar7
Copy link
Member

@simar7 simar7 commented Oct 16, 2024

@simar7
Copy link
Member Author

simar7 commented Oct 16, 2024

@nikpivkin since you recently checked the CIS benchmarks, should they be updated as well as some of them check for this check as can be seen here:

- id: 1.2.13
name: Ensure that the admission control plugin SecurityContextDeny is set if
PodSecurityPolicy is not used
description: The SecurityContextDeny admission controller can be used to deny
pods which make use of some SecurityContext fields which could allow for
privilege escalation in the cluster. This should be used where
PodSecurityPolicy is not in place within the cluster
checks:
- id: AVD-KCV-0013

@nikpivkin
Copy link
Contributor

nikpivkin commented Oct 16, 2024

@simar7 You mean update the k8s checks to align with the benchmarks?

@simar7 simar7 force-pushed the deprecate-psp-checks branch 2 times, most recently from 2abcbba to 605b0fd Compare October 17, 2024 01:16
@simar7 simar7 marked this pull request as ready for review October 17, 2024 01:16
@simar7
Copy link
Member Author

simar7 commented Oct 17, 2024

@simar7 You mean update the k8s checks to align with the benchmarks?

I think we will need to keep that check as we only target 1.23 which still has it. Unless we update to target a newer version of k8s. For now we can just add a deprecation message to inform the users about it. I've updated the PR accordingly.

@nikpivkin
Copy link
Contributor

@simar7 In such a situation, we specify a frameworks field for cloud checks that lists the benchmarks. If the user passes a compliance flag with one of the benchmarks when scanning, only then this check is applied. An example of a check that will not be loaded by default when scanning: https://github.com/aquasecurity/trivy-checks/blob/main/checks/cloud/aws/cloudwatch/require_cloudtrail_change_alarm.rego#L19-L23. I think we can do something like this here. Wdyt?

@simar7
Copy link
Member Author

simar7 commented Oct 21, 2024

@simar7 In such a situation, we specify a frameworks field for cloud checks that lists the benchmarks. If the user passes a compliance flag with one of the benchmarks when scanning, only then this check is applied. An example of a check that will not be loaded by default when scanning: https://github.com/aquasecurity/trivy-checks/blob/main/checks/cloud/aws/cloudwatch/require_cloudtrail_change_alarm.rego#L19-L23. I think we can do something like this here. Wdyt?

Good point, updated.

@simar7 simar7 added this pull request to the merge queue Oct 24, 2024
Merged via the queue into main with commit bef0dd8 Oct 24, 2024
5 checks passed
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.

chore(misconf): Deprecate PodSecurityPolicy checks for k8s
2 participants