diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc9dd70..674a20d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,6 +116,18 @@ jobs: # service, so parallel package runs delete each other's rows. - run: go test -p 1 ./... + govulncheck: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + # The official action uses the Go version declared by go.mod and reports + # only vulnerabilities reachable from this module's packages. + - uses: golang/govulncheck-action@v1 + with: + go-version-file: go.mod + go-package: ./... + shell: runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a103f8..5f79082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project are documented in this file. The format is b - **Stream viewer direction filter** (follow-up to #380): the Traffic detail's Stream tab can show all messages, client-to-server messages or server-to-client messages. Pagination and refresh keep the selected direction, changing the filter resets the list, and opening another exchange resets the direction to all. Recording-limit warnings remain visible but are excluded from the displayed message counts. - **Security response headers on every response**: `X-Content-Type-Options: nosniff`, a same-origin referrer policy, `X-Frame-Options: SAMEORIGIN` and a `frame-ancestors 'self'` CSP are now set by one wrapper around the whole handler tree, so the JSON API carries them too; previously only the console route did. Console documents additionally get `Permissions-Policy` and COOP/CORP. `Strict-Transport-Security` is sent only when the request is known to be HTTPS: directly over TLS, or via `X-Forwarded-Proto: https` from a peer in `ARTEX_TRUSTED_PROXIES`, so a direct client cannot claim HTTPS on its own. The README reverse-proxy recipe now starts with an 80 to 443 redirect. - **Global company switcher**: the sidebar header carries a company picker (search, an explicit "all companies", the asset count). It persists per browser and narrows these views on the server: the findings list, grouped view, asset tree and stat cards (`GET /api/exploration/findings`, `/groups`, `/asset-tree`, `/stats` take `company`), the dashboard findings panels (same list endpoint), the task list (`GET /api/tasks?company=`), the traffic list (`GET /api/traffic?company=`, the hosts the company owns) and the asset tabs (`GET /api/assets?company_id=`, plain and DSL path; the company clause is ANDed outside the compiled DSL). A finding belongs to a company through its live assets. A finding with no live asset belongs to a company only when its task is scoped to that company (`task_scope` kind `company`); otherwise it shows under "all companies" only. An unknown or non-numeric company id returns nothing (#425). +- **Go vulnerability scanning in CI**: every push and pull request runs the official `govulncheck` action against packages reachable from `./...`, using the Go version declared by `go.mod`. Run the same check locally with `./scripts/verify.sh --security`. ### Fixed @@ -307,7 +308,7 @@ Ollama support, a setup token for the first-run claim, secret scrubbing for chil - **The build context includes local secrets**: `.dockerignore` does not exclude `.env`, `config.json` or `jwt.key`, so the build stage's `COPY . .` puts them in a build-stage layer of the local builder cache. They are not copied into the final image. - **Image supply chain**: the recon tools are downloaded at pinned versions but not checksum-verified, sqlmap tracks its default branch, and the Playwright packages are installed at `@latest`. Draft #127 proposes checksum verification. - **No Docker image is published for this release**: the release workflow's `docker` job only runs when `DOCKERHUB_ENABLED` is set, and it still downloads prebuilt binaries into `dist/` that the Dockerfile no longer uses. Build the image from the checkout with `docker compose up -d --build`. -- **CI gaps**: `./server` is not run under `-race`; there is no `govulncheck` step and no `docker build` job. Four tests skip themselves (fresh-database or timing failures, see #9). +- **CI gaps**: there is no `docker build` job. Four tests skip themselves (fresh-database or timing failures, see #9). - **Reported and not fixed in this release**: `list_task_credentials` emits an invalid `"required": [""]` schema that strict LLM providers reject (#130), and the MCP Streamable HTTP client fails against servers that only support protocol version 2025-11-25 (#131; fix proposed in #132). ## [0.4.0] - 2026-10-23 diff --git a/README.md b/README.md index 40a586d..3430e48 100644 --- a/README.md +++ b/README.md @@ -871,7 +871,8 @@ CGO_ENABLED=0 go build -tags embedui -o artex ./cmd/artex - Backend: `go run ./cmd/artex` (without `-tags embedui`, the frontend is not embedded) - Frontend: `cd web && npm run dev` (`/api` is reverse-proxied to the backend, with hot reload) - Tests: `go test ./...` -- Reproduce all CI checks locally: `./scripts/verify.sh` (add `--full` for `-race` and the static web build) +- Reproduce the fast CI checks locally: `./scripts/verify.sh` (add `--full` for `-race` and the static web build; add `--security` for `govulncheck`) +- Security scan: install `govulncheck` and run `./scripts/verify.sh --security` (CI runs this on every push and pull request) - Mock preview (no backend): `cd web && NEXT_PUBLIC_MOCK=1 npm run dev` --- diff --git a/scripts/verify.sh b/scripts/verify.sh index c231edd..47a7bd9 100755 --- a/scripts/verify.sh +++ b/scripts/verify.sh @@ -2,9 +2,10 @@ # Verify ARTEX locally, reproducing the checks from .github/workflows/ci.yml. # # Usage: -# scripts/verify.sh [--full] [--go-only] [--web-only] [--keep-going] +# scripts/verify.sh [--full] [--security] [--go-only] [--web-only] [--keep-going] # # --full also run `go test -race` (the CI package list) and the web static build +# --security run `govulncheck ./...` (requires govulncheck in PATH) # --go-only run only the Go checks # --web-only run only the web checks # --keep-going continue after a failed step and report every failure at the end @@ -18,12 +19,14 @@ cd "$(dirname "$0")/.." usage() { sed -n '2,14p' "$0" | sed 's/^# \?//'; } FULL=0 +SECURITY=0 GO_ONLY=0 WEB_ONLY=0 KEEP_GOING=0 while [ $# -gt 0 ]; do case "$1" in --full) FULL=1; shift ;; + --security) SECURITY=1; shift ;; --go-only) GO_ONLY=1; shift ;; --web-only) WEB_ONLY=1; shift ;; --keep-going) KEEP_GOING=1; shift ;; @@ -35,6 +38,10 @@ if [ "$GO_ONLY" -eq 1 ] && [ "$WEB_ONLY" -eq 1 ]; then echo "--go-only and --web-only are mutually exclusive" >&2 exit 2 fi +if [ "$SECURITY" -eq 1 ] && [ "$WEB_ONLY" -eq 1 ]; then + echo "--security requires the Go checks and cannot be combined with --web-only" >&2 + exit 2 +fi FAILED=0 run_step() { @@ -109,6 +116,11 @@ if want_go; then run_step "go vet" go vet ./... run_step "go test -p 1" go test -p 1 ./... + if [ "$SECURITY" -eq 1 ]; then + require_cmd govulncheck + run_step "govulncheck" govulncheck ./... + fi + if [ "$FULL" -eq 1 ]; then RACE_PKGS=( ./agent ./cmd/artex ./config ./db ./evidence ./guard