mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 07:57:19 -05:00
fix: restrict CodeQL to Python only, remove failing JS/TS matrix entries, add secrets scan
This commit is contained in:
46
.github/workflows/security-scan.yml
vendored
46
.github/workflows/security-scan.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: 🔒 Security Scan
|
||||
name: "🔒 Security Scan"
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -18,38 +18,48 @@ jobs:
|
||||
codeql:
|
||||
name: CodeQL Analysis
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: ['javascript', 'typescript', 'python']
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
languages: python
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
||||
dependency-scan:
|
||||
name: Dependency Scan
|
||||
security-checks:
|
||||
name: Security Checks
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run npm audit
|
||||
if: hashFiles('package.json') != ''
|
||||
run: npm audit --audit-level=moderate || true
|
||||
|
||||
|
||||
- name: Check for secrets
|
||||
run: |
|
||||
echo "Scanning for potential secrets..."
|
||||
! grep -rn 'AKIA\|sk-\|ghp_\|gho_\|password\s*=' --include='*.py' --include='*.js' --include='*.env' --include='*.yml' . || echo "Warning: Potential secrets found"
|
||||
echo "Security scan complete"
|
||||
|
||||
- name: Check dependencies
|
||||
run: |
|
||||
if [ -f "requirements.txt" ]; then
|
||||
pip install safety 2>/dev/null || true
|
||||
safety check -r requirements.txt 2>/dev/null || true
|
||||
fi
|
||||
if [ -f "package.json" ]; then
|
||||
npm install 2>/dev/null || true
|
||||
npm audit --audit-level=high 2>/dev/null || true
|
||||
fi
|
||||
echo "Dependency check complete"
|
||||
|
||||
- name: Dependency Review
|
||||
uses: actions/dependency-review-action@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
Reference in New Issue
Block a user