1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
Commit graph

4110 commits

Author SHA1 Message Date
shuting
a30493e550
Fix policy report OwnerReference (#3249)
* add namespaces/finalizers to clusterrole kyverno:generate

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* set policy report's owner to Kyverno namespace

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* address comments

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* address comments

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove BlockOwnerDeletion

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove namespaces/finalizers permission

Signed-off-by: ShutingZhao <shuting@nirmata.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-02-18 00:50:18 -08:00
Sambhav Kothari
8c7f037c72
Improve E2E test CI timings (#3250)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-02-17 17:47:35 -08:00
Jim Bugwadia
1631f011b1
Add openssf badge (#3246)
* add openssf badge

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* retrigger CI tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Sambhav Kothari <skothari44@bloomberg.net>
2022-02-17 17:47:14 -08:00
Jim Bugwadia
421a81ce63
Fix old object validation check (#3248)
* fix validation check on UPDATE

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* prevent policy bypass using preconditions

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* separate replace

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add error handling

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2022-02-17 09:18:49 -08:00
Tathagata Paul
b91ff5a7f2
Bug fix: negation of string kernel version caused Cluster Policy to fail (#3229)
* fixed bug where negation of kernel version caused cpolr to fail

Signed-off-by: Tathagata Paul <tathagatapaul7@gmail.com>

* small fix in function validateString

Signed-off-by: Tathagata Paul <tathagatapaul7@gmail.com>

* Added necessary tests

Signed-off-by: Tathagata Paul <tathagatapaul7@gmail.com>

Added one more test

Signed-off-by: Tathagata Paul <tathagatapaul7@gmail.com>

* Add more tests and added a policy to the test folder

Signed-off-by: Tathagata Paul <tathagatapaul7@gmail.com>

* added policy for test cli

Signed-off-by: Tathagata Paul <tathagatapaul7@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-02-17 09:33:30 +05:30
Rahul Sawra
1f60aee4b9
add helm pre-delete hook which deletes all the webhooks (#3148)
* add helm pre-delete hook for graceful uninstallation of webhooks

Signed-off-by: rahulii <r.sawra@gmail.com>

* remove white spaces

Signed-off-by: rahulii <r.sawra@gmail.com>

Co-authored-by: shuting <shuting@nirmata.com>
2022-02-17 00:16:51 +08:00
shuting
2eefe3a544
Skip updating webhook configs if namespaceSelector is nil (#3237)
* skip updating webhook configs if namespaceSelector is nil

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* address comments

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* address comment for mutating webhook

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* address comments

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update logs

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-02-16 17:07:09 +05:30
shuting
a970953d51
Sync latest changes to release/install.yaml (#3239)
* sync latest changes to release/install.yaml

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* bump chart versions

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-02-15 17:24:39 +00:00
shuting
1566d0d5fd
add aggregated role for generaterequest (#3240)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-02-15 16:15:10 +00:00
Adam Kosmin
5c91bb8217
Remove abstraction that doesn't work anyway (#3209)
Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

Co-authored-by: Trey Dockendorf <tdockendorf@osc.edu>
2022-02-15 23:01:40 +08:00
Mritunjay Kumar Sharma
5a541567de
Fix image parsing for image referenced as digests (#3196)
* fixes image break with sha256

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

* fixes priority to digest

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

Co-authored-by: shuting <shuting@nirmata.com>
2022-02-15 08:35:53 +00:00
Batuhan Apaydın
943fe2dd41
feat: ha mode support in helm chart (#3207)
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
Co-authored-by: Yasin Taha Erol <yasintahaerol@gmail.com>
Co-authored-by: Furkan Türkal <furkan.turkal@trendyol.com>
Co-authored-by: @necatican @f9n
Signed-off-by: Emin Aktas <eminaktas34@gmail.com>
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>

Co-authored-by: Yasin Taha Erol <yasintahaerol@gmail.com>
Co-authored-by: Furkan Türkal <furkan.turkal@trendyol.com>
Co-authored-by: Prateek Pandey <prateekpandey14@gmail.com>
2022-02-15 15:57:23 +08:00
Jim Bugwadia
bd1a145678
Fix keyless attest (#3219)
* allow root cert for keyless attestations checks

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add logs and improve var names

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* make fmt

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* handle err in sig loading

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-02-13 20:35:11 -08:00
Jim Bugwadia
14111aaa05
update dependencies (#3221)
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2022-02-13 11:20:24 +00:00
Chip Zoller
3dcf165d77
Issue forms and PR template adjustment (#3213)
* add cherry pick requirement

Signed-off-by: Chip Zoller <chipzoller@gmail.com>

* adopt github issue forms

Signed-off-by: Chip Zoller <chipzoller@gmail.com>
2022-02-12 16:51:05 +00:00
Prateek Pandey
9ec53af295
add prateekpandey14 to codeowners (#3205)
Signed-off-by: prateekpandey14 <prateekpandey14@gmail.com>
2022-02-10 20:43:21 +08:00
Afzal Ansari
fc658da1e3
Added e2e test for JSON patch mutate policy (#2966)
* Adds e2e test for JSON patch mutate policy

Signed-off-by: afzal442 <afzal442@gmail.com>

* modifies the config to use the optimal version of that policy

Signed-off-by: afzal442 <afzal442@gmail.com>

* Fixes the lint issuue

Signed-off-by: afzal442 <afzal442@gmail.com>

* modifies test to pass

Signed-off-by: afzal442 <afzal442@gmail.com>

* adds changes to resources

Signed-off-by: afzal442 <afzal442@gmail.com>

Co-authored-by: shuting <shutting06@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-02-10 05:18:26 +00:00
vivek kumar sahu
0293368504
fixing bug to handle two different types of rules (#2954)
* fixing bug for the info variable

Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-02-09 10:33:54 +00:00
treydock
3f1a0bfd6c
Allow setting validationFailureActionOverrides for policies (#3201)
Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2022-02-09 16:24:35 +08:00
Batuhan Apaydın
9661ea8584
feat: fix app version in NOTES.txt (#3189)
Co-authored-by: Erkan Zileli <erkan.zileli@trendyol.com>
Co-authored-by: Furkan Türkal <furkan.turkal@trendyol.com>
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>

Co-authored-by: Erkan Zileli <erkan.zileli@trendyol.com>
Co-authored-by: Furkan Türkal <furkan.turkal@trendyol.com>
2022-02-07 15:00:08 -05:00
Ramanand Thakur
7f1530c66e
Indentation fix (#3179)
Removed unnecessary indentation on line 107 to avoid confusion.
2022-02-08 01:00:01 +08:00
Sambhav Kothari
25c2ad11e4
Fix unused tagTest in helm chart tests (#3174)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-02-04 23:12:12 +00:00
treydock
4e0d8ca612
Update kyverno-policies chart with latest pod-security policies (#3126)
* Update kyverno-policies chart with latest pod-security policies
Fixes #3063
Fixes #2277

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update README to have better example

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Use chart testing during e2e to test against ci values

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Fix e2e tests for Helm chart

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Fix Kyverno chart testing to actually test values, and fix networkpolicy template

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update README for exclusion

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Allow adding 'other' policies via Helm

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update Chart.yaml for kyverno-policies

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Bump minimum Kubernetes version in charts

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update kyverno-policies chart readme

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Use version that should catch all pre-releases

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Use version that should catch all pre-releases (part 2)

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Use same logic to get git tag by using Makefile target for updating Helm values

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Prateek Pandey <prateekpandey14@gmail.com>
2022-02-04 14:47:36 +08:00
Sambhav Kothari
4445780c7c
Add a kyverno jp command to test jmespath expressions (#3169)
* Add a kyverno jp command to test jmespath expressions

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

* Auto-generate custom function docs

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-02-04 05:23:12 +00:00
Vyankatesh Kudtarkar
b3f702ba8d
test-cases for wildcard match label selector (#3165) 2022-02-04 03:45:40 +00:00
Abhinav Sinha
11311a15df
Filter kyverno resources instead of entire kyverno namespace (#3170)
Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>
2022-02-04 00:38:47 +00:00
Vyankatesh Kudtarkar
373f421b07
Fix panic for provides a set to the key of a precondition and deny condition (#3162) 2022-02-03 14:46:58 +00:00
Abhinav Sinha
ed3811ea5a
Bump up verbosity for patched resource mismatch (#3127)
Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>
2022-02-03 11:24:00 +00:00
shuting
326d141a6d
bump chart versions (#3160)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-02-03 09:31:10 +00:00
shuting
ae4d148318
Update dev image tag in Make targets (#3159)
* - update dev images tag; - update chart testing

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update to use dev tag when setting up e2e tests infra

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* default chart test image tag for busybox to latest

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* set image tag to latest for chart testing

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* correct tag

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove test tag in e2e.yaml

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-02-03 15:41:58 +08:00
Jim Bugwadia
9502a8ea8f
Add sam (#3155)
* add Sam as a maintainer

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* update maintainers

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* address comments

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fixed link

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2022-02-02 10:28:46 -08:00
Prateek Pandey
b25f3439aa
add missing patch verbs in event clusterrole (#3151)
As part of tighten and clarify Kyverno roles and
permissions, PR #2799 we missed to update the charts
templates events clusterroles.

Signed-off-by: prateekpandey14 <prateekpandey14@gmail.com>
2022-02-02 07:24:04 +00:00
Prateek Pandey
286b0427d0
fix filtered and sort patches index (#3146)
added missing start index value for the
patches slice

Signed-off-by: prateekpandey14 <prateekpandey14@gmail.com>
2022-02-01 13:16:08 -08:00
Abhinav Sinha
25641abeb9
Fix kyverno panic with PodSpec.containers JSON merge patch w/o image (#3143)
Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>
2022-02-01 10:01:46 +05:30
Sambhav Kothari
98284114f5
Relax rule context validation to follow JMESPath grammar (#3129)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-01-31 18:23:59 +00:00
Abhinav Sinha
7a55d26d89
Fixed kyverno panic at JMESPath zero division (#3137)
Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-01-31 17:45:20 +00:00
Sambhav Kothari
2b1e7189b1
Fix variable substitution when curly braces are used in jmespath (#3133)
* Fix variable substitution when inline jmespath objects are defined

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

* Add additional test cases which use brackets

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-01-31 17:11:19 +00:00
Sambhav Kothari
a1daf167e7
Fix parsing of resources in preconditions (#3108)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-01-31 08:18:31 -08:00
Rob Best
851ebe3e65
Add cloud provider keychains to DefaultKeychain (#3116)
Removes the need to specify an image pull secret to make use of cloud
provider credentials. As I understand it, this should be fine outside of
cloud provider contexts.

As part of this, I've switched to using authn/kubernetes, which I believe
is preferable to k8schain.

Signed-off-by: Rob Best <robertbest89@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-01-28 11:33:27 -08:00
Kevin Welter
daf24a28f8
improve antiAffinity and add podAffinity and nodeAffinity for kyverno helm chart (#3067)
* add nodeAffinity for kyverno helm chart

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* quite better and more open solution for affinity in helm chart. it assist all kinds of other affinitys

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* fix typo in parameter

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* make affinity selection easier - return to antiAffinity for less change

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* return to antiAffinity to make change easier

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* add documentation for new values and helm functions

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* simplified again the use of new affinities. Dont need to extra enable if
you insert affinities

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* fix "if" of the affinity block

Co-authored-by: treydock <treydock@gmail.com>
Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* Now finaly renamed values to avoid braking change; adjust readme for the
parameter names

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

* alphabetic order readme

Signed-off-by: Kevin Welter <kevin.welter@humanity-it.com>

Co-authored-by: Kevin Welter <kevin.welter@digital-nx.com>
Co-authored-by: treydock <treydock@gmail.com>
2022-01-28 15:05:41 +00:00
Naman Lakhwani
d3dd7a7b45
fixing and adding tests (#3112)
Signed-off-by: Naman Lakhwani <namanlakhwani@gmail.com>
2022-01-27 22:50:29 -08:00
Jim Bugwadia
7cf1dd2b15
update cosign to 1.5.0 and fix issuer and subject for keyless (#3089)
* update cosign to 1.5.0 and add checks

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix subject and issuer checks

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* make fmt

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2022-01-27 21:13:23 -08:00
Sambhav Kothari
b27248111f
Add b/w compat support for K8s version 1.20 and below for Kyverno 1.6 (#3100)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-01-27 07:27:58 +00:00
Sambhav Kothari
7e5bf4083e
Fix the kyverno default keychain value to be the ggcr default keychain (#3096)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-01-27 14:38:08 +08:00
Batuhan Apaydın
3be48b9fb5
fix: typo Cluter to Cluster (#3092)
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2022-01-26 22:02:17 +00:00
Sambhav Kothari
2eb8f5f285
Fix memory leak when updating ggcr keychain (#3088)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-01-26 12:45:05 -08:00
Rob Best
7a8c19e0cb
Support registry keychain from cloud providers (#3036)
* Enable cloud provider registry keychains

It's desirable that Kyverno supports using workload identity and other
cloud provider metadata services for registry credentials.

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Always initialize registry keychain

This supports using docker configuration on disk and credentials from
cloud providers without having to specify image pull secrets.

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Get pull secrets from kyverno service account

It was previously using 'default'. I think it makes more sense to use
the service account that Kyverno actually runs with.

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Don't split empty pull secrets list

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Add KYVERNO_SVC_ACCOUNT to config manifests

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Don't retrieve secrets from service account

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Reduce scope of keychain changes

Just enable cloud provider keychains.

Signed-off-by: Rob Best <robertbest89@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-01-26 07:28:36 +00:00
Mritunjay Kumar Sharma
05bd2ff4bb
Updates Changelog to add note for anyPattern issue due to k8s v1.23 (#3045)
* adds notes for anyPattern issue due to k8s v1.23

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

* updates changelog

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

* updates changelog for any/all

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Jordan Liggitt <jordan@liggitt.net>

Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: shuting <shutting06@gmail.com>
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
2022-01-26 03:36:22 +00:00
Kumar Mallikarjuna
e42908a85a
Add KYVERNO_DEPLOYMENT to initContainer (#3086)
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>
2022-01-25 23:50:19 +08:00
Jim Bugwadia
06e93fec46
apply patches cumulatively (#3083)
* apply patches cumulatively

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* handle skipped rules

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add test files

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2022-01-25 09:00:18 +00:00