Skip to content

Commit 3fa2933

Browse files
Review SCM files and security updates (#2)
Security improvements: - Pin editorconfig-checker action to SHA (v2.1.0) - Add Haskell (.hs) file extensions to security policy checks - Update setup-haskell to haskell-actions/setup v2.9.0 (archived action) - Upgrade GHC from 8.10.3 to 9.6, Cabal from 3.2 to 3.10 - Expand base version constraint for GHC 9.4-9.10 compatibility Project updates: - Add comprehensive ROADMAP.scm with 6-phase development plan - Update STATE.scm to 30% completion with component tracking - Add CI/CD security and SCM files as completed components Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2c280ff commit 3fa2933

6 files changed

Lines changed: 294 additions & 17 deletions

File tree

.github/workflows/haskell.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20-
- uses: actions/setup-haskell@28c8ff1d6cbeaed15ce310b1952dc19352a0a07d # v1.1.5
20+
- uses: haskell-actions/setup@0a703b53e0ecfe04a312712af19699c3d8a17c7a # v2.9.0
2121
with:
22-
ghc-version: '8.10.3'
23-
cabal-version: '3.2'
22+
ghc-version: '9.6'
23+
cabal-version: '3.10'
2424

2525
- name: Cache
2626
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2

.github/workflows/quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ jobs:
2828
- name: Check TODO/FIXME
2929
run: |
3030
echo "=== TODOs ==="
31-
grep -rn "TODO\|FIXME\|HACK\|XXX" --include="*.rs" --include="*.res" --include="*.py" --include="*.ex" . | head -20 || echo "None found"
31+
grep -rn "TODO\|FIXME\|HACK\|XXX" --include="*.rs" --include="*.res" --include="*.py" --include="*.ex" --include="*.hs" . | head -20 || echo "None found"
3232
3333
- name: Check for large files
3434
run: |
3535
find . -type f -size +1M -not -path "./.git/*" | head -10 || echo "No large files"
3636
3737
- name: EditorConfig check
38-
uses: editorconfig-checker/action-editorconfig-checker@main
38+
uses: editorconfig-checker/action-editorconfig-checker@4b6cd6190d435e7e084fb35e36a096e98506f7b9 # v2.1.0
3939
continue-on-error: true
4040

4141
docs:

.github/workflows/security-policy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ jobs:
1717
FAILED=false
1818
1919
# Block MD5/SHA1 for security (allow for checksums/caching)
20-
WEAK_CRYPTO=$(grep -rE 'md5\(|sha1\(' --include="*.py" --include="*.rb" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" . 2>/dev/null | grep -v 'checksum\|cache\|test\|spec' | head -5 || true)
20+
WEAK_CRYPTO=$(grep -rE 'md5\(|sha1\(|MD5\.|SHA1\.' --include="*.py" --include="*.rb" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.hs" . 2>/dev/null | grep -v 'checksum\|cache\|test\|spec' | head -5 || true)
2121
if [ -n "$WEAK_CRYPTO" ]; then
2222
echo "⚠️ Weak crypto (MD5/SHA1) detected. Use SHA256+ for security:"
2323
echo "$WEAK_CRYPTO"
2424
fi
2525
2626
# Block HTTP URLs (except localhost)
27-
HTTP_URLS=$(grep -rE 'http://[^l][^o][^c]' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.yaml" --include="*.yml" . 2>/dev/null | grep -v 'localhost\|127.0.0.1\|example\|test\|spec' | head -5 || true)
27+
HTTP_URLS=$(grep -rE 'http://[^l][^o][^c]' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.hs" --include="*.yaml" --include="*.yml" . 2>/dev/null | grep -v 'localhost\|127.0.0.1\|example\|test\|spec' | head -5 || true)
2828
if [ -n "$HTTP_URLS" ]; then
2929
echo "⚠️ HTTP URLs found. Use HTTPS:"
3030
echo "$HTTP_URLS"
3131
fi
3232
3333
# Block hardcoded secrets patterns
34-
SECRETS=$(grep -rEi '(api_key|apikey|secret_key|password)\s*[=:]\s*["\x27][A-Za-z0-9+/=]{20,}' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.env" . 2>/dev/null | grep -v 'example\|sample\|test\|mock\|placeholder' | head -3 || true)
34+
SECRETS=$(grep -rEi '(api_key|apikey|secret_key|password)\s*[=:]\s*["\x27][A-Za-z0-9+/=]{20,}' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.hs" --include="*.env" . 2>/dev/null | grep -v 'example\|sample\|test\|mock\|placeholder' | head -3 || true)
3535
if [ -n "$SECRETS" ]; then
3636
echo "❌ Potential hardcoded secrets detected!"
3737
FAILED=true

ROADMAP.scm

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
;;; ROADMAP.scm — sanctify-php Development Roadmap
2+
;; SPDX-License-Identifier: AGPL-3.0-or-later
3+
;; SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell
4+
;;
5+
;; This roadmap outlines the development phases for sanctify-php.
6+
;; Updated: 2025-12-17
7+
8+
(define-module (sanctify-php roadmap)
9+
#:export (roadmap current-milestone next-steps))
10+
11+
;;; ============================================================================
12+
;;; PHASE 1: Foundation (v0.1.x) — Current Phase
13+
;;; ============================================================================
14+
15+
(define phase-1
16+
'((name . "Foundation")
17+
(version . "0.1.x")
18+
(status . "in-progress")
19+
(completion . 30)
20+
(milestones
21+
(;; COMPLETED
22+
(milestone "RSR Compliance"
23+
(status . complete)
24+
(items
25+
("SPDX headers on all files" . done)
26+
("SHA-pinned GitHub Actions" . done)
27+
("Security workflows configured" . done)
28+
("Guix SCM files" . done)
29+
("Dual licensing (MIT/AGPL)" . done)))
30+
31+
(milestone "CI/CD Security"
32+
(status . complete)
33+
(items
34+
("CodeQL analysis" . done)
35+
("PHP security scanning" . done)
36+
("Secret detection (TruffleHog)" . done)
37+
("OpenSSF Scorecard" . done)
38+
("Haskell extensions in security checks" . done)
39+
("Upgraded to GHC 9.6" . done)))
40+
41+
;; IN PROGRESS
42+
(milestone "PHP Parser"
43+
(status . pending)
44+
(priority . high)
45+
(items
46+
("Megaparsec-based lexer" . pending)
47+
("PHP 7.4+ syntax support" . pending)
48+
("PHP 8.x syntax support" . pending)
49+
("AST representation" . pending)
50+
("Source location tracking" . pending)
51+
("Error recovery" . pending)))
52+
53+
(milestone "Test Infrastructure"
54+
(status . pending)
55+
(priority . medium)
56+
(items
57+
("HSpec test suite setup" . pending)
58+
("Parser unit tests" . pending)
59+
("Golden tests with PHP fixtures" . pending)
60+
("Property-based tests (QuickCheck)" . pending)
61+
("CI test coverage reporting" . pending)))))))
62+
63+
;;; ============================================================================
64+
;;; PHASE 2: Core Analysis (v0.2.x)
65+
;;; ============================================================================
66+
67+
(define phase-2
68+
'((name . "Core Analysis")
69+
(version . "0.2.x")
70+
(status . "planned")
71+
(milestones
72+
((milestone "Security Analysis Engine"
73+
(priority . critical)
74+
(items
75+
("SQL injection detection" . planned)
76+
("XSS vulnerability detection" . planned)
77+
("CSRF pattern identification" . planned)
78+
("Command injection detection" . planned)
79+
("Path traversal detection" . planned)
80+
("Unsafe deserialization detection" . planned)))
81+
82+
(milestone "Taint Tracking"
83+
(priority . high)
84+
(items
85+
("Source identification ($_GET, $_POST, etc.)" . planned)
86+
("Sink identification (echo, query, etc.)" . planned)
87+
("Data flow analysis" . planned)
88+
("Sanitizer recognition" . planned)
89+
("Cross-function taint propagation" . planned)))
90+
91+
(milestone "Type Inference"
92+
(priority . medium)
93+
(items
94+
("Return type inference" . planned)
95+
("Parameter type inference" . planned)
96+
("Property type inference" . planned)
97+
("PHPDoc annotation parsing" . planned)
98+
("Type hint suggestions" . planned)))))))
99+
100+
;;; ============================================================================
101+
;;; PHASE 3: Transformations (v0.3.x)
102+
;;; ============================================================================
103+
104+
(define phase-3
105+
'((name . "Transformations")
106+
(version . "0.3.x")
107+
(status . "planned")
108+
(milestones
109+
((milestone "Strict Types Transformation"
110+
(priority . high)
111+
(risk . "zero")
112+
(items
113+
("Add declare(strict_types=1)" . planned)
114+
("Preserve existing declarations" . planned)
115+
("Handle multiple files" . planned)))
116+
117+
(milestone "Type Hint Addition"
118+
(priority . high)
119+
(risk . "low-review-required")
120+
(items
121+
("Add inferred parameter types" . planned)
122+
("Add inferred return types" . planned)
123+
("Generate PHPStan annotations" . planned)
124+
("Preserve formatting" . planned)))
125+
126+
(milestone "Sanitization Transforms"
127+
(priority . critical)
128+
(risk . "medium-review-required")
129+
(items
130+
("Auto-escape echo statements" . planned)
131+
("wpdb::query to prepare conversion" . planned)
132+
("Superglobal sanitization" . planned)
133+
("rand() to random_int() upgrade" . planned)
134+
("Nonce verification insertion" . planned)))
135+
136+
(milestone "Code Emission"
137+
(priority . high)
138+
(items
139+
("Pretty-print transformed AST" . planned)
140+
("Preserve comments" . planned)
141+
("Maintain original formatting where possible" . planned)
142+
("Diff-friendly output" . planned)))))))
143+
144+
;;; ============================================================================
145+
;;; PHASE 4: WordPress Support (v0.4.x)
146+
;;; ============================================================================
147+
148+
(define phase-4
149+
'((name . "WordPress Support")
150+
(version . "0.4.x")
151+
(status . "planned")
152+
(milestones
153+
((milestone "WordPress Constraints"
154+
(priority . high)
155+
(items
156+
("ABSPATH check enforcement" . planned)
157+
("Capability escalation detection" . planned)
158+
("Direct database access warnings" . planned)
159+
("Proper escaping function usage" . planned)
160+
("Text domain consistency" . planned)))
161+
162+
(milestone "WordPress Hooks Analysis"
163+
(priority . medium)
164+
(items
165+
("Action hook analysis" . planned)
166+
("Filter hook analysis" . planned)
167+
("Priority conflict detection" . planned)
168+
("Deprecated hook warnings" . planned)))
169+
170+
(milestone "WordPress Security Patterns"
171+
(priority . critical)
172+
(items
173+
("Admin-ajax.php security" . planned)
174+
("REST API endpoint security" . planned)
175+
("File upload handling" . planned)
176+
("Options API security" . planned)
177+
("User meta security" . planned)))))))
178+
179+
;;; ============================================================================
180+
;;; PHASE 5: Reporting & Integration (v0.5.x)
181+
;;; ============================================================================
182+
183+
(define phase-5
184+
'((name . "Reporting & Integration")
185+
(version . "0.5.x")
186+
(status . "planned")
187+
(milestones
188+
((milestone "Report Generation"
189+
(priority . high)
190+
(items
191+
("JSON report format" . planned)
192+
("SARIF format for IDE integration" . planned)
193+
("HTML report with navigation" . planned)
194+
("Markdown summary" . planned)
195+
("Severity classification" . planned)))
196+
197+
(milestone "Infrastructure Export"
198+
(priority . medium)
199+
(items
200+
("php.ini recommendations export" . planned)
201+
("nginx security rules export" . planned)
202+
("Guix container overrides export" . planned)
203+
("Docker security configs" . planned)))
204+
205+
(milestone "IDE Integration"
206+
(priority . medium)
207+
(items
208+
("VSCode extension" . planned)
209+
("Language Server Protocol (LSP)" . planned)
210+
("Real-time analysis" . planned)
211+
("Quick-fix suggestions" . planned)))))))
212+
213+
;;; ============================================================================
214+
;;; PHASE 6: Production Ready (v1.0.0)
215+
;;; ============================================================================
216+
217+
(define phase-6
218+
'((name . "Production Ready")
219+
(version . "1.0.0")
220+
(status . "planned")
221+
(milestones
222+
((milestone "Performance Optimization"
223+
(items
224+
("Parallel file processing" . planned)
225+
("Incremental analysis" . planned)
226+
("Memory optimization" . planned)
227+
("Large codebase support" . planned)))
228+
229+
(milestone "Documentation"
230+
(items
231+
("User guide" . planned)
232+
("API documentation" . planned)
233+
("Integration examples" . planned)
234+
("WordPress plugin guidelines" . planned)))
235+
236+
(milestone "Release"
237+
(items
238+
("Binary releases (Linux/macOS/Windows)" . planned)
239+
("Guix package submission" . planned)
240+
("Homebrew formula" . planned)
241+
("Docker image" . planned)))))))
242+
243+
;;; ============================================================================
244+
;;; Summary & Export
245+
;;; ============================================================================
246+
247+
(define roadmap
248+
(list phase-1 phase-2 phase-3 phase-4 phase-5 phase-6))
249+
250+
(define current-milestone
251+
'((phase . 1)
252+
(name . "Foundation")
253+
(next-task . "Implement PHP parser with Megaparsec")
254+
(blockers . ())))
255+
256+
(define next-steps
257+
'(("Implement PHP lexer" . immediate)
258+
("Add parser tests" . immediate)
259+
("Implement AST pretty-printer" . this-week)
260+
("Add strict_types transformation" . this-week)
261+
("Implement basic SQL injection detection" . next-sprint)))

