Files
devops a3c022c024 docs: READMEs completos, estructura final de arquetipos
Mueve los reusable workflows a .gitea/workflows/ (restriccion real de
Gitea: workflow_call no puede vivir en una ruta arbitraria, confirmado
en vivo). Corrige todos los 'uses:' cross-repo a URL absoluta
(https://gitea.cruzcloud.net/...) -- la forma corta de GitHub se
resuelve contra github.com en esta instancia, confirmado en vivo con un
test real (reusable workflow + composite action ejecutando gitleaks de
punta a punta). Limpia los archivos de prueba.
2026-08-17 00:23:24 -05:00

65 lines
2.1 KiB
YAML

name: "Trivy imagen — CVE de la imagen construida"
description: >-
Escanea la imagen Docker ya construida y cargada localmente (load:
true en el build, no hace falta push todavía). CRITICAL bloquea el
pipeline; HIGH es informativo. --timeout 15m0s siempre — el default
de Trivy (5m) no alcanza bajo carga real del host (visto en vivo en
commerce-backend, "context deadline exceeded" a los 4m52s).
inputs:
image_ref:
description: "Referencia completa imagen:tag a escanear (ej. \\${{ env.IMAGE_NAME }}:\\${{ steps.vars.outputs.VERSION }})."
required: true
trivy_version:
description: "Versión de Trivy a instalar."
required: false
default: "0.74.0"
ignorefile:
description: >-
Ruta a un .trivyignore con excepciones documentadas (opcional).
Cada excepción debe tener justificación y fecha en el propio
archivo — no es un mecanismo para silenciar sin revisar.
required: false
default: ""
runs:
using: composite
steps:
- name: Instalar Trivy
shell: bash
run: |
set -euo pipefail
curl -sSfL \
"https://github.com/aquasecurity/trivy/releases/download/v${{ inputs.trivy_version }}/trivy_${{ inputs.trivy_version }}_Linux-64bit.tar.gz" \
-o /tmp/trivy.tar.gz
tar -xzf /tmp/trivy.tar.gz -C /tmp trivy
chmod +x /tmp/trivy
/tmp/trivy version
- name: Escanear imagen (Trivy) — CRITICAL bloquea
shell: bash
run: |
set -euo pipefail
IGNOREFILE_ARGS=()
if [ -n "${{ inputs.ignorefile }}" ]; then
IGNOREFILE_ARGS=(--ignorefile "${{ inputs.ignorefile }}")
fi
/tmp/trivy image \
--severity CRITICAL \
--exit-code 1 \
--ignore-unfixed \
--timeout 15m0s \
"${IGNOREFILE_ARGS[@]}" \
"${{ inputs.image_ref }}"
- name: Escanear imagen (Trivy) — HIGH informativo
shell: bash
run: |
set -euo pipefail
/tmp/trivy image \
--severity HIGH \
--exit-code 0 \
--ignore-unfixed \
--timeout 15m0s \
"${{ inputs.image_ref }}"