1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
Commit graph

874 commits

Author SHA1 Message Date
Vishal Choudhary
334594c128
feat: add support for cosign experimental OCI 1.1 signatures (#10228)
* feat: add support for cosign experimental OCI 1.1 signatures

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: remove unrelated changes

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: linter

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: requested changes

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-18 23:03:53 +00:00
Vishal Choudhary
c305fbc070
feat: add custom sigstore conformance tests (#10473)
* feat: add custom sigstore conformance tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: debug

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: debug

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: debug

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: debug

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add custom sigstore values back

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: remove debug

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-06-14 13:53:06 +00:00
Charles-Edouard Brétéché
46b9a6e3e2
test: add cleanup v2 chainsaw tests (#10476)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-14 13:19:48 +00:00
Charles-Edouard Brétéché
f26acfb36a
chore: add chainsaw test for controllers leader election (#10416)
* chore: add chainsaw test for reports controller leader election

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* other controllers

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-10 15:57:29 +00:00
Mariam Fahmy
c391fba64c
fix: get ns labels in the cluster mode when using the CLI (#10348)
* fix: get ns labels in the cluster mode when using the CLI

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* chore: fix chainsaw test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* Update .vscode/launch.json

Co-authored-by: shuting <shuting@nirmata.com>
Signed-off-by: Mariam Fahmy <mariamfahmy66@gmail.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-06-04 10:44:44 +00:00
Vishal Choudhary
f4482c4699
chore: add condition checking to notary attestation verify chainsaw tests (#10288)
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-30 21:26:44 +00:00
Vishal Choudhary
47adea6f1c
feat: add support for background scanning of existing resource in image verification (#10287)
* feat: add support for background scanning of existing resource in image verification

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: change rule response type to image verify

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* chore: fix nilptr reference

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-05-24 09:41:04 +00:00
Mariam Fahmy
57b2c5fe4f
fix: add a copy method to the policy context (#10236)
* fix: add a copy method to the policy context

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* chore: add a CLI test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* chore: remove mutate changes

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-21 15:29:09 +00:00
shuting
e58d7120c6
fix: sort webhookconfig.operations (#10274)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-05-21 13:22:08 +00:00
Mariam Fahmy
5534ac335a
fix flake test in VAPs (#10263)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-20 11:03:47 +00:00
Vishal Choudhary
3af0e461f0
fix: deepcopy patched resource in foreach mutate (#10252)
* fix: deepcopy patched resource to avoid indirect reversal of its elements

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: copy elements while reversing

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: copy resources inside foreach

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* add test

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

* add test

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

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2024-05-20 14:45:21 +08:00
Mariam Fahmy
900bf48ecf
fix: skip generating VAPs in case namespace's name contains wildcards (#10205)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-10 14:19:10 +00:00
Mariam Fahmy
6fec52436a
fix: generate VAPs that match all resources when kinds is set to * (#10208)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-09 06:46:10 +00:00
Mariam Fahmy
60e347bedb
feat: support generating VAPs in case of matching resources in specific namespaces (#9981)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-05-08 11:09:47 +00:00
Mariam Fahmy
3fa6a8d34e
fix: add resourceNames field in the generated VAPs (#10187)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-07 12:19:12 +00:00
Mariam Fahmy
f291407ca9
fix: skip generating VAPs for policies that match multiple resources with a namespace/object selector (#10181)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-06 21:52:22 +08:00
Khaled Emara
21602a1e1f
fix(polex): multiple polexes with conditions (#9994)
Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-06 10:28:39 +00:00
Mariam Fahmy
8805620574
fix: add CONNECT operation in the webhook config for pod/exec subresource (#9855)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-06 09:51:46 +00:00
Mariam Fahmy
cd33b84a62
fix: add pods/ephemeralcontainers to the generated VAPs (#10162)
* fix: add pods/ephemeralcontainers to the generated VAPs

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: remove an extra space

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-05-06 08:29:55 +00:00
Vishal Choudhary
c403a498a3
fix: add error check in jmespath type conversion in context variables (#10152)
* fix: add error check in jmespath type conversion in context variables

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix(lint): new line in tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: properly update path variable

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: remove log statemet

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-05-01 04:30:34 +00:00
Khaled Emara
c9d821ee72
fix: shared policy context needs to be copied (#10139)
* fix: shared policy context needs to be copied

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test(e2e): concurrent PSS execution

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test(e2e): wait for pss policies to be ready

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-04-30 14:05:33 +00:00
shuting
96ffbadd77
fix: sort pod controllers for autogen rule (#10140)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-04-30 12:26:12 +00:00
Mariam Fahmy
798950f72c
fix: return skip when celPreconditions/matchConditions aren't met (#9940)
* fix: return skip when cel preconditions aren't met

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: return skip when matchConditions in VAPs aren't met

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-04-22 13:49:25 +00:00
Mariam Fahmy
ea64529e63
fix: evaluate namespaceObject for Kyverno policies in the CLI (#9977)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-04-19 10:55:41 +00:00
Mariam Fahmy
e91b80a600
fix: evaluate namespaceObject for VAPs in the CLI (#9978)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-04-19 10:20:03 +00:00
Vishal Choudhary
83f2846572
feat: add TSA cert chain support in cosign (#9961)
* feat: add TSA cert chain support in cosign

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add chainsaw test

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add unit test

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: unit tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2024-03-30 20:50:07 +00:00
Vishal Choudhary
93eac3f7a4
fix: deferred loader panic when mutate and generate policies are applied (#9935)
* fix: deferred loader panic when mutate and generate policies are applied

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: update policies

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* remove clusterrolebinding

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: copy only json context

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: polctx

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-03-29 14:37:15 +01:00
Mariam Fahmy
8369ab6ee1
chore: run codegen-fix-tests (#9942)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-03-26 21:48:08 +05:30
Khaled Emara
429e84be10
fix(globalcontext): panics and validation (#9903) 2024-03-14 16:12:39 +00:00
Vishal Choudhary
f2833861f8
fix: properly update policy context after preexisting resource in violation check (#9893)
* fix: properly update policy context after preexisting resource in violation check

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* chore: remove all copy function usages

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* chore: nit

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* refactor context resource swap

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

* feat: chainsaw tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: test:

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: logger panic

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

* fix: copy cover policycontext

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

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: ShutingZhao <shuting@nirmata.com>
2024-03-13 16:24:53 +00:00
Jim Bugwadia
befcd73ea1
add control names and images to PSS results (#9869)
* add control names and images to PSS results

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

* remove init

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

* fix tets

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

* update chainsaw tests

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

* add unit test

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

---------

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-03-11 09:32:05 +00:00
shuting
bc2f50ae13
fix: add missing unit tests for podSecurity.hostpathVolume check (#9845)
* fix: add missing unit tests

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

* fix: update pinned lib

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

* fix: uncomment code

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-03-04 15:23:06 +00:00
Mariam Fahmy
d8d6d89856
fix: remove duplicate chainsaw tests for PSA (#9835)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-03-01 20:49:04 +08:00
Matt Veitas
5ef7581c5c
[Bug] [CLI] Restore warn-exit-code functionality for apply command (#9828)
* Restore warn-exite-code functionality for apply command

Signed-off-by: Matt Veitas <mveitas@gmail.com>

* Nove error handling

Signed-off-by: Matt Veitas <mveitas@gmail.com>

* Uncomment println statement

Signed-off-by: Matt Veitas <mveitas@gmail.com>

* Fixing linting

Signed-off-by: Matt Veitas <mveitas@gmail.com>

* Adding conformance tets for cli apply command with warn-exit-code

Signed-off-by: Matt Veitas <mveitas@gmail.com>

* Update path to kubectl-kyverno binary

Signed-off-by: Matt Veitas <mveitas@gmail.com>

* Add prepare-cli as needed dependency

Signed-off-by: Matt Veitas <mveitas@gmail.com>

* feat: install kubectl-kyverno in standard conformance tests

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

* fix: update chainsaw config

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

* fix: move CLI chainsaw tests to a separate action

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

* fix: CLI path

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

* fix: name

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

* fix: add chainsaw flag '--no-cluster'

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

* fix: CLI name

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

---------

Signed-off-by: Matt Veitas <mveitas@gmail.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Co-authored-by: ShutingZhao <shuting@nirmata.com>
2024-02-29 13:08:21 +00:00
Mariam Fahmy
07a6bf42f5
fix: add podSecurity validation checks for exceptions (#9817)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-02-28 08:21:10 +00:00
Mariam Fahmy
406cb5d32b
chore: add tests for exceptions in the CLI (#9781)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-02-26 07:57:47 +00:00
Mariam Fahmy
019fcaf377
fix: remove unnecessary podSecurity chainsaw test (#9791)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-02-26 14:23:34 +08:00
Charles-Edouard Brétéché
4bb550d052
chore: move chainsaw config at the root of the repo (#9768)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-24 09:54:53 +00:00
Khaled Emara
2b2587469d
feat: enhance global context (#9710)
* feat(globalcontext): add event handling

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* feat(globalcontext): handle cache sync error

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* feat(globalcontext): ensure api is called during init

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* design(events): decouple events from policies a bit

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* feat(globalcontext): use status

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): make status optional

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): status update

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): codegen

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(globalcontext): delete yaml annotations

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): fix status in tests

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcotext): update enqueue func

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): error

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(globalcontext): rbac

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(globalcontext): retry logic

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): unknown api call in test

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* bump

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix: set unique name for each testing resource

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

* fix: update readme

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

* fix: log msg

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

* fix: add delays

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

* fix: delay gctce creation

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

* debug: check Kyverno status

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

* debug: update chainsaw config

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

* debug: revert chainsaw config

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

* test(globalcontext): print actual status

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): add necessary delays and check status before applying

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test(globalcontext): long refreshInterval

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* debug: log success

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* debug: print informer data

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): use client instead of informer

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* debug: print status after update

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* debug: print ResourceVersion

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* debug: remove gcecontroller from other controllers

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): update status only once

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore: remove excess logs

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): add store to cleanup controller

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-23 10:34:04 +00:00
Mariam Fahmy
956b403c7e
fix: add validation check for podSecurity subrule (#9770)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-02-23 15:16:53 +08:00
Mariam Fahmy
0d7cb9527f
feat: support bindings in Kyvenro CLI test command (#9759)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-02-21 14:00:42 +00:00
Mariam Fahmy
2a277a01c4
feat: apply VAP bindings in CLI apply command in offline mode (#9751)
* feat: apply VAP bindings in CLI apply command in offline mode

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix lint

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-02-21 07:52:25 +00:00
mohamedasifs123
d566e9886c
Fix :variables are not getting processed in validation message for "anyPattern" (#9713)
* Update validate_resource.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Create pod.yaml

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Create chainsaw-test.yaml

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Create policy.yaml

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update validate_resource.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* test

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* test

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* test

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* test

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update chainsaw-test.yaml

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Create README.md

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update test/conformance/chainsaw/validate/clusterpolicy/cornercases/variable-substitution-failure-messages/README.md

Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update test/conformance/chainsaw/validate/clusterpolicy/cornercases/variable-substitution-failure-messages/README.md

Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update test/conformance/chainsaw/validate/clusterpolicy/cornercases/variable-substitution-failure-messages/chainsaw-test.yaml

Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update test/conformance/chainsaw/validate/clusterpolicy/cornercases/variable-substitution-failure-messages/README.md

Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

---------

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
2024-02-21 07:20:43 +00:00
mohamedasifs123
66f54d8fd6
fix: Policies skipped because of preconditions not met should not be included in admission requests denial responses (#9719)
* Update block.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update block.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* lint

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update block.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* test added

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* test

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* test

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* --signoff

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Create README.md

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Rename Policy1.yaml to policy-1.yaml

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update test/conformance/chainsaw/validate/clusterpolicy/cornercases/check-message-upon-resource-failure/README.md

Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update test/conformance/chainsaw/validate/clusterpolicy/cornercases/check-message-upon-resource-failure/README.md

Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update test/conformance/chainsaw/validate/clusterpolicy/cornercases/check-message-upon-resource-failure/chainsaw-test.yaml

Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Rename Policy2.yaml to policy-2.yaml

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

* Update chainsaw-test.yaml

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>

---------

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
Co-authored-by: Chip Zoller <chipzoller@gmail.com>
Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-02-20 15:42:18 +00:00
Khaled Emara
10258921ac
feat(validation-webhook): validate global context reference (#9678)
* feat(validation-webhook): validate global context reference

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(validation-webhook): global reference name

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test(globalcontext): fix tests after valdiation

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(policycache): dont add NotReady Policies

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(globalcontext): rename e2e tests

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(globalcontext): add entry errors

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test(globalcontext): fix chainsaw  test

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
2024-02-08 07:46:58 +00:00
Suruchi Kumari
704c6722ec
[Bug] Fix message and formatting of podSecurity validation failure with restrictedField (#9658)
* fix format

Signed-off-by: Suruchi Kumari <suruchikumarimfp4@gmail.com>

* fix test

Signed-off-by: GitHub <noreply@github.com>

---------

Signed-off-by: Suruchi Kumari <suruchikumarimfp4@gmail.com>
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-08 12:16:23 +08:00
Mariam Fahmy
c815e9bb8f
feat: add chainsaw tests for exceptions (#9672)
* feat: add chainsaw tests for exceptions

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-07 17:58:41 +08:00
Mariam Fahmy
6c9fdaf52b
feat: add chainsaw test for policy webhook based configuration (#9645)
* feat: add chainsaw test for policy webhook based configuration

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-06 18:05:45 +00:00
Khaled Emara
1eda4789d1
test(globalcontext): add e2e tests (#9661)
* fix(globalcontext): validation

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): use existence instead of ready for now

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(globalcontext): improve not ready error message

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): allow any APICall

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(globalcontext): prevent double marshal

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test(globalcontext): add e2e tests

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(globalcontext): move vaildation to OpenAPI V3

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-02-06 17:03:32 +00:00
Mariam Fahmy
ace5b59003
feat: add chainsaw tests for pod security in exceptions (#9667)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-02-06 13:07:58 +00:00
Mariam Fahmy
90ac90b89f
feat: use the check block for checking CLI output in chainsaw tests (#9616)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-02-05 14:59:19 +00:00
Charles-Edouard Brétéché
f529ff9b85
fix: global context validation (#9643)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-05 13:56:44 +00:00
Vishal Choudhary
b5b925bf78
feat: add chainsaw tests for global context crd validation (#9628)
* feat: add chainsaw tests for global context crd validation

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add globalcontext to standard conformance action

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: overlapping names

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-02-04 18:15:55 +01:00
Mariam Fahmy
3510998d4f
feat: Support CEL expression warnings (#9566)
* feat: support CEL expression warnings

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: allow the policy creation but return warnings to the API server

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: ShutingZhao <shuting@nirmata.com>
2024-02-02 10:04:02 +00:00
shuting
5f0d53fe34
feat: apply .matchConditions when generating reports (#9599)
* enable matchconditions for reports

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

* update

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

* add chainsaw tests

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

* fix: linter issues

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

* chore: move files

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-02-02 08:32:28 +00:00
Charles-Edouard Brétéché
8d528675de
chore: enable chainsaw fail fast (#9606)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-01 17:30:21 +00:00
shuting
273a0a52f9
chore: add chainsaw tests for policy based webhook configuration (#9561)
* add chainsaw tests

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

* add chainsaw tests

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

* update policy

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

* add delay

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

* add debug steps

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

* attempt fix

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

* attempt fix

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-01-31 16:44:01 +00:00
Anushka Mittal
cfc9683033
Changes to dynamically configure webhooks (#8437)
* Changes to dynamically configure webhooks

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add unit tests

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add kuttl tests

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Refactoring

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct unit test

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Change way of webhooks configured

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct tests with new changes

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add delete operation by default

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct tests with new changes

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct order for operations

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add corrections

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add mutatingwebhookconfiguration test

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct unit test

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Added policy.yaml in mutate webhook test

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add corrections in kuttl test and code

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Change name of test

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Changes to update webhooks manifest

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add corrections for dynamic-op-mutate kuttl test

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add minor changes; remove unnecessary file

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct adding operations for MutatingWebhookConf

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* dynamic op mutate and validate added

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Resolve conflicts

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Filter rules for mutatingwebhookconf correctly

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* replace TestStep with Test in chainsaw tests

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* converted to new chainsaw-test format

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* minor corrections

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* remove isMutationEmpty()

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* initial changes for dynamic opn enhancements

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* rename variables

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* resolve lint errors

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* refactor code

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* add changes for exclude operations

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* add conformance tests

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* add unit tests

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* corrections in conformance tests

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* modification in unit tests

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* correction in conformance tests

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Update .vscode/launch.json

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

* update variable usage

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* remove testresults

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

---------

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Co-authored-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shutting06@gmail.com>
2024-01-31 15:46:53 +00:00
shuting
635f160ae0
feat (generate): add orphanDownstreamOnPolicyDelete to preserve downstream on policy deletion (#9579)
* add chainsaw tests

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

* add .orphanDownstreamOnPolicyDelete

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

* update codegen

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

* update docs

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-01-31 13:50:38 +02:00
Vishal Choudhary
82b65aebc4
feat: add fail/warn on deprecated/invalid operators (#8624)
* feat: add fail/warn on deprecated/invalid operators

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: nested for each

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: chainsaw-test.yaml

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-01-31 08:40:28 +00:00
Charles-Edouard Brétéché
2b824be667
fix: omit events flag (#9572)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-30 23:41:13 +00:00
Charles-Edouard Brétéché
9102753323
fix: make alternate reports storage transparent (#9553)
* fix: make alternate reports storage transparent

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bg scan

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* aggregation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* aggregation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* rm manager

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* update

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fixes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fixes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-30 14:53:37 +00:00
Liang Deng
8298a9a858
fix: validate pattern premature skip (#9155)
Signed-off-by: Liang Deng <283304489@qq.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-01-29 13:06:39 +00:00
Mariam Fahmy
9ed14cb779
feat: support vap bindings in reports (#9506)
* feat: support vap bindings in reports

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: add binding to the rule response

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* add chainsaw test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix lint

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* add chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-29 12:49:17 +01:00
Mike Bryant
c40dab9ea0
fix: Allow generate cli tests to work with server-side apply policies (#9385)
* test: Add test case for useServerSideApply

Signed-off-by: Mike Bryant <mike.bryant@mettle.co.uk>

* fix: Allow generate cli tests to work with server-side apply policies

Signed-off-by: Mike Bryant <mike.bryant@mettle.co.uk>

---------

Signed-off-by: Mike Bryant <mike.bryant@mettle.co.uk>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-29 11:15:13 +00:00
Charles-Edouard Brétéché
90cff77300
fix: CRDs codegen (#9542)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-29 09:45:52 +00:00
Charles-Edouard Brétéché
6a41c813fa
chore: remove reference to kuttl (#9539)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-27 23:01:32 +00:00
Mariam Fahmy
f01f0d6dc4
feat: support podSecurity exclusion in exceptions (#9343)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-01-26 18:43:07 +00:00
Florian Hopfensperger
8781a38849
feat: configure webhook scope based on resource and policy type (#8065)
* feat: configure webhook scope based on policy type

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

* Update pkg/controllers/webhook/controller.go

Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>

* feat: configure webhook scope based on resource type

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

* review comments

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

* sorting of webhooks

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

* Update pkg/controllers/webhook/utils.go

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix imports

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

---------

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>
Signed-off-by: shuting <shuting@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-26 15:07:42 +00:00
Vishal Choudhary
e6c39f31a5
feat: add a new API group reports.kyverno.io (#9521)
* feat: add new report interface

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* chore: reports.kyverno.io/v1 apigroup

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* chore: codegen

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add report manager

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add reports manager to reports controller

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add alternateReportStorage to helm chart

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: report utils deepcopy

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* init flag

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: wrong return value

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-26 13:40:29 +00:00
Vishal Choudhary
87c7ce254a
feat: add skipImageReferences in verify images (#8633)
* feat: add skipImageReferences in verify images

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: chainsaw tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: chainsaw-test.yaml

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: typo in assert

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-23 12:27:39 +00:00
Vishal Choudhary
a0afda4f0a
fix: allow multiple keys in verifyImages.attestations.attestors.entries (#8880)
* fix: allow multiple keys in verifyImages.attestations.attestors.entries

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-01-22 06:49:22 +00:00
Mariam Fahmy
560aab2e69
fix PSA chainsaw tests (#9389)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-18 23:23:52 +00:00
Mariam Fahmy
a791d9ac35
feat: skip generating VAP when an exception is defined (#9386)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-01-18 15:55:27 +00:00
Mariam Fahmy
f0564b3019
feat: re-evaluate policy exceptions for existing resources and modify reports accordingly (#8659)
* feat: re-evaluate policy exceptions for existing resources and modify reports accordingly

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: use v2 of exceptions

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: use properties in the reports result

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-01-17 10:00:15 -08:00
shuting
600e19b340
fix: clean up URs if the trigger doesn't exist (#9355)
* clean up URs if trigger is not present

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

* add chainsaw tests

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

* increase timeout

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

* chore: clarify user variables failure

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-01-09 10:30:31 +01:00
Mariam Fahmy
e1a26f8eed
fix PSA chainsaw tests (#9341)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-01-05 08:57:40 +08:00
Mariam Fahmy
f8c5571ddc
fix: remove the check of exclude in VAPs (#9331)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-01-03 17:37:30 +00:00
Mariam Fahmy
25a6cd97e0
fix a chainsaw test (#9332)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-01-03 19:22:16 +08:00
Khaled Emara
3d985872df
Add Chainsaw Test for Conditional Anchor (#9295)
Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-12-28 12:15:06 +00:00
Khaled Emara
d5491746e7
fix(cli): handle excluded resources as pass (#9274)
* fix(cli): handle excluded resources as pass

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test: add cli test for exclude

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
2023-12-28 07:16:55 +00:00
Gurmannat Sohal
6902a2b092
Unit tests for Pod Security Admission Integrations (#8585)
* feat: enable field-restricted exclusions using the psa

Signed-off-by: Liang Deng <283304489@qq.com>

* fix ci error

Signed-off-by: Liang Deng <283304489@qq.com>

* fix ci error

Signed-off-by: Liang Deng <283304489@qq.com>

* initial unit tests

* Add all remaining unit tests

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* fine grain unit tests by adding fields and values

* add detailed pod level exclusion and related tests

* add tests for init & ephemeral containers

* add kuttl tests for the new advanced support

* add kuttl tests for the new advanced support

* add readme for kuttl tests

* add replacement in go.mod

* resolving CI errors

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* fix ci errors

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* fix ci errors

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* updating pod-security-admissio

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* resolving null pointer panic

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* resolved conformance error

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* chainsaw

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* remove duplication

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* fix linting

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* remove over computation

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* added field checks, pss skip condition

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* correcting chainsaw tests

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* merge branch 'main' into unit-tests

Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>

* fix builds

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

---------

Signed-off-by: Liang Deng <283304489@qq.com>
Signed-off-by: Gurmannat Sohal <iamgurmannatsohal@gmail.com>
Signed-off-by: shuting <shuting@nirmata.com>
Signed-off-by: Gurmannat Sohal <95538438+itsgurmannatsohal@users.noreply.github.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Liang Deng <283304489@qq.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-26 22:28:08 +08:00
Charles-Edouard Brétéché
2b5aef75f1
feat: add cleanup policies v2 (#9261)
* feat: add cleanup policies v2

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix test

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix: test

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-22 20:43:27 +02:00
Mariam Fahmy
b61a1f3d18
fix: set v2beta1 of exceptions the storage version (#9254)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-12-22 10:13:58 +00:00
Mariam Fahmy
af0ff92ca3
fix: remove unused file in a test (#9240)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-12-21 11:49:57 +00:00
shuting
85e0d9b836
fix mutate existing force reconciliation (#9230)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-12-20 16:29:37 +00:00
Mariam Fahmy
fe8f8faa8b
fix: add chainsaw test for mutate existing (#9210)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-12-19 18:15:34 +00:00
Mariam Fahmy
8e0a7aa204
feat: promote policy exceptions to v2 (#9208)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-12-19 10:43:39 +00:00
shuting
7282ecca9f
fix: add skipBackgoundRequests to configure loop protection option (#9157)
* fix typo

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

* add new attribute skipBackgroundRequests

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

* move to per rule config

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

* check flag

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

* clean up

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

* update docs

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

* fix logger

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

* add retryCount to ur.status

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

* add chainsaw tests

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-12-19 06:25:12 +00:00
Charles-Edouard Brétéché
05fcb43982
chore: add cli update test (#9192)
* chore: add cli update test

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* update

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-18 20:47:27 +00:00
Mariam Fahmy
68a1258899
fix: limit the trigger name to a maximum of 63 characters for mutate existing rules (#9162)
* fix: limit the trigger name to a maximum of 63 characters for mutate existing rules

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-12-18 09:23:40 +00:00
Mariam Fahmy
dd055e54b7
chore: move a mutateExisting chainsaw test under its directory (#9165)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-12-15 15:14:00 +00:00
Mariam Fahmy
eab6b4eceb
fix: updaterequests stuck in pending/fail infinite loop (#9119)
* fix: updaterequests stuck in pending/fail infinite loop

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: prevent creating URs upon DELETE unless it is specified

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-12-15 16:42:10 +02:00
Charles-Edouard Brétéché
4564e1de8f
fix: chainsaw test (#9148)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-12-13 09:24:00 +00:00
Vishal Choudhary
1f4181645b
fix: allow changes to preexisting resource in violation of a policy in Enforce (#9027)
* fix: allow changes to preexisting resource in violation of a policy in Enforce

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: missing error check

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* nit: cleanup

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: update old policy context

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: preconditions always retured true

internal.CheckPreconditions always returned true when v.anyAllConditions, it should be populated with rule.RawAnyAllConditions when newValidator() is used to create a validator

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: fix chainsaw test

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: nit

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* debug

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: update test

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: add namespace

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add test for bad to good conversion

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add test step

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-12-12 09:17:53 +00:00
Charles-Edouard Brétéché
b9b4b3e484
chore: bump chainsaw (#9114)
* chore: bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* remove sleeps

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-08 01:14:23 +02:00
Charles-Edouard Brétéché
2ceac72f62
chore: convert chainsaw tests to Test resource (#9113)
* chore: convert chainsaw tests to Test resource

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-07 22:38:30 +01:00
Charles-Edouard Brétéché
4bb89e1ce0
chore: convert chainsaw tests to Test resource (#9109)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-07 14:08:04 +00:00
Charles-Edouard Brétéché
fd45cc5eee
chore: improve cluster startup in conformance tests (#9103)
* chore: improve cluster startup in conformance tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix flake

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix flake

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-07 17:30:03 +05:30
Anton Chernev
4d2f7fa8d3
fix: Provide kind list hints to the fake dynamic client. (#9036)
* fix: Provide kind list hints to the fake dynamic client.

If one uses the `cloneList` option of `generate` without this, a panic
occurs.

Signed-off-by: Anton Chernev <anton.chernev@gmail.com>

* Added test for `cloneList`.

Signed-off-by: Anton Chernev <anton.chernev@gmail.com>

* fix: ttl cleanup not working with cluster wide resources (#9060)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Anton Chernev <anton.chernev@gmail.com>

* Fix Helm chart to not error when replicas defined (#9066)

Fixes #8941

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
Signed-off-by: Anton Chernev <anton.chernev@gmail.com>

* fix: add nodeSelector to the reports cleanup helm hook (#9065)

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: Anton Chernev <anton.chernev@gmail.com>

* optimize JSON context processing using in-memory maps (#8322)

* optimize JSON context processing using in memory maps

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

* fix excessive logs

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

* fix mutate resource diff

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

* uncomment tests

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

* copy resource, as it can be modified

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

* clear prior resource to prevent mutating original

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

* linter fix

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

* fix ImageInfo to unstructured conversion

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

* fix custom image extractors

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

* do not update mutated resource in JSON context

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

* address review comments

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

---------

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Co-authored-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
Signed-off-by: Anton Chernev <anton.chernev@gmail.com>

* Ran `gci` to silence a lint warning.

Signed-off-by: Anton Chernev <anton.chernev@gmail.com>

* Added a log message when an invalid or incomplete `cloneList` kind is supplied.

Signed-off-by: Anton Chernev <anton.chernev@gmail.com>

---------

Signed-off-by: Anton Chernev <anton.chernev@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Co-authored-by: Anton Chernev <a-anchernov@expediagroup.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: treydock <tdockendorf@osc.edu>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-12-07 06:03:27 +00:00
Charles-Edouard Brétéché
f2561d0095
chore: convert chainsaw tests to Test resource (#9100)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-06 21:39:17 +00:00
Charles-Edouard Brétéché
8f6f21c5c7
chore: convert chainsaw tests to Test resource (#9099)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-06 18:29:51 +00:00
Charles-Edouard Brétéché
4a557ba2cf
chore: convert chainsaw tests to Test resource (#9094)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-06 16:27:10 +00:00
Charles-Edouard Brétéché
620d0f3dd5
chore: convert chainsaw tests to Test resource (#9087)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-05 22:28:28 +00:00
Charles-Edouard Brétéché
fd10739919
chore: bump chainsaw (#9071)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-12-04 12:39:10 +00:00
Charles-Edouard Brétéché
78b99def0b
chore: bump chainsaw (#9064) 2023-12-04 10:48:12 +00:00
Jim Bugwadia
46f02a8ba7
optimize JSON context processing using in-memory maps (#8322)
* optimize JSON context processing using in memory maps

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

* fix excessive logs

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

* fix mutate resource diff

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

* uncomment tests

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

* copy resource, as it can be modified

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

* clear prior resource to prevent mutating original

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

* linter fix

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

* fix ImageInfo to unstructured conversion

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

* fix custom image extractors

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

* do not update mutated resource in JSON context

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

* address review comments

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

---------

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Co-authored-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-12-04 07:35:36 +00:00
Charles-Edouard Brétéché
426525be37
chore: fix chainsaw tests cleanup timeout (#9028)
* chore: fix chainsaw tests cleanup timeout

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* grace

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* checks

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix deletes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix exceptions

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-28 06:32:32 +05:30
Charles-Edouard Brétéché
4c275bca05
chore: remove kuttl tests folder (#9023)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-27 10:49:06 +00:00
Mariam Fahmy
1404ea0966
fix: delete VAPs in case Kyverno policies can't be translated (#8887)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-11-27 06:36:01 +00:00
Charles-Edouard Brétéché
1a331f1297
chore: fix chainsaw exec timeout issue (#9013)
* chore: fix chainsaw timeouts issues

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* exec timeout

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix cleanup

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* custom sigstore fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* mutate

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-26 23:43:29 +08:00
Charles-Edouard Brétéché
5a47d301e1
chore: enable all chainsaw tests (#9012)
* chore: enable all chainsaw tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fixes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-11-24 19:49:40 +01:00
Charles-Edouard Brétéché
d6933fff4f
chore: all chainsaw tests (#9011)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-24 11:17:58 +01:00
Charles-Edouard Brétéché
ccf020abab
fix: extend chainsaw cleanup timeout (#9008)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-24 09:20:36 +00:00
Charles-Edouard Brétéché
6d3dd4f4fe
chore: migrate tests to chainsaw (#8997)
* chore: migrate tests to chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* cleanup

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* cleanup

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix: exec timeout

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* exceptions

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* exceptions

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* filter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-24 00:02:22 +00:00
Mariam Fahmy
c6929475b6
chore: run vap reports test suite using chainsaw (#8965)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-11-22 23:17:41 +00:00
Mariam Fahmy
11b51aa487
chore: run autogen tests with chainsaw (#8937)
* chore: run autogen tests with chainsaw

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: remove the creationTimestamp from the TestStep

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* chore: run autogen tests with chainsaw

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: remove the creationTimestamp from the TestStep

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-22 23:46:44 +01:00
Vishal Choudhary
c630f17ec4
fix: block mutation only when failurePolicy is set to fail (#8952)
* fix: only block mutation when failurePolicy is set
to fail

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: kuttl test

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: add else check

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: update defaulting ns label policy's failure policy to be fail

based on readme, this test has nothing to do with failurePolicy and resource should not be blocked in case of ignore failurePolicy

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: there is another

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: update policy

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* nit

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add logs

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* Update pkg/webhooks/resource/mutation/mutation.go

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

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: shuting <shutting06@gmail.com>
2023-11-22 17:01:46 +00:00
Mariam Fahmy
6d7571f4bb
chore: run events test suite using chainsaw (#8951)
* chore: run events test suite using chainsaw

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* chainsaw main test

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-22 16:58:32 +01:00
Vishal Choudhary
72524c792c
fix: update KeysAreMissing() to ignore negations in resource (#8953)
* fix: update KeysAreMissing() to ignore negations in resource

KeysAreMissing() checks if a key is missing in a resource, since a negation should not be present in the resource, it should not count as a missing key

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: pod is supposed to fail

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2023-11-22 09:06:40 +00:00
Mariam Fahmy
2902411f50
chore: run force-failure-policy-ignore test using chainsaw (#8966)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-11-20 20:08:32 +00:00
Mariam Fahmy
fee67e8bc8
chore: run generate VAP test suite using chainsaw (#8958)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-11-20 18:26:37 +01:00
Charles-Edouard Brétéché
4dbd71459a
chore: run range operators test with chainsaw (#8956)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-20 06:41:19 +00:00
Mariam Fahmy
569b50c069
chore: run rbac testsuite using chainsaw (#8950)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-11-19 23:53:48 +00:00
Pushkar Mishra
765bd198f1
[DOC] fixed typo and broken links (#8954)
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Co-authored-by: Chip Zoller <chipzoller@gmail.com>
2023-11-19 13:49:10 +00:00
Mariam Fahmy
fc841c0417
chore: run background-only tests with chainsaw (#8943)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-11-19 01:30:42 +00:00
Charles-Edouard Brétéché
dcea5b084d
chore: install chainsaw with gh action (#8948)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-18 23:20:46 +00:00
Mariam Fahmy
31858abb0b
fix: use validate.message in case there is no message associated with the CEL expression (#8883)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-11-13 14:53:24 +00:00
Chandan-DK
cafc0990f9
fix: generate policy fails if triggered resource name exceeds 63 characters limit (#8466)
* fix: generate label resource name character length issue

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* add source label

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* modify newUR function

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* fix

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* improve readability

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* remove generate source name label

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* Revert changes

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* update ResourceSpec

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* add URGenerateResourceUIDLabel

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* make codegen crds all

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* make codegen client all

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* add GenerateSourceUIDLabel

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* modify comment

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* make codegen crds all

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* make codegen-docs-all

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* make codegen-all

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* set trigger uid

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* add uid in transform()

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* add name label

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* fix: use resource name labels along with its UID

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: use the resource name label only if its uid label isn't set

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* add kuttl tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: delete the trigger resource in the test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: delete the source in the kuttl test

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* add generate trigger uid label

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* modify TriggerInfo function

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* populate uid field for new update requests

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* populate new ur spec with uid

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* handle downstream resources cleanup

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* populate uid of ur status

Signed-off-by: Chandan-DK <chandandk468@gmail.com>

* fetch triggers by the UID label

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

* label triggers

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

* fetch trigger by comparing UID

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

* fetch cloneList downstream resource by UID

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

* update test names

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

* remove trigger name label assertions from kuttl tests

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

* add unit name selector

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

* add sleep

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

* assert events on failures

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

* rename tests

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

---------

Signed-off-by: Chandan-DK <chandandk468@gmail.com>
Signed-off-by: Chip Zoller <chipzoller@gmail.com>
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Chip Zoller <chipzoller@gmail.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-11-06 10:37:13 +00:00
Anushka Mittal
f3c03f5257
Changes to correctly run delete operation in kyverno11beta4 (#8786)
* Changes to correctly run delete operation in kyverno11beta4

Co-authored-by: Anushka Mittal <anushka@nirmata.com>
Co-authored-by: Julian-Chu <yulang.chu@gmail.com>

Signed-off-by: Anushka Mittal <anushka@nirmata.com>

* Update test/cli/test/deny-pod-deletion/deny-pod-deletion.yaml

Co-authored-by: Chip Zoller <chipzoller@gmail.com>
Signed-off-by: shuting <shutting06@gmail.com>

* Update test/cli/test/deny-pod-deletion/deny-pod-deletion.yaml

Co-authored-by: Chip Zoller <chipzoller@gmail.com>
Signed-off-by: shuting <shutting06@gmail.com>

* Add README.md for new test

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct policy.yaml

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add new lines in test files

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct kyverno-test file

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct values.yaml

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Correct test files

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

* Add new test

Signed-off-by: anushkamittal2001 <anushka@nirmata.com>

---------

Signed-off-by: Anushka Mittal <anushka@nirmata.com>
Signed-off-by: shuting <shutting06@gmail.com>
Signed-off-by: anushkamittal2001 <anushka@nirmata.com>
Signed-off-by: Anushka Mittal <138426011+anushkamittal2001@users.noreply.github.com>
Co-authored-by: shuting <shutting06@gmail.com>
Co-authored-by: Chip Zoller <chipzoller@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-11-02 08:25:46 -04:00
Mariam Fahmy
e175998dd2
fix: generate events for scanning VAPs in reports controller (#8783) 2023-10-31 13:53:28 +00:00
Charles-Edouard Brétéché
af14780f5c
chore: run tests with chainsaw (#8762)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-10-27 16:33:58 +00:00
Rakshit Gondwal
b574802c12
feat: support conditions in PolicyException (#8577)
* feat: support conditions in PolicyException

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* fix matchesException func

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* add codegen-all files

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* fix after review

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* remove variable validation from PolicyException

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* fix after review

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* add kuttl tests

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* remove ValidateVariables() from tests

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* fix errors

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* remove check-variables kuttl test

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* fix after review

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

* add sleep step to kuttl

Signed-off-by: Rakshit Gondwal <98955085+rakshitgondwal@users.noreply.github.com>

* miinor fix

Signed-off-by: Rakshit Gondwal <98955085+rakshitgondwal@users.noreply.github.com>

* add readme for kuttl test

Signed-off-by: Rakshit Gondwal <98955085+rakshitgondwal@users.noreply.github.com>

---------

Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>
Signed-off-by: Rakshit Gondwal <98955085+rakshitgondwal@users.noreply.github.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2023-10-24 10:45:52 +00:00
Mariam Fahmy
e969248483
chore: bump cleanup policies to v2beta1 (#8621)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-10-12 19:45:33 +08:00
shuting
360bcc83ee
Revert "chore: bump cleanup policies to v2beta1 (#8594)" (#8609)
This reverts commit fff3ad047e.
2023-10-09 15:01:24 +00:00
Mariam Fahmy
fff3ad047e
chore: bump cleanup policies to v2beta1 (#8594)
* chore: bump cleanup policies to v2beta1

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* chore: remove the support of v2alpha1 cleanup policies

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-10-09 19:37:15 +08:00
AdamKorcz
080a96fed4
Refactor fuzzing utils and add 3 fuzzers (#8555)
* Refactor fuzzing utils and add 3 fuzzers

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Fix lint issues

Signed-off-by: AdamKorcz <adam@adalogics.com>

* use latest go-jmespath

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Check layer size (#8552)

* fix excessive logs

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

* check fetched layer size

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

* check sig layer size

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

---------

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

* fix lint issues

Signed-off-by: AdamKorcz <adam@adalogics.com>

---------

Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2023-10-05 16:33:26 +00:00
Charles-Edouard Brétéché
482c243517
refactor: remove openapi package (#8538)
* refactor: openapi package

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kubectl validate

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* rm

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* go mod

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix vscode

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-27 16:21:47 +00:00
Charles-Edouard Brétéché
2444b7c670
refactor: add per resource reports aggregation (#8426)
* refactor: add per resource reports aggregation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* added controller implementation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* clean

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix kuttl tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix kuttl tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* vaps

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-20 14:51:32 +08:00
Charles-Edouard Brétéché
6a43ec4bcf
chore: fix policies (#8449)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-19 10:28:58 +00:00
Vishal Choudhary
e2469415b7
feat: add support for custom sigstore using TUF (#8385)
* feat; add support for custom sigstore using TUF

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: add kuttl test

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: add commit hash

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: add kyverno.yaml

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update kyverno deployment

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update ordering

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update deployment

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update create image step

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: remove wait step

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: install crane

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: set sha on install crane

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: add cosign installer

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update custom deployment

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: helm chart linting

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update Chart.yaml

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* fix: helm values liniting error

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: remove step

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: kind-deploy-kyverno

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: create configmap in kyverno namespace

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update policy

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: create kyverno ns

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: use envfrom

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* fix: indentation

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update tuf root

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: add sigstore volume

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: nit

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: remove tuf root

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: use default tuf instead :(

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update Create kind cluster

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: remove root

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update impl

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: nit

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: use custom test

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: remove force

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: cosign initialize

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: add yes flag

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* update manifest

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: move tuf to features

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: update comments

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* chore: helmchart generate

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: trailing white space

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: remove old fields

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* feat: decouple env config map from tuf

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* change the way we pass flags

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix: re add envConfigMap

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* fix env vars

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* remove envConfigMap

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-18 13:16:08 +00:00
Charles-Edouard Brétéché
382754c055
feat: fix variables used in tests (#8438)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-18 12:32:04 +00:00
Charles-Edouard Brétéché
2e4bf7ee83
feat: fix user infos used in tests (#8429)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-18 10:51:35 +00:00
Charles-Edouard Brétéché
7562bea6db
chore: apply policy fixes (#8427)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-17 22:24:26 +00:00
Charles-Edouard Brétéché
a43a20adb9
feat: add cli api schemas (#8422)
* feat: add cli values schema

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* docs

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* makefile

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* v1alpha1

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* codegen

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* nits

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-17 23:50:17 +03:00
Charles-Edouard Brétéché
9361100f17
chore: apply policy fixes (#8425)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-15 21:48:46 +05:30
Charles-Edouard Brétéché
27b9ddea5d
chore: apply policy fixes (#8423)
* chore: apply policy fixes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* prune validate

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* prune dryrun

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* pruning

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-09-15 14:47:51 +00:00
Charles-Edouard Brétéché
5433cb9a69
chore: fix cli test files (#8418)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-15 09:48:30 +00:00
Charles-Edouard Brétéché
410f99f624
refactor: add cli fix package (#8400)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-14 21:36:32 +02:00
Charles-Edouard Brétéché
2a136f5b8d
feat: use kubectl-validate to load policies (#8384)
* feat: use kubectl-validate to load policies

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* schemas

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* policies v2beta1

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* option

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* defaulting test

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* makefile

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* makefile

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-14 15:17:02 +00:00