Skip to content

Commit cca750c

Browse files
committed
Add sast job
1 parent 63ef53d commit cca750c

2 files changed

Lines changed: 32 additions & 19 deletions

File tree

.github/workflows/main.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: devsecops-pipeline
2+
on: [push, pull_request]
3+
4+
jobs:
5+
secrets:
6+
name: Secrets scanning (Gitleaks)
7+
runs-on: self-hosted
8+
steps:
9+
- uses: actions/checkout@v4
10+
with: { fetch-depth: 0 } # para análisis que miran historial
11+
- name: Gitleaks
12+
uses: gitleaks/gitleaks-action@v2
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
# Si usas un gitleaks.toml propio, añade inputs/vars según la acción
16+
17+
sast:
18+
name: SAST (Semgrep)
19+
runs-on: self-hosted
20+
needs: [secrets]
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Semgrep (bloqueante)
24+
run: |
25+
docker run --rm -v "$PWD:/src" returntocorp/semgrep:latest \
26+
semgrep scan --error --config p/ci --config .semgrep
27+
- name: Export SARIF (para pestaña Security)
28+
run: |
29+
docker run --rm -v "$PWD:/src" returntocorp/semgrep:latest \
30+
semgrep scan --config p/ci --config .semgrep --sarif -o semgrep.sarif || true
31+
- uses: github/codeql-action/upload-sarif@v3
32+
with: { sarif_file: semgrep.sarif }

.github/workflows/sast.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)