Skip to content

Commit 6bede28

Browse files
committed
docs: add security check workflow and example env file
1 parent 7ad106f commit 6bede28

2 files changed

Lines changed: 77 additions & 0 deletions

File tree

.agent/workflows/security_check.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
description: Security Checklist before pushing or releasing
3+
---
4+
5+
# Security Checklist
6+
7+
Run this checklist before pushing code or creating releases to prevent sensitive data leaks.
8+
9+
## 🚨 Critical Checks
10+
11+
### 1. Check for Sensitive Files
12+
Run these commands to verify no secrets are being tracked:
13+
14+
```bash
15+
# Check for environment files
16+
git ls-files .env *.env
17+
18+
# Check for keys and certificates
19+
git ls-files "*.key" "*.pem" "*.p12" "*.pfx" "id_rsa*"
20+
21+
# Check for other sensitive data folders
22+
git ls-files "release/" "dist/" "node_modules/"
23+
```
24+
**Expected Output:** Should be empty.
25+
26+
### 2. Verify .gitignore
27+
Ensure `.gitignore` contains at least:
28+
29+
```gitignore
30+
# Security
31+
.env
32+
*.env
33+
*.pem
34+
*.key
35+
*.p12
36+
*.pfx
37+
*.keystore
38+
39+
# Build Artifacts
40+
node_modules
41+
dist
42+
release
43+
build
44+
```
45+
46+
### 3. Scan for Keywords
47+
Search your codebase for potential leaked keys (excluding lockfiles):
48+
49+
```bash
50+
grep -r "KEY" . --exclude-dir={node_modules,dist,release,.git} --exclude=package-lock.json
51+
grep -r "SECRET" . --exclude-dir={node_modules,dist,release,.git} --exclude=package-lock.json
52+
grep -r "PASSWORD" . --exclude-dir={node_modules,dist,release,.git} --exclude=package-lock.json
53+
```
54+
55+
## 🛡️ Remediation
56+
If you find you have accidentally committed a secret:
57+
58+
1. **Remove from history immediately:**
59+
```bash
60+
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch YOUR_FILE' --prune-empty --tag-name-filter cat -- --all
61+
```
62+
2. **Force push:**
63+
```bash
64+
git push origin main --force
65+
```
66+
3. **Rotate the leaked key:** Assume the key is compromised and generate a new one immediately.

.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Security Note: DO NOT put real keys in this file
2+
# Copy this file to .env and fill in your actual values
3+
# The .env file is git-ignored to prevent leaks
4+
5+
# Apple ID for signing/notarization
6+
APPLE_ID=your_email@example.com
7+
APPLE_APP_SPECIFIC_PASSWORD=your-app-specific-password
8+
APPLE_TEAM_ID=YOUR_TEAM_ID
9+
10+
# Other secrets
11+
# API_KEY=...

0 commit comments

Comments
 (0)