Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: auth_service
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv sync --group dev
- name: Check formatting
run: uv run ruff format --check .
- name: Lint
run: uv run ruff check .

security:
runs-on: ubuntu-latest
defaults:
run:
working-directory: auth_service
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v5
- run: uv sync --group dev
- name: Bandit
run: uv run bandit -r . -c pyproject.toml --severity-level high --confidence-level high
- name: pip-audit
run: uv run pip-audit
- name: Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trivy FS
uses: aquasecurity/trivy-action@master
with:
scan-type: fs
scan-ref: auth_service
severity: CRITICAL,HIGH
exit-code: 1

test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: auth_service
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv sync --group dev
- run: uv run pytest
22 changes: 19 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ name: Build and Publish Docker Image

on:
push:
branches: [ "main" ]
tags: [ "v*" ]
branches: ["main"]
tags: ["v*"]
workflow_dispatch: {}

permissions:
contents: read
packages: write
security-events: write

env:
IMAGE_NAME: acl-auth-service
IMAGE_NAME: wicket
REGISTRY: ghcr.io

jobs:
Expand Down Expand Up @@ -52,3 +53,18 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:buildcache,mode=max

- name: Scan image with Trivy
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH
exit-code: 1

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: trivy-results.sarif
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
.env
k8s/generated/
.venv
k8s/generated/
data/


__pycache__
.pytest_cache
.ruff_cache
.DS_Store
Loading
Loading