Skip to content

Commit 562ee55

Browse files
committed
Add trivy
1 parent f529dd1 commit 562ee55

File tree

5 files changed

+90
-3
lines changed

5 files changed

+90
-3
lines changed

infra/argocd/clusters/k3d-apps-secret.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
ingressNginx: "true"
1515
keda: "true"
1616
rollouts: "true"
17+
trivyOperator: "true"
1718
stringData:
1819
name: ENC[AES256_GCM,data:9exv/ld6rZA=,iv:9N6qQyLWvijt79A2fOzc9o/fpwUCUx2JVFMq1GFkKX0=,tag:RvLcIQ9lsJgdqjs+lPRNfw==,type:str]
1920
server: ENC[AES256_GCM,data:/9AHbxcjW3UBv+j3y+AjcT1iFIjVbvybbxZGVEzm0rr6ZEEqMsw=,iv:x75RrCQ3FREKm6ZGx3mmMsgbyT0EXeBuDJJegwCjFos=,tag:iUPmbMYWfc0DdU3+w++0TA==,type:str]
@@ -33,8 +34,8 @@ sops:
3334
eVpFT1pHMFJPYTNtTlhtblFzZzJveEkK4ihkLkZFN35QcvigsTod1OWQc19Ozj2H
3435
95dh6IL4ROKug3HiLrcQwItsFiKP3+u+3RKx4mQN3CBSaM+ilvWLQg==
3536
-----END AGE ENCRYPTED FILE-----
36-
lastmodified: "2025-01-21T12:49:56Z"
37-
mac: ENC[AES256_GCM,data:Y6byGonFhNO5IFoaaubcGO7/8lQFbQ3yUyvtg6TETK55tR/UVjrwr3j3GNwz3mowg5CWdQiW2gx83xDl+RoRTuZbEQTE2vUBEsdspi5niJydQNfLi4em/CRRlcIEe8Y/wMJjPWvCuwzU4O+ieuwUkeIU1n/uNcubFDJP6CwJmKo=,iv:OB3jBhoAA4RiJb5zhjHtv/v0NJQxT9T4vigf498ORx0=,tag:JaVpjPxxS47tAUTNhpsAkA==,type:str]
37+
lastmodified: "2025-02-01T12:21:24Z"
38+
mac: ENC[AES256_GCM,data:ycNc/XzZv4F1VKVmkWK3DSr7Wctu00TdIOzNtSKM6iz5612x7hQU1T9S79bB40AHkx1Brm36+x5PMPjM4JhF863dc+XqnQK56WPuVUESD+WNL72FZexNFh0zVEw/TF7CH6rlfITV70rQJpj2vkd6HtLhYJJvLP40Tj3rhDmrULo=,iv:mvmY08YpRhr17PZ2Y3pn5XJvCicu9G5GA2Sy3mjlf5s=,tag:YIDa2VaIhC2cM3QUlZR6Rg==,type:str]
3839
pgp: []
3940
encrypted_regex: ^(data|stringData)$
4041
version: 3.9.3

infra/argocd/project.yaml

+16-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,22 @@ spec:
3636
clusterResourceWhitelist:
3737
- group: "*"
3838
kind: "*"
39-
description: Applications
39+
description: Applications owned by us
40+
destinations:
41+
- namespace: "*"
42+
server: "*"
43+
sourceRepos:
44+
- "*"
45+
---
46+
apiVersion: argoproj.io/v1alpha1
47+
kind: AppProject
48+
metadata:
49+
name: services
50+
spec:
51+
clusterResourceWhitelist:
52+
- group: "*"
53+
kind: "*"
54+
description: External services
4055
destinations:
4156
- namespace: "*"
4257
server: "*"

monitoring/grafana/helm-chart-values/values.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ dashboardProviders:
3535
editable: true
3636
options:
3737
path: /var/lib/grafana/dashboards/vm
38+
- name: "trivy"
39+
orgId: 1
40+
folder: "trivy"
41+
type: file
42+
disableDeletion: false
43+
editable: true
44+
options:
45+
path: /var/lib/grafana/dashboards/trivy
3846

3947
dashboards:
4048
vm:
@@ -44,6 +52,10 @@ dashboards:
4452
VMSingle:
4553
gnetId: 10229
4654
revision: 37
55+
trivy:
56+
trivy-operator:
57+
gnetId: 17813
58+
revision: 2
4759

4860
grafana.ini:
4961
server:

services/argo-apps/trivy.yaml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: ApplicationSet
3+
metadata:
4+
name: trivy-operator
5+
namespace: argocd
6+
spec:
7+
goTemplate: true
8+
generators:
9+
- clusters:
10+
selector:
11+
matchLabels:
12+
trivyOperator: "true"
13+
values:
14+
clusterName: "{{.name}}"
15+
- list:
16+
elements:
17+
- name: in-cluster
18+
values:
19+
clusterName: k3d-control
20+
template:
21+
metadata:
22+
name: "trivy-operator-{{.values.clusterName}}"
23+
spec:
24+
project: services
25+
source:
26+
chart: trivy-operator
27+
repoURL: https://aquasecurity.github.io/helm-charts/
28+
targetRevision: 0.25.0
29+
helm:
30+
valuesObject:
31+
trivy:
32+
severity: HIGH,CRITICAL
33+
ignoreUnfixed: true
34+
serviceMonitor:
35+
enabled: true
36+
labels:
37+
release: "kube-prometheus-stack-{{.values.clusterName}}"
38+
destination:
39+
name: "{{.name}}"
40+
namespace: trivy-operator
41+
syncPolicy:
42+
automated: {}
43+
createNamespace: true

services/init-argo-apps.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: argo-apps-services
5+
namespace: argocd
6+
spec:
7+
project: services
8+
source:
9+
path: services/argo-apps
10+
repoURL: https://github.com/Utwo/k8s-playground
11+
targetRevision: HEAD
12+
destination:
13+
namespace: argocd
14+
name: in-cluster
15+
syncPolicy:
16+
automated: {}

0 commit comments

Comments
 (0)