diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..f5b77a4 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,21 @@ +name: Security +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +permissions: + contents: read + pull-requests: read + +jobs: + secret-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index aaadf73..dee634c 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,11 @@ go.work.sum # Editor/IDE # .idea/ # .vscode/ +__pycache__/ +node_modules/ +build/ +.pytest_cache/ +.idea/ +.vscode/ +*.pyc +*.log diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a467548 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: local + hooks: + - id: no-plaintext-secrets + name: block plaintext secrets + entry: bash -c 'if grep -RInE "(sk_live_|sk_test_|ghp_|AIza|BEGIN RSA)" . --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=vendor --exclude-dir=dist --exclude-dir=build --exclude-dir=test --exclude-dir=tests --exclude-dir=fixtures --exclude-dir=examples --exclude-dir=docs 2>/dev/null; then exit 1; fi' + language: system + pass_filenames: [] + always_run: true