From 7fd0d80cc474c0772b0b237129e22e63d622f257 Mon Sep 17 00:00:00 2001 From: Ansh-info Date: Sat, 18 Jan 2025 20:55:09 +0100 Subject: [PATCH] Add: Security scan cron job workflow Co-authored-by: Apoorva Gupta --- .github/workflows/security-scan.yml | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/security-scan.yml diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml new file mode 100644 index 0000000..ee445c1 --- /dev/null +++ b/.github/workflows/security-scan.yml @@ -0,0 +1,44 @@ +name: Security Scan + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + schedule: + - cron: "0 0 * * 0" # Run weekly + +jobs: + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install bandit safety + + - name: Run Bandit + run: | + bandit -r code/ app/ -ll + + - name: Run Safety Check + run: | + safety check + + - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/python@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + command: monitor