@@ -163,4 +163,38 @@ jobs:
163163 # - name: Sign imagen en GHCR
164164 # run: cosign sign --yes --key cosign.key "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}" <<< "$COSIGN_PASSWORD"
165165 # - name: Verify imagen (gate)
166- # run: cosign verify --key cosign.pub "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}"
166+ # run: cosign verify --key cosign.pub "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}"
167+
168+
169+ # ──────────────────────────────────────────────────────────────────────────────
170+ # Slide 15 — Deploy a K8s local + DAST (ZAP)
171+ # ──────────────────────────────────────────────────────────────────────────────
172+ deploy :
173+ name : Deploy a Kubernetes local (kind/minikube)
174+ runs-on : self-hosted
175+ needs : [sign]
176+ steps :
177+ - uses : actions/checkout@v4
178+ - name : Cargar imagen local al clúster kind
179+ run : kind load docker-image ${IMAGE_NAME}:${IMAGE_TAG} --name ${KIND_CLUSTER}
180+ - name : Helm upgrade/install
181+ run : |
182+ helm upgrade --install ${SERVICE_RELEASE_NAME} charts/demo-app \
183+ --set image.repository=${IMAGE_NAME} \
184+ --set image.tag=${IMAGE_TAG} \
185+ --set service.type=NodePort
186+ - name : Esperar readiness
187+ run : kubectl rollout status deploy/${SERVICE_RELEASE_NAME} --timeout=180s
188+
189+ dast :
190+ name : DAST (OWASP ZAP baseline)
191+ runs-on : self-hosted
192+ needs : [deploy]
193+ steps :
194+ - name : Port-forward al Service y ejecutar ZAP
195+ run : |
196+ kubectl port-forward svc/${SERVICE_RELEASE_NAME} 8080:80 & echo $! > pf.pid
197+ sleep 3
198+ docker run --rm -t owasp/zap2docker-stable \
199+ zap-baseline.py -t http://localhost:8080 -x zap.xml
200+ kill $(cat pf.pid) || true
0 commit comments