STATE.scm

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,36 @@
33
;; SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell
44

55
(define metadata
6-
'((version . "0.1.0") (updated . "2025-12-15") (project . "sanctify-php")))
6+
'((version . "0.1.0") (updated . "2025-12-17") (project . "sanctify-php")))
77

88
(define current-position
99
'((phase . "v0.1 - Initial Setup")
10-
(overall-completion . 25)
11-
(components ((rsr-compliance ((status . "complete") (completion . 100)))))))
10+
(overall-completion . 30)
11+
(components
12+
((rsr-compliance ((status . "complete") (completion . 100)))
13+
(ci-cd-security ((status . "complete") (completion . 100)))
14+
(scm-files ((status . "complete") (completion . 100)))
15+
(parser ((status . "pending") (completion . 0)))
16+
(security-analysis ((status . "pending") (completion . 0)))
17+
(transformations ((status . "pending") (completion . 0)))
18+
(wordpress-support ((status . "pending") (completion . 0)))
19+
(reporting ((status . "pending") (completion . 0)))))))
1220

1321
(define blockers-and-issues '((critical ()) (high-priority ())))
1422

1523
(define critical-next-actions
16-
'((immediate (("Verify CI/CD" . high))) (this-week (("Expand tests" . medium)))))
24+
'((immediate
25+
(("Implement PHP parser" . high)
26+
("Add test fixtures" . medium)))
27+
(this-week
28+
(("Implement strict_types transformation" . high)
29+
("Implement basic security analysis" . medium)))))
1730

