Skip to content

Commit 5fef4bf

Browse files
authored
Merge pull request #9 from EO-DataHub/semgrep
Replace Bandit with Semgrep
2 parents 6091fe2 + ef8fe5c commit 5fef4bf

6 files changed

Lines changed: 23 additions & 20 deletions

File tree

.github/workflows/pre-commit-go.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pre-commit
22

3-
on: [pull_request, workflow_call]
3+
on: [workflow_call]
44

55
jobs:
66
pre-commit:

.github/workflows/pre-commit-node.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pre-commit
22

3-
on: [pull_request, workflow_call]
3+
on: [workflow_call]
44

55
jobs:
66
pre-commit:

.github/workflows/pre-commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pre-commit
22

3-
on: [pull_request, workflow_call]
3+
on: [workflow_call]
44

55
jobs:
66
pre-commit:

.github/workflows/security.yaml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,20 @@ on:
44
workflow_call:
55
inputs:
66
ENABLE_BANDIT:
7-
description: 'Enable the Bandit scanner - useful for Python only'
7+
description: 'Enable the Bandit scanner - useful for Python only (deprecated, use ENABLE_SAST)'
8+
default: true
9+
type: boolean
10+
ENABLE_SAST:
11+
description: 'Enable SAST scanning with Semgrep'
812
default: true
913
type: boolean
1014
jobs:
11-
build:
12-
name: Check for vulnerabilities
13-
runs-on: ubuntu-24.04
15+
trivy:
16+
name: Trivy scan
17+
runs-on: ubuntu-latest
1418
steps:
1519
- name: Checkout code
16-
uses: actions/checkout@v4
17-
18-
- name: Security check - Bandit
19-
uses: mdegis/bandit-action@v1.0.1
20-
if: ${{ inputs.ENABLE_BANDIT }}
21-
with:
22-
path: "."
23-
level: high
24-
confidence: high
25-
skips: B101
26-
20+
uses: actions/checkout@v5
2721

2822
- name: Write Trivy config file
2923
run: |
@@ -47,3 +41,14 @@ jobs:
4741
severity: 'MEDIUM,CRITICAL,HIGH'
4842
exit-code: '1'
4943
trivy-config: 'trivy.conf'
44+
45+
46+
semgrep:
47+
name: Semgrep scan
48+
runs-on: ubuntu-latest
49+
if: ${{ inputs.ENABLE_BANDIT || inputs.ENABLE_SAST }}
50+
container:
51+
image: semgrep/semgrep
52+
steps:
53+
- uses: actions/checkout@v5
54+
- run: semgrep scan --config auto

.github/workflows/unit-tests-go.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Unit tests
22

33
on:
4-
pull_request:
54
workflow_call:
65

76
jobs:

.github/workflows/unit-tests-python.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Unit tests
22

33
on:
4-
pull_request:
54
workflow_call:
65
inputs:
76
PYTHON_VERSION:

0 commit comments

Comments
 (0)