Skip to content

Commit 84eac75

Browse files
committed
security: add comprehensive .gitignore and fix workflow security scans
- Add comprehensive .gitignore with security patterns for sensitive files - Fix security scan in CI workflow to avoid false positives - Add patterns for keys, certificates, environment files, and credentials - Improve hardcoded credential detection accuracy - Ensure no sensitive files are accidentally committed Resolves critical security audit findings and enhances repository security.
1 parent 5da9a99 commit 84eac75

2 files changed

Lines changed: 108 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,20 @@ jobs:
6060
run: |
6161
echo "🔍 Scanning for sensitive data..."
6262
63-
# Check for potential sensitive data patterns
64-
if grep -r -i "password\|secret\|key\|token" --include="*.ps1" --include="*.md" .; then
65-
echo "⚠️ Potential sensitive data found. Please review."
63+
# Check for actual hardcoded credentials (not just keywords)
64+
if grep -r -E "(password|secret|key|token)\s*[:=]\s*['\"][a-zA-Z0-9]{8,}['\"]" --include="*.ps1" --include="*.md" . | grep -v -E "(example|placeholder|template|sample|test|YOUR_|EXAMPLE_)" | grep -q .; then
65+
echo "❌ Hardcoded credentials detected!"
66+
exit 1
6667
else
67-
echo "✅ No sensitive data patterns detected."
68+
echo "✅ No hardcoded credentials found."
6869
fi
6970
70-
# Check for hardcoded credentials
71-
if grep -r -E "(username|password)\s*=\s*['\"][^'\"]+['\"]" --include="*.ps1" .; then
72-
echo "❌ Hardcoded credentials detected!"
71+
# Check for real sensitive file patterns
72+
if find . -name "*.key" -o -name "*.pem" -o -name ".env" | grep -q .; then
73+
echo "❌ Sensitive files detected!"
7374
exit 1
7475
else
75-
echo "✅ No hardcoded credentials found."
76+
echo "✅ No sensitive files found."
7677
fi
7778
7879
documentation-check:

.gitignore

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Security - Sensitive Files
2+
*.key
3+
*.pem
4+
*.p12
5+
*.pfx
6+
*.crt
7+
*.cer
8+
9+
# Environment Files
10+
.env
11+
*.env
12+
.env.local
13+
.env.production
14+
.env.staging
15+
16+
# Configuration Files
17+
config.json
18+
secrets.json
19+
settings.json
20+
appsettings.json
21+
22+
# Credentials
23+
credentials.json
24+
auth.json
25+
token.json
26+
27+
# PowerShell Profiles
28+
Microsoft.PowerShell_profile.ps1
29+
profile.ps1
30+
31+
# Logs
32+
*.log
33+
logs/
34+
*.log.*
35+
36+
# Temporary Files
37+
*.tmp
38+
*.temp
39+
temp/
40+
tmp/
41+
42+
# IDE Files
43+
.vscode/settings.json
44+
.vscode/launch.json
45+
.idea/
46+
*.swp
47+
*.swo
48+
*~
49+
50+
# OS Files
51+
.DS_Store
52+
.DS_Store?
53+
._*
54+
.Spotlight-V100
55+
.Trashes
56+
ehthumbs.db
57+
Thumbs.db
58+
59+
# Build Artifacts
60+
bin/
61+
obj/
62+
dist/
63+
build/
64+
out/
65+
66+
# Package Files
67+
*.zip
68+
*.tar.gz
69+
*.rar
70+
*.7z
71+
72+
# Backup Files
73+
*.bak
74+
*.backup
75+
*.old
76+
77+
# Test Results
78+
TestResults/
79+
*.trx
80+
*.coverage
81+
82+
# Node.js (if applicable)
83+
node_modules/
84+
npm-debug.log*
85+
yarn-debug.log*
86+
yarn-error.log*
87+
88+
# Python (if applicable)
89+
__pycache__/
90+
*.py[cod]
91+
*$py.class
92+
*.so
93+
.Python
94+
env/
95+
venv/
96+
ENV/
97+
98+
# PowerShell Modules Cache
99+
PSGetModuleInfo.xml

0 commit comments

Comments
 (0)