Skip to content

Commit 8b63cea

Browse files
added configs
1 parent 00a10a7 commit 8b63cea

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed

app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ app.get('/', (req, res) => {
77

88
const port = process.env.PORT || 3000;
99
app.listen(port, () => {
10-
console.log(`Server running on port ${port}`);
10+
console.log(`Server running on port yeas it's running ${port}`);
1111
});

pod2.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
labels:
6+
app: nginx
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: nginx
12+
template:
13+
metadata:
14+
labels:
15+
app: nginx
16+
spec:
17+
imagePullSecrets:
18+
- name: regcred
19+
containers:
20+
- name: nginx
21+
image: ghcr.io/hackeramitkumar/test5:app2 # NEW VERSION of image
22+
ports:
23+
- containerPort: 80

policy2.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: kyverno.io/v1
2+
kind: ClusterPolicy
3+
metadata:
4+
name: check-image-signature
5+
annotations:
6+
policies.kyverno.io/title: Check Image Signature
7+
policies.kyverno.io/category: ImageSignature
8+
policies.kyverno.io/severity: medium
9+
policies.kyverno.io/subject: Pod
10+
policies.kyverno.io/minversion: 1.7.0
11+
policies.kyverno.io/description: >-
12+
Using the Cosign project, OCI images may be signed to ensure supply chain
13+
security is maintained. Those signatures can be verified before pulling into
14+
a cluster. This policy checks the signature of an image repo called
15+
ghcr.io/kyverno/test-verify-image to ensure it has been signed by verifying
16+
its signature against the provided public key. This policy serves as an illustration for
17+
how to configure a similar rule and will require replacing with your image(s) and keys.
18+
spec:
19+
webhookTimeoutSeconds: 15
20+
validationFailureAction: audit
21+
background: false
22+
rules:
23+
- name: verify-image-signature
24+
match:
25+
resources: {}
26+
any:
27+
- resources:
28+
kinds:
29+
- Pod
30+
namespaces:
31+
- "test"
32+
verifyImages:
33+
- imageReferences:
34+
- "*"
35+
mutateDigest: true
36+
required: true
37+
verifyDigest: true
38+
attestors:
39+
- entries:
40+
- keys:
41+
publicKeys: |
42+
-----BEGIN PUBLIC KEY-----
43+
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFN8gGjQua2g8N+aLx3Eff+/j5HxL
44+
bV+H2z50/0A4d8XyMUvizPQBtcgei43pqLj1850m3wSwI08z2+6zT1QaEg==
45+
-----END PUBLIC KEY-----
46+
# BC: https://github.com/kyverno/kyverno/issues/5738
47+
mutate: {}
48+
validate: {}
49+
exclude:
50+
resources: {}
51+
generate:
52+
clone: {}
53+
cloneList: {}

0 commit comments

Comments
 (0)