1831
(define session-history
19-
'((snapshots ((date . "2025-12-15") (session . "initial") (notes . "SCM files added")))))
32+
'((snapshots
33+
((date . "2025-12-15") (session . "initial") (notes . "SCM files added"))
34+
((date . "2025-12-17") (session . "security-audit")
35+
(notes . "CI/CD security fixes: SHA-pinned actions, added Haskell extensions to security checks, upgraded GHC to 9.6")))))
2036

2137
(define state-summary
22-
'((project . "sanctify-php") (completion . 25) (blockers . 0) (updated . "2025-12-15")))
38+
'((project . "sanctify-php") (completion . 30) (blockers . 0) (updated . "2025-12-17")))

sanctify-php.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ library
4444
Sanctify.Parser.Lexer
4545
Sanctify.Parser.Token
4646
build-depends:
47-
base ^>=4.17,
47+
base >=4.17 && <4.21,
4848
text >=2.0,
4949
containers >=0.6,
5050
mtl >=2.3,
@@ -73,7 +73,7 @@ executable sanctify
7373
import: warnings
7474
main-is: Main.hs
7575
build-depends:
76-
base ^>=4.17,
76+
base >=4.17 && <4.21,
7777
sanctify-php,
7878
text,
7979
optparse-applicative,
@@ -91,7 +91,7 @@ test-suite sanctify-php-test
9191
hs-source-dirs: test
9292
main-is: Main.hs
9393
build-depends:
94-
base ^>=4.17,
94+
base >=4.17 && <4.21,
9595
sanctify-php,
9696
hspec >=2.10,
9797
hspec-megaparsec >=2.2,

0 commit comments

Comments
 (0)