diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..4b381133 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,36 @@ +name: CodeQL + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + # Weekly on Monday + - cron: "0 8 * * 1" + +jobs: + analyze-python-code: + name: Analyze Python + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Check out code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0 + with: + languages: python + queries: security-and-quality + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0 + with: + category: python diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml new file mode 100644 index 00000000..5e9d131f --- /dev/null +++ b/.github/workflows/gitleaks.yml @@ -0,0 +1,27 @@ +name: Gitleaks + +on: + pull_request: + branches: + - main + +jobs: + gitleaks: + name: Secret Scanning + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + steps: + - name: Check out code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - name: Run Gitleaks + run: | + curl -sSfL -o gitleaks.tar.gz https://github.com/gitleaks/gitleaks/releases/download/v8.26.0/gitleaks_8.26.0_linux_x64.tar.gz + echo "32faa8a77f6ce4b483921072ea89f78a794ad1d96471f2ad6e01ad3b0ebafa00 gitleaks.tar.gz" | sha256sum --check + tar -xzf gitleaks.tar.gz + ./gitleaks detect --source . --log-level info diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml new file mode 100644 index 00000000..4de521d0 --- /dev/null +++ b/.github/workflows/license-check.yml @@ -0,0 +1,34 @@ +name: License Check + +on: + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + license-check: + name: Dependency License Review + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Dependency review + uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0 + with: + fail-on-severity: low + allow-licenses: >- + Apache-2.0, + MIT, + BSD-2-Clause, + BSD-3-Clause, + ISC, + CC0-1.0, + Unlicense, + EPL-1.0, + EPL-2.0, + CDDL-1.0, + PSF-2.0