Skip to content

Commit ce151c4

Browse files
authored
Merge pull request #38 from CompassSecurity/dev
Dev to main
2 parents 8796177 + 8ed9c5e commit ce151c4

3 files changed

Lines changed: 67 additions & 1 deletion

File tree

.dockerignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Exclude the Git version control folder
2+
.git
3+
.gitignore
4+
.github/
5+
6+
# General exclusions
7+
pytest.ini
8+
README.md
9+
TODO.md
10+
tests/
11+
compose.yml
12+
13+
# Nix develop
14+
flake.lock
15+
flake.nix

.github/workflows/dev_build_push.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ jobs:
99
# Only allow running on the dev branch
1010
if: github.ref == 'refs/heads/dev'
1111

12+
permissions:
13+
contents: write # Needed to create tags and releases
14+
packages: write # Needed to push to GHCR
15+
id-token: write # For trusted publishing
16+
1217
steps:
1318
- name: Checkout dev branch
1419
uses: actions/checkout@v4
@@ -25,11 +30,15 @@ jobs:
2530
username: ${{ github.actor }}
2631
password: ${{ secrets.GITHUB_TOKEN }}
2732

33+
- name: Create lowercase repository name
34+
id: repo
35+
run: echo "name=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT
36+
2837
- name: Build and push :dev image
2938
uses: docker/build-push-action@v6
3039
with:
3140
context: .
3241
push: true
33-
tags: ghcr.io/${{ github.repository }}:dev
42+
tags: ghcr.io/${{ steps.repo.outputs.name }}:dev
3443
cache-from: type=gha
3544
cache-to: type=gha,mode=max
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: security scan
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
security-events: write
11+
12+
jobs:
13+
gosec_zizmor:
14+
name: security scan
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
with:
19+
persist-credentials: false
20+
- uses: actions/setup-go@v6
21+
with:
22+
go-version: stable
23+
- name: Run Gosec Security Scanner
24+
uses: securego/gosec@6be2b51fd78feca86af91f5186b7964d76cb1256 # v2.22.10
25+
with:
26+
args: "-no-fail -fmt json -out results.json ./..."
27+
28+
- name: Check Gosec Results
29+
run: |
30+
FOUND=$(jq '.Stats.found // 0' results.json)
31+
echo "Gosec found $FOUND issue(s)"
32+
if [ "$FOUND" -gt 0 ]; then
33+
echo "❌ Security issues detected! Please fix them before merging."
34+
exit 1
35+
else
36+
echo "✅ No security issues found."
37+
fi
38+
39+
- name: Run zizmor 🌈
40+
uses: zizmorcore/zizmor-action@e639db99335bc9038abc0e066dfcd72e23d26fb4 # v0.3.0
41+
with:
42+
inputs: .

0 commit comments

Comments
 (0)