wip: contenido inicial + test de reusable workflow / composite action
This commit is contained in:
1 parent
e9fe7d0567
commit
262c0f271a
22 files changed
+1480
No files matched your search
@@ -0,0 +1,52 @@
|
||||
name: "Gitleaks — escaneo de secretos"
|
||||
description: >-
|
||||
Escanea el árbol de archivos (no el historial de git) buscando
|
||||
secretos commiteados. Bloquea (exit 1) si encuentra algo. Extraído
|
||||
literal de los 3 pipelines reales del lab (frontend, commerce-backend,
|
||||
docs-portal) — idéntico en los tres salvo el "source".
|
||||
|
||||
inputs:
|
||||
source:
|
||||
description: "Directorio a escanear (ej. workloads/mi-app)."
|
||||
required: true
|
||||
version:
|
||||
description: "Versión de Gitleaks a instalar."
|
||||
required: false
|
||||
default: "8.21.2"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Instalar Gitleaks
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
curl -sSfL \
|
||||
"https://github.com/gitleaks/gitleaks/releases/download/v${{ inputs.version }}/gitleaks_${{ inputs.version }}_linux_x64.tar.gz" \
|
||||
-o /tmp/gitleaks.tar.gz
|
||||
tar -xzf /tmp/gitleaks.tar.gz -C /tmp gitleaks
|
||||
chmod +x /tmp/gitleaks
|
||||
/tmp/gitleaks version
|
||||
|
||||
# --no-git: escanea el árbol de archivos del checkout, no el log de
|
||||
# commits. Un scan histórico completo se corre aparte, manual, no
|
||||
# en cada push/PR (ver README de este snippet).
|
||||
- name: Escanear secretos en el árbol de archivos
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
/tmp/gitleaks detect \
|
||||
--source="${{ inputs.source }}" \
|
||||
--no-git \
|
||||
--redact \
|
||||
--report-format=json \
|
||||
--report-path=gitleaks-report.json \
|
||||
--exit-code=1
|
||||
|
||||
- name: Publicar reporte de Gitleaks
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: gitleaks-report
|
||||
path: gitleaks-report.json
|
||||
if-no-files-found: ignore
|
||||
Reference in new issue
Block a user