Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ jobs:
- name: Install Task
uses: ./.github/actions/install-task

- name: Audit JavaScript dependencies (high and critical)
run: task sec:js

- name: Web lint (Typecheck, Biome, and knip)
run: task web:lint

Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Check Go vulnerabilities
run: govulncheck ./...

web-audit:
js-audit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -47,17 +47,19 @@ jobs:
with:
bun-version: "1.4.2"

- name: Install web packages
working-directory: web
run: bun install --frozen-lockfile

- name: Audit web dependencies (high and critical)
working-directory: web
run: bun audit --audit-level=high
- name: Audit web, docs and mock OAuth dependencies (high and critical)
run: scripts/check_js_audit.sh

image-scan:
runs-on: ubuntu-24.04
steps:
# The image repository needs a login to pull.
- name: Log in to Docker Hub
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Scan the published gateway image
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
Expand Down
7 changes: 6 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ tests, web and CLI E2E, builds) is too slow to run locally on every push. CI run

- `govulncheck` - Check for known Go vulnerabilities
- `shellcheck` - Validate all shell scripts
- `npm audit` - Check for npm package vulnerabilities
- `task sec:js` - `bun audit` of the web, docs and mock OAuth packages; fails on any high or critical advisory

CI runs all three on every push. The nightly Security Scan workflow (`.github/workflows/security-scan.yml`) runs
`govulncheck` and the JavaScript audit again, and scans the published Docker image with Trivy, so new advisories
show up when nobody pushes. Fix a failing scan by upgrading the package (refresh its `bun.lock` entry if it's a
transitive dependency).

### 7. DeepSource Static Analysis

Expand Down
6 changes: 6 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tasks:
- task: duplication
- task: file-length
- task: shellcheck
- task: sec:js
- task: web:check-ignores
- task: build
- task: generate:test
Expand All @@ -39,6 +40,11 @@ tasks:
cmds:
- git ls-files "*.sh" | xargs shellcheck

sec:js:
desc: Fail on high or critical advisories in the web, docs and mock OAuth packages
cmds:
- scripts/check_js_audit.sh

format:
desc: Format Go, web, and mock OAuth code
deps: [go:format, web:format, mock-oauth:format]
Expand Down
146 changes: 44 additions & 102 deletions docs/bun.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/src/content/docs/development/contributing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ on GitHub, or email [security@docspring.com](mailto:security@docspring.com). See
3. **Dependencies**
- Keep dependencies updated
- Review security advisories
- Run `govulncheck` and `npm audit`
- Run `task go:sec:vuln` (govulncheck) and `task sec:js` (`bun audit` of the web, docs and mock OAuth
packages); CI fails on any high or critical advisory

## Testing Requirements

Expand Down
120 changes: 30 additions & 90 deletions mock-oauth/bun.lock

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions scripts/check_js_audit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail

# Fails on any high or critical advisory in the JavaScript packages: the web UI, the docs site and the mock OAuth
# server. bun audit reads bun.lock, so nothing needs installing first. CI runs it on every push, and the Security
# Scan workflow nightly, so a newly disclosed advisory shows up even when nobody pushes.

cd "$(dirname "$0")/.."

status=0
for dir in web docs mock-oauth; do
echo "Auditing ${dir} dependencies..."
if ! (cd "${dir}" && bun audit --audit-level=high); then
status=1
fi
done
exit "${status}"
448 changes: 181 additions & 267 deletions web/bun.lock

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions web/knip.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
{
"$schema": "https://unpkg.com/knip@5/schema-jsonc.json",
"$schema": "https://unpkg.com/knip@6/schema-jsonc.json",
"ignore": [
"src/api/generated.ts",
"src/lib/generated/**",
"src/contexts/step-up-debug.ts",
"src/lib/api.ts",
"src/api/schemas/**",
"orval.config.ts",
"src/api/types.generated.ts",
"src/components/ui/**"
],
"ignoreDependencies": [
"@radix-ui/react-tabs",
"tailwindcss",
"tw-animate-css",
"@biomejs/biome"
]
"ignoreDependencies": ["@radix-ui/react-tabs"]
}
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@vitest/ui": "^4.1.11",
"autoprefixer": "^10.6.1",
"jsdom": "^27.4.0",
"knip": "^5.88.1",
"knip": "^6.39.0",
"openapi-typescript": "^7.13.0",
"orval": "^8.39.0",
"otplib": "^12.0.1",
Expand Down