Saltearse al contenido
ES EN

GitHub Actions

Configuración previa

Añade las siguientes variables en Settings → Secrets and variables → Actions de tu repositorio:

TipoNombreDescripción
SecretGERION_API_KEYAPI key M2M de tu organización
VariableGERION_API_URLURL del Gerion API Gateway

Workflows

El resultado se envía directamente al dashboard de Gerion. Copia este archivo en .github/workflows/gerion-scan.yml:

name: Gerion Security Scan
on:
push:
branches: [main, master, develop]
pull_request:
workflow_dispatch:
jobs:
gerion-scan:
name: Security Scan
runs-on: ubuntu-latest
permissions:
contents: read
container:
image: ghcr.io/gerion-appsec/gerion-cli:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run full security scan
env:
GERION_API_URL: ${{ vars.GERION_API_URL }}
GERION_API_KEY: ${{ secrets.GERION_API_KEY }}
run: gerion scan-all /github/workspace

Reusable Action

Puedes usar la Action oficial de Gerion directamente en cualquier workflow sin copiar el YAML del contenedor:

- uses: gerion-appsec/gerion-cli-action@v1
with:
api-url: ${{ vars.GERION_API_URL }}
api-key: ${{ secrets.GERION_API_KEY }}

Parámetros disponibles

ParámetroDefectoDescripción
scan-typeallall | secrets | sca | iac | sast
code-path.Subdirectorio a escanear (relativo al workspace)
api-urlURL del Gerion API Gateway
api-keyAPI key M2M
output-formatjson | markdown | sarif
output-fileFichero de salida (relativo al workspace)
log-levelinfodebug | info | warning | error
timeout180Timeout por escáner en segundos

Salidas

SalidaDescripción
findings-fileRuta absoluta al fichero de salida (si se configuró output-file)
exit-codeCódigo de salida del CLI (0 = éxito, 1 = error de ejecución)

Notas

  • Gerion CLI detecta automáticamente GITHUB_REPOSITORY, GITHUB_REF_NAME y GITHUB_SHA. No es necesario configurar metadatos manualmente.
  • Los container jobs montan $GITHUB_WORKSPACE en /github/workspace automáticamente.
  • El CLI retorna código de salida 0 aunque encuentre vulnerabilidades. Usa report --severity o parsea el JSON para implementar quality gates.