trivy-server/install.sh

32 lines
693 B
Bash
Raw Permalink Normal View History

2025-02-03 05:53:24 +01:00
#!/bin/bash
ARG1=$1
NAMESPACE=$(cat namespace)
TRIVY_VERSION=0.11.0
2025-02-03 13:06:16 +01:00
HOME=/home/`id -nu`
2025-02-03 05:53:24 +01:00
kubectl create namespace $NAMESPACE \
--dry-run=client \
-o yaml | \
kubectl -f - apply
2025-02-03 12:50:52 +01:00
eval "`cat secrets.asc | /usr/local/bin/decrypt-secrets.sh`"
kubectl create secret generic trivy-secret \
--dry-run=client \
-o yaml \
--save-config \
2025-02-03 13:46:17 +01:00
--from-literal="TRIVY_TOKEN=$TRIVY_TOKEN" | \
2025-02-03 12:50:52 +01:00
kubectl apply -f - -n $NAMESPACE
2025-02-03 05:53:24 +01:00
helm repo add aquasecurity https://aquasecurity.github.io/helm-charts/
helm repo update
helm upgrade --install \
trivy-server aquasecurity/trivy \
-f values.yml \
--version $TRIVY_VERSION \
--namespace=$NAMESPACE
2025-02-03 13:17:45 +01:00
kubectl apply -f ingress.yml -n $NAMESPACE
2025-02-03 05:53:24 +01:00