-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Parikshit Samant <[email protected]> Co-authored-by: Anusha Hegde <[email protected]>
- Loading branch information
1 parent
f5eac0e
commit 73e6517
Showing
10 changed files
with
236 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: check-ami-deprecation-time | ||
annotations: | ||
policies.kyverno.io/title: Check AMI deprecation Time | ||
policies.kyverno.io/category: AMI Deprecation Time | ||
policies.kyverno.io/severity: medium | ||
policies.kyverno.io/subject: Cluster | ||
policies.kyverno.io/description: >- | ||
AMIs past their deprecation time | ||
spec: | ||
validationFailureAction: audit | ||
background: true | ||
rules: | ||
- name: check-ami-deprecation-time | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- AWSAdapterConfig | ||
validate: | ||
message: "This rule audits for AMIs that are past their deprecation time" | ||
foreach: | ||
- list: "request.object.status.eksCluster.compute.reservations[].instances[].amazonMachineImage" | ||
deny: | ||
conditions: | ||
any: | ||
- key: "{{ time_before('{{ element.deprecationTime }}', '{{ time_now_utc() }}') }}" | ||
operator: Equals | ||
value: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters