File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Security Scan
2+
3+ on :
4+ push :
5+ pull_request :
6+
7+ jobs :
8+ security-scan :
9+ name : Security & Quality Check
10+ runs-on : ubuntu-latest
11+ permissions :
12+ actions : read
13+ contents : read
14+ security-events : write
15+
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v4
19+
20+ - name : Setup Python
21+ uses : actions/setup-python@v4
22+ with :
23+ python-version : ' 3.x'
24+
25+ - name : Install dependencies
26+ run : |
27+ python -m pip install --upgrade pip
28+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
30+ - name : Check Python syntax
31+ run : |
32+ python -m py_compile $(find . -name "*.py" -not -path "./.git/*")
33+
34+ - name : Basic security checks
35+ run : |
36+ echo "Checking for potential issues..."
37+
38+ # Check for hardcoded secrets
39+ if grep -r -i -E "(password|secret|key|token)\s*=\s*['\"][^'\"]{8,}" --include="*.py" . ; then
40+ echo "⚠️ Potential hardcoded secrets found!"
41+ exit 1
42+ fi
43+
44+ # Check for dangerous functions
45+ if grep -r -E "(eval|exec)\s*\(" --include="*.py" . ; then
46+ echo "⚠️ Dangerous functions found!"
47+ exit 1
48+ fi
49+
50+ echo "✅ Basic checks passed"
51+
52+ - name : CodeQL Analysis
53+ uses : github/codeql-action/init@v3
54+ with :
55+ languages : python
56+
57+ - name : Run CodeQL
58+ uses : github/codeql-action/analyze@v3
You can’t perform that action at this time.
0 commit comments