Skip to content

Security: thomasunise/argus

docs/SECURITY.md

Security

This page states the security model as implemented in this repository, what deployers must add, and how to report a vulnerability. The threat analysis is in docs/THREAT-MODEL.md; procedures are in docs/RUNBOOKS.md.

Reporting a vulnerability & Vulnerability Disclosure Program (VDP)

Argus is developed and supported by eeko systems (security@eeko.systems).

Use GitHub private vulnerability reporting on this repository (Security tab, "Report a vulnerability") or email security@eeko.systems with steps to reproduce. Do not open a public issue for an unpatched vulnerability.

Disclosure & Patch Timeline

Severity (CVSS v3.1 / v4.0) Acknowledgement Triage & Reproduction Target Patch Release Coordinated Public Disclosure
Critical (9.0–10.0) Within 24 hours Within 2 business days Within 7 calendar days 30 days after patch (or by mutual agreement)
High (7.0–8.9) Within 3 business days Within 5 business days Within 14 calendar days 45 days after patch
Medium (4.0–6.9) Within 3 business days Within 7 business days Within 30 calendar days 60 days after patch
Low (0.1–3.9) Within 3 business days Within 10 business days Within 90 calendar days Next scheduled release

Safe Harbor & Scope

  • In scope: The Argus core application (app/), sandbox runner & executor (sandbox/), container manifests (Dockerfile*, compose*.yaml), Helm chart (infra/helm/argus), and Terraform modules (infra/terraform*).
  • Safe harbor: Good-faith security research conducted against your own self-hosted Argus instance or designated test environments that avoids privacy violations, service disruption, and data destruction is authorized by eeko systems. We will not initiate legal action against researchers who follow this policy.

Principles

  1. Agents do not act. Model-driven code has read-only tools; the single write-capable tool creates a pending request for humans. Execution lives in a separate broker with its own policy, approvals, dry run, rollback and kill switch.
  2. Evidence is untrusted. Everything shown to a model is redacted, size-limited and wrapped in <untrusted_data> delimiters with an explicit instruction that it is data.
  3. Testing is authorized, scoped and re-checked. No active test runs without a recorded authorization and a scope; the check repeats inside the worker; intrusive tiers are staging/lab only.
  4. Tenants are isolated by construction. Every domain table has tenant_id; queries use a scoped helper; tests assert cross-tenant access returns 404 or nothing.
  5. History is tamper-evident. Audit entries are hash-chained per tenant, HMAC-signed when AUDIT_SIGNING_KEY is set, and mirrored to append-only sinks.
  6. Secrets stay out of the database, logs and model context. Only references are stored (env:, file:, secrets:); free text passes through redact(). The development-only literal: form (ALLOW_LITERAL_SECRET_REFS, refused in production) is encrypted at rest and masked as literal:[set] in every API response.

Implemented controls

Authentication and sessions (app/core/security.py, app/api/auth.py, app/api/deps.py)

  • Passwords: scrypt (N=2^14, r=8, p=1), constant-time verification.
  • Sessions: signed cookie, HttpOnly, SameSite=lax (the OIDC callback must carry it; mutations need the CSRF header), idle timeout SESSION_MAX_AGE, absolute lifetime SESSION_ABSOLUTE_MAX_AGE, Secure when COOKIE_SECURE=true, lifetime SESSION_MAX_AGE.
  • CSRF: X-CSRF-Token required on every non-safe method for session principals.
  • Login throttling per client IP (LOGIN_MAX_ATTEMPTS in LOGIN_WINDOW_SECONDS).
  • TOTP (RFC 6238, six digits, one-step window); TOTP_REQUIRED enforces it.
  • OIDC authorization code with PKCE (S256), state and nonce, ID token verified against the JWKS with issuer and audience, optional email-domain allowlist and auto-provisioning with a default role.
  • API keys: argus_<prefix>_<body>, SHA-256 hash stored, revocation, last-used tracking, role plus optional scopes; ingest keys use require_scope('ingest').
  • RBAC: five cumulative roles; every endpoint declares its permission.
  • Rate limits: per principal (API_RATE_LIMIT_PER_MINUTE) and per ingest key (INGEST_RATE_LIMIT_PER_MINUTE), using an atomic Redis-backed sliding window when REDIS_URL is configured (failing closed if Redis is unreachable) or a bounded in-process sliding window in single-process development.

Transport and headers (app/core/telemetry.py)

  • X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: no-referrer, Permissions-Policy, a restrictive Content-Security-Policy, HSTS when COOKIE_SECURE.
  • Request id in and out (X-Request-ID), present in logs and audit entries.

Audit (app/core/audit.py)

  • record_audit() writes actor, kind, action, subject, redacted detail, request id, previous_hash, entry_hash, signature, timestamp.
  • Concurrent writers cannot fork a chain on PostgreSQL (transaction-scoped per-tenant advisory lock); sinks receive an entry only after its transaction commits. SQLite is development-only and does not get this guarantee.
  • verify_chain() recomputes the chain and signatures; the result reports the first broken id.
  • Sinks: JSONL (append), S3 Object Lock (one object per entry), Azure immutable blob (overwrite=False). Sink failures are logged, never block.

Data handling

  • redact() patterns cover AWS keys, bearer tokens, key=value secrets, private key blocks, OpenAI-style keys, Argus API keys, GitHub and Slack tokens.
  • Finding evidence capped at 6 KB, event metadata at 8 KB, audit detail at 4 KB, tool results at AGENT_TOOL_RESULT_LIMIT.
  • Collector and integration credentials are secret_ref strings resolved at run time (env:, file:, secrets:).

Target policy and testing (app/core/policy.py, app/testing/)

  • Web targets: HTTPS origin only, ports 443/8443, no credentials, path, query or fragment; localhost rejected; resolved addresses must be global unless ALLOW_PRIVATE_TARGETS with PRIVATE_TARGET_CIDRS; loopback, link-local, multicast always denied.
  • Repo targets: must resolve under SCAN_ROOT.
  • scope.check() enforces scope validity, asset membership, environment, tier (scope and authorization), intrusive-only-in-staging/lab, time window, target validity, at request and execution.
  • run_tool() executes a fixed argv with a timeout, bounded output, redaction and a minimal environment.
  • Per-scope max_rps and max_concurrency (runs beyond the limit wait in the queue); global TEST_RATE_LIMIT_RPS and TEST_TOOL_TIMEOUT_SECONDS.

Agents (app/agents/)

  • Budgets: steps, tokens, seconds, USD ceiling.
  • Tool schemas closed; arguments type-checked; unknown tools rejected.
  • Every step persisted with an input hash for reproducibility.
  • AI_PROVIDER=none runs deterministic fallbacks; no provider call happens without explicit configuration.
  • Eval suites including prompt injection under app/agents/evals/suites/.

Actions (app/actions/)

  • 27 typed actions, each with a parameter schema, risk, reversibility and platform list; executors implement dry_run, execute and rollback.
  • Policy evaluated at request and again at execution: global ACTIONS_KILL_SWITCH, tenant kill switch (actions_enabled=false), deny-lists, maintenance window, auto-approval only for low-risk reversible actions when enabled, two approvals for high risk, owner-level (actions:approve_critical) approval for critical; requester cannot approve own request; request TTL.
  • Execution and rollback are queue jobs with stored rollback payloads; every transition is audited (actions.requested, actions.approved, actions.executed, actions.rolled_back, actions.kill_switch, ...).

Integrations (app/integrations/)

  • Ingest requires an API key with scope ingest (or a signed webhook for sources that support verification); per-key and per-integration rate limits; payload size bounded; parsers emit drafts that go through upsert_event / upsert_finding (dedupe, redaction).
  • Outbound channels store credentials as secret_refs; deliveries are logged with retries.

Queue (app/core/queue.py)

  • Leases, heartbeat, retry with backoff, cancellation, reaper for expired leases; handlers re-validate tenant and authorization.

Containers and infrastructure (Dockerfile, compose*.yaml, infra/)

  • Non-root UID 10001, read-only root filesystem, all capabilities dropped, no-new-privileges, tini as PID 1, health checks, no Docker socket.
  • Compose binds the API to loopback; the prod overlay adds TLS, HSTS and blocks /metrics.
  • Helm: default-deny NetworkPolicy, PDB, HPA, seccomp RuntimeDefault, no service-account token.
  • Terraform: private subnets, CMK encryption, forced TLS to data stores, Object Lock / immutable audit storage, WAF, redacted WAF logs, write-only audit IAM.

Supply chain (.github/)

  • CI: pytest on 3.11 and 3.12 with SQLite and with PostgreSQL, pip-audit --strict, bandit -r app -ll, Docker build and smoke test, YAML/Terraform/Helm lint.
  • Release: SBOM (SPDX, syft), cosign keyless signing of image and SBOM attestation, GitHub build provenance.
  • Dependabot for pip, GitHub Actions, Docker and Terraform.

Deployer responsibilities

  • TLS termination, edge rate limiting and WAF (provided configurations are starting points).
  • Egress filtering for workers: the application cannot prevent DNS rebinding or guarantee that an authorized hostname never resolves to an internal address after validation.
  • Secret storage and rotation; AUDIT_SIGNING_KEY set; object-lock sink enabled.
  • OIDC and MFA; periodic access reviews.
  • Installing and pinning external test tools in worker images only.
  • Reviewing model-provider terms before enabling a hosted provider.
  • Backups and restore tests for PostgreSQL.

Defense-in-depth & architectural boundaries

  • PostgreSQL Row-Level Security (RLS): Migration a1b2c3d4e5f6 enables RLS policies (tenant_id = current_setting('app.tenant_id', true)) across all tenant-scoped tables, and set_tenant_context() binds app.tenant_id on authenticated requests and background streaming sessions.
  • Key-ring rotation: Both DATA_ENCRYPTION_KEYS and AUDIT_SIGNING_KEYS support key-id-prefixed (k2=...,k1=...) zero-downtime key rotation and verification.
  • Per-tenant encryption keys: Stored evidence is encrypted at rest using the platform key ring (DATA_ENCRYPTION_KEYS); per-tenant KMS envelope keys are not used by default, while action credentials support strict per-tenant isolation (ALLOW_ENV_ACTION_CREDENTIALS=false or tenant isolate_action_credentials: true).

Remediation notes (2026-11-04)

  • Signed browser sessions have a database-backed account-wide invalidation timestamp. Logout revokes all the account's sessions. Password resets and the admin POST /api/v1/admin/users/{user_id}/revoke-sessions endpoint do the same.
  • Authentication failure counts are shared through Redis in production, with an atomic sliding window and failure-closed backend errors.
  • The passive HTTPS baseline pins production scan connections to an approved IP and retains TLS SNI and the original Host header. Other scanner binaries and sandbox runners MUST still have egress restrictions independently.
  • Rollback of an already executed reversible action is permitted during the action kill switch. This is an authorized recovery action and is audited.
  • AI spending is checked against current spend PLUS a reserved request estimate. Provider token usage must be reconciled after completion. This reduces concurrency overshoot, but budget correctness relies on providers enforcing the requested output limit, accurate model pricing and reliable metering.
  • The built-in detection benchmark uses a small synthetic regression suite; it is not evidence of independently verified enterprise detection accuracy.

There aren't any published security advisories