This is a large squashed commit covering two batches of prior uncommitted work plus a full security-audit remediation pass, kept together because go.mod/go.sum and several shared files (main.go, handler.go) were touched by both and splitting risked non-building intermediate commits. Features (built earlier, previously uncommitted): - Local username/password login for single-tenant deployments with no SSO configured (api/localauth, alerting/internal/sessioncheck, sentryctl users, web/src/routes/login, metadata migrations 0040/0041). - Remotely-editable additional log file paths for agents, on top of their existing primary source (api/agents, agent/sentry-agent extra-file-path diffing, web agent config UI). - IPv4/IPv6 addresses reported alongside other host system metrics. Security audit remediation (this pass, all live-verified in production): - Critical: block ClickHouse SSRF table functions (url/remote/file/s3/...) in the raw-SQL query escape hatch. - High: deny sensitive paths and require Admin to add agent extra_file_paths (Editor could previously point an agent at /etc/shadow or an SSH key); alerting webhook targets now validate against internal/metadata/loopback addresses, both at creation and send time; alerting's session middleware now enforces an Editor+ floor on mutating requests instead of "any authenticated session"; bumped goxmldsig to close a SAML signature-verification bypass (GO-2026-4753). - Medium: per-IP login rate limiting; security response headers (HSTS/CSP/nosniff/X-Frame-Options/Referrer-Policy/Permissions-Policy) on web/nginx.conf; a DevCredentialWarnings check in every Go service's config loader, logging loudly at startup if a deployment is still on docker-compose.yml's literal dev-only credentials; dependency bumps (golang.org/x/text, grpc, x/net, quick-xml, h2) across every affected Go module and both Rust crates, including a previously-uncovered x/net vulnerability in deploy/operator; a new security-scan.yml CI workflow running cargo-deny/govulncheck/npm-audit, mirroring the existing license-compliance.yml matrix shape. - Low: removed sentryctl's plaintext --password flag (shell history/`ps` exposure) in favor of stdin and a --password-stdin flag for reset-password's optional specific-password path; a dummy bcrypt comparison closes a login response-time username-enumeration side-channel.
45 lines
2.1 KiB
Docker
45 lines
2.1 KiB
Docker
# Build context can be just web/ (unlike agent/ingest/api, this doesn't
|
|
# need /proto):
|
|
# docker build -f web/Dockerfile -t sentry-web web/
|
|
|
|
FROM node:22-alpine AS builder
|
|
WORKDIR /src
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
# All three VITE_* vars are baked in at build time — this is a
|
|
# prerendered static site, not a server. Override with --build-arg for
|
|
# non-default deployments. Each one needs its own ARG: an undeclared
|
|
# --build-arg from docker-compose.yml's build.args is silently dropped
|
|
# by Docker, not an error -- confirmed the hard way when
|
|
# VITE_ALERTING_API_BASE_URL/VITE_ENTERPRISE_AUTH_BASE_URL were being
|
|
# passed in but only VITE_API_BASE_URL was ever declared here, so the
|
|
# other two never reached `npm run build` even though docker-compose.yml
|
|
# looked correct. VITE_ENTERPRISE_AUTH_BASE_URL has no default (unlike
|
|
# the other two) -- web/src/lib/api.ts treats it as intentionally
|
|
# undefined when unset, meaning "enterprise-auth isn't deployed", not
|
|
# "use some fallback host."
|
|
ARG VITE_API_BASE_URL=http://localhost:8080
|
|
ARG VITE_ALERTING_API_BASE_URL=http://localhost:8081
|
|
ARG VITE_ENTERPRISE_AUTH_BASE_URL
|
|
# Off by default -- local dev's plain WithCORS (wildcard
|
|
# Access-Control-Allow-Origin) can't be combined with a credentialed
|
|
# fetch at all, so api.ts must not send cookies unless the deployment
|
|
# actually turned local auth on server-side too (LOCAL_AUTH_ENABLED).
|
|
# See api.ts's requestFrom/alertingRequest doc comment.
|
|
ARG VITE_LOCAL_AUTH_ENABLED=false
|
|
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
|
ENV VITE_ALERTING_API_BASE_URL=${VITE_ALERTING_API_BASE_URL}
|
|
ENV VITE_ENTERPRISE_AUTH_BASE_URL=${VITE_ENTERPRISE_AUTH_BASE_URL}
|
|
ENV VITE_LOCAL_AUTH_ENABLED=${VITE_LOCAL_AUTH_ENABLED}
|
|
RUN npm run build
|
|
|
|
# Not distroless: serving a static SPA needs *some* HTTP server, and
|
|
# nginx:alpine is the boring, well-understood choice for that job — a
|
|
# custom static-file-serving binary would be more engineering than a
|
|
# Phase 0 placeholder page warrants. See /web/README.md.
|
|
FROM nginx:alpine
|
|
COPY --from=builder /src/build /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 3000
|