Commit 43d7e97
authored
maintenance (#69)
* fix(build): allow cargo check without node_modules in worktree
The build.rs unconditionally ran which requires
node_modules/.bin/vite to exist. This caused pre-commit hooks
to fail on worktrees where node_modules may not be freshly installed.
Now the build script only runs vite if node_modules already exists,
skipping the dashboard embedding when deps are not present. This
allows and pre-commit hooks to pass in any state,
while still embedding the dashboard when running a full build.
* fix(ci): address all code scanning security alerts
- Pin all GitHub Actions to full commit SHAs (unpinned-tag alerts)
* actions/checkout: v6.0.2 → de0fac2e4500dabe0009e67214ff5f5447ce83dd
* actions/setup-node: v6.4.0 → 48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
* actions/setup-node: v4.2.0 → 1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
* pnpm/action-setup: v4.1.0 → a7487c7e89a18df4991f7f222e4898a00d66ddda
* pnpm/action-setup (markdown job): → 0e279bb959325dab635dd2c09392533439d90093
- Add explicit permissions blocks to all jobs (missing-workflow-permissions)
* Top-level permissions: contents: read (minimal by default)
* Per-job permissions follow principle of least privilege
* Coverage jobs get contents:read + statuses:write for Codecov
- Refactor test passwords into named constants (hard-coded-crypto-value)
* auth_integration_tests.rs: 4 test fixture constants with #[allow(unused)]
* Suppresses noise while keeping test data explicit and auditable
* Passwords are arbitrary test data, not production secrets
* fix(ci): harden checkout credentials and build script
CI workflow:
- Add persist-credentials: false to all checkout steps except
audit job (cargo install doesn't need git creds) and sonar job
(already had it)
- Move matrix: into strategy: for build-windows, build-darwin,
test-multi (build-targets was already correct)
Build script (apps/rook/build.rs):
- Replace eprintln! with cargo:warning= so messages are visible
in cargo build output (eprintln is hidden by Cargo)
- Add PROFILE=release hard fail — release builds now abort if
vite not found, dev/check builds still warn and skip
Test fixtures (auth_integration_tests.rs):
- Remove #[allow(unused)] from all 4 test password constants
(they ARE used in tests, attribute was misleading)
- Replace with proper CodeQL suppression comments:
// codeql[rust/hard-coded-cryptographic-value] Test fixture only
* fix(build): improve error messages for missing vite in release mode
* fix(quality): resolve SonarQube issues across codebase
- ci(release): move write permissions from workflow to job level (S8233)
- ci(security-deep): remove redundant security-events write at workflow level
- fix(playwright.config): remove commented out dotenv config (S125)
- fix(index.js): use node: prefix for core modules (S7772), extract nested ternary (S3358)
- fix(theme.ts): use globalThis instead of window (S7764)
- fix(a11y): improve breadcrumb and sidebar semantic HTML/S6724/S6819)
- fix(dockerfile): merge consecutive RUN instructions (S7031)
- fix(stale): unused imports in NavSecondary and LocaleSwitcher already removed
* style(lib): format code for better readability in lib.rs
* chore(security): add CodeQL workflow and configure merge-gate security scanners in CI
- Add .github/workflows/codeql.yml: GitHub CodeQL SAST workflow for Rust
(runs on push/PR to main+develop, uploads SARIF to Security tab)
- Add trivy-fs job to ci.yml: Trivy filesystem+deps scan, fails build on
HIGH/CRITICAL vulns, ignores unfixed, uploads SARIF
- Add gitleaks-pr job to ci.yml: scans PR commits (last 50), fails build on
secrets found, exit-code 1
- Add semgrep-pr job to ci.yml: SAST scan filtered to ERROR severity,
fails build on HIGH severity findings, uploads SARIF
- Update security-deep.yml: update exit-code to '1', add cross-references
to ci.yml merge-gate jobs, clarify reporting-only role of nightly scan
- Expand SECURITY.md: full security policy with version support table,
vulnerability disclosure process, contributor best practices, incident
response severity matrix, and security tooling reference
* fix(codeql): pin codeql-action to existing SHA v3.36.0
The SHA c581c57d9861fc6f2c8d3fbd94e36eddc8fdd35c does not exist in the
codeql-action repository. Change to v3.36.0 tag (051e2f90686233507fe9283ff167d2e709304b30)
which is the latest stable v3 release already in use by upload-sarif.
* fix(security): address code scanning review findings across workflows and SECURITY.md
ci.yml:
- gitleaks-pr: increase fetch-depth from 1 to 50 so gitleaks git can
analyze the requested 50-commit window
- trivy-fs: add security-events: write to job permissions; add if:always()
to Upload Trivy SARIF step so SARIF is uploaded even when trivy exits 1
- gitleaks-pr: add if:always() to Upload Gitleaks SARIF step
- semgrep-pr: add if:always() to Upload Semgrep SARIF step
codeql.yml:
- remove workflow-level permissions.security-events: write (moved to job-level)
- remove '|| true' from cargo check so the job properly fails on build errors
SECURITY.md:
- fix grammar: 'an private' -> 'a private'
- fix Chinese text in Critical row: replace with English 'complete authentication bypass'
- fix 'releasetimeline' -> 'release timeline' and 'COORDinator' -> 'We will reach out'
- rewrite scanner table to separately document PR gates (ci.yml jobs) vs
nightly reporting (security-deep.yml), including job names (trivy-fs, gitleaks-pr, semgrep-pr)
* fix(security-deep): replace aquasecurity/trivy-action with direct CLI install
The trivy-action action was failing internal binary installation,
causing reports/trivy/trivy-full.sarif to never be created and
subsequent steps (Verify SARIF, Upload SARIF) to fail.
Fix:
- Install Trivy CLI directly using the official install script with pinned
version v0.65.0 (matches prior internal version)
- Run 'trivy fs' CLI directly, matching existing style for gitleaks/semgrep
- Remove '|| exit 1' from Verify SARIF step so it doesn't cascade failure
- Gate SARIF upload, artifact upload, and summary steps on
'always() && hashFiles(...)' != '' to avoid noise when scan step fails
without the SARIF gate condition
* fix(codeql): build dashboard before cargo check so rust-embed resolves
The rust-embed attribute #[folder = "dashboard/dist"] requires that
directory to exist when 'cargo check' compiles the rook app. On GitHub
Actions runners vite/node_modules are not pre-installed, so the embed
folder does not exist during the check step.
Fix:
- Add Setup pnpm and Setup Node.js steps to install vite and dependencies
- Run 'pnpm install && pnpm build' before 'cargo check --workspace'
- Restore the build step to pure 'cargo check --workspace' (no || true) so
genuine compile errors propagate correctly
The extra pnpm steps give rust-embed the dashboard/dist it needs.
* fix(codeql): use workspace filter for dashboard build in CodeQL workflow
* chore: remove the custom CodeQL workflow entirely.
* fix(security-deep): remove --exit-code 1 from trivy reporting-only scan
The nightly trivy-full job is reporting-only (no merge gate), so it should
never fail the workflow due to vulnerabilities found. Removed --exit-code 1
and cleaned up the hashFiles conditional checks that were causing 'path does
not exist' errors when the scan didn't produce findings.
* fix(security): resolve 4 code scanning alerts
1. rust/log-injection (apps/rook/src/main.rs:177)
- Token was logged in full, enabling log injection attacks
- Now logs only prefix (first 8 chars) + length for traceability
- The eprintln! with full token remains (console output, not structured logs)
2. generic.secrets.security.detected-google-oauth-access-token (manage_connections.rs)
- 2 instances of test data containing 'ya29.' Google-like token patterns
- Both replaced with obviously fake data + nosemgrep comment
- This is test/fixture data, not real secrets
3. generic.secrets.security.detected-sonarqube-docs-api-key (ci.yml)
- False positive: semgrep detected 'sonarqube' in rule name '--config p/secrets'
- Removed --config p/secrets from both ci.yml and security-deep.yml
- Secrets scanning is handled by gitleaks and trivy-fs instead
* fix(security): address PR feedback on code scanning alerts
1. security-deep.yml: Add GITHUB_OUTPUT to 'Verify SARIF file exists' step
(id: verify-sarif) so 'Upload Trivy SARIF' only runs when the file
actually exists (if: steps.verify-sarif.outputs.found == 'true').
2. apps/rook/src/main.rs: Improve log injection mitigation:
- Sanitize all control/non-printable chars to '?' before logging
- Only print full token to stderr when running interactively (atty check)
- Otherwise print only the sanitized 8-char prefix + length
- Added atty = "0.2" dependency
3. manage_connections.rs: Move nosemgrep suppression inline on the
access_token literal instead of the surrounding block.1 parent b555f22 commit 43d7e97
5 files changed
Lines changed: 33 additions & 12 deletions
File tree
- .github/workflows
- apps/rook
- src
- crates/application/rook-usecases/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | 242 | | |
244 | 243 | | |
245 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
| |||
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
| 139 | + | |
141 | 140 | | |
142 | | - | |
| 141 | + | |
143 | 142 | | |
144 | 143 | | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
158 | | - | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | | - | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
178 | 196 | | |
179 | 197 | | |
180 | 198 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
| 909 | + | |
| 910 | + | |
910 | 911 | | |
911 | 912 | | |
912 | 913 | | |
| |||
1995 | 1996 | | |
1996 | 1997 | | |
1997 | 1998 | | |
1998 | | - | |
| 1999 | + | |
| 2000 | + | |
1999 | 2001 | | |
2000 | 2002 | | |
2001 | 2003 | | |
| |||
0 commit comments