-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vishal Choudhary <[email protected]>
- Loading branch information
1 parent
c6b1ae0
commit 8806d5c
Showing
6 changed files
with
158 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
cmd/examples/external-api-image-verification/api-call-err-out.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Verification Result: | ||
Results for policy: test | ||
Results for rule: external-api | ||
Verifying image: , result: ERROR | ||
Error encountered: failed to fetch data for APICall: HTTP 406 Not Acceptable: no images were provided | ||
|
4 changes: 4 additions & 0 deletions
4
cmd/examples/external-api-image-verification/api-call-out.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Verification Result: | ||
Results for policy: test | ||
Results for rule: external-api | ||
Verifying image: ghcr.io/kyverno/test-verify-image:signed, result: PASS |
64 changes: 64 additions & 0 deletions
64
cmd/examples/external-api-image-verification/policy-api-call-err.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
apiVersion: nirmata.io/v1alpha1 | ||
kind: ImageVerificationPolicy | ||
metadata: | ||
name: test | ||
spec: | ||
rules: | ||
- name: external-api | ||
match: | ||
any: | ||
- (length(containerDefinitions) > `0`): true | ||
context: | ||
- name: resp | ||
apiCall: | ||
method: POST | ||
data: | ||
- key: imageReferences | ||
value: | ||
- "844333597536.dkr.ecr.us-west-2.amazonaws.com*" | ||
- key: attestations | ||
value: | ||
- imageReference: "*" | ||
type: | ||
- name: sbom/example | ||
conditions: | ||
all: | ||
- key: \{{creationInfo.licenseListVersion}} | ||
operator: Equals | ||
value: "3.17" | ||
message: invalid license version | ||
service: | ||
url: http://127.0.0.1:3000/ | ||
imageExtractors: | ||
- name: test | ||
path: /containerDefinitions/*/image/ | ||
verify: | ||
- imageReferences: ghcr.io/kyverno/test-verify-image* | ||
externalService: | ||
- apiCall: | ||
method: POST | ||
data: | ||
- key: images | ||
value: "{{images}}" | ||
- key: imageReferences | ||
value: | ||
- "844333597536.dkr.ecr.us-west-2.amazonaws.com*" | ||
- key: attestations | ||
value: | ||
- imageReference: "*" | ||
type: | ||
- name: sbom/example | ||
conditions: | ||
all: | ||
- key: \{{creationInfo.licenseListVersion}} | ||
operator: Equals | ||
value: "3.17" | ||
message: invalid license version | ||
service: | ||
url: http://127.0.0.1:3000/ | ||
conditions: | ||
- all: | ||
- key: "{{ verified }}" | ||
operator: Equals | ||
value: true | ||
message: aws signer verification failed |
66 changes: 66 additions & 0 deletions
66
cmd/examples/external-api-image-verification/policy-api-call.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
apiVersion: nirmata.io/v1alpha1 | ||
kind: ImageVerificationPolicy | ||
metadata: | ||
name: test | ||
spec: | ||
rules: | ||
- name: external-api | ||
match: | ||
any: | ||
- (length(containerDefinitions) > `0`): true | ||
context: | ||
- name: resp | ||
apiCall: | ||
method: POST | ||
data: | ||
- key: images | ||
value: "{{images}}" | ||
- key: imageReferences | ||
value: | ||
- "844333597536.dkr.ecr.us-west-2.amazonaws.com*" | ||
- key: attestations | ||
value: | ||
- imageReference: "*" | ||
type: | ||
- name: sbom/example | ||
conditions: | ||
all: | ||
- key: \{{creationInfo.licenseListVersion}} | ||
operator: Equals | ||
value: "3.17" | ||
message: invalid license version | ||
service: | ||
url: http://127.0.0.1:3000/ | ||
imageExtractors: | ||
- name: test | ||
path: /containerDefinitions/*/image/ | ||
verify: | ||
- imageReferences: ghcr.io/kyverno/test-verify-image* | ||
externalService: | ||
- apiCall: | ||
method: POST | ||
data: | ||
- key: images | ||
value: "{{images}}" | ||
- key: imageReferences | ||
value: | ||
- "844333597536.dkr.ecr.us-west-2.amazonaws.com*" | ||
- key: attestations | ||
value: | ||
- imageReference: "*" | ||
type: | ||
- name: sbom/example | ||
conditions: | ||
all: | ||
- key: \{{creationInfo.licenseListVersion}} | ||
operator: Equals | ||
value: "3.17" | ||
message: invalid license version | ||
service: | ||
url: http://127.0.0.1:3000/ | ||
conditions: | ||
- all: | ||
- key: "{{ verified }}" | ||
operator: Equals | ||
value: true | ||
message: aws signer verification failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters