Skip to content

Security: FERCBusters/keen

SECURITY.md

Security policy and threat model

Reporting a vulnerability

Please report suspected vulnerabilities through this project's GitHub repository. Prefer Security → Advisories → Report a vulnerability for a private report. If private reporting is unavailable, open an issue asking for a private reporting channel and keep exploit details, credentials and sensitive data out of the public issue.

Every report must include a reproducible proof of concept demonstrating the issue. Include:

  • The Keen version or commit, deployment configuration relevant to the issue, and affected component.
  • The attacker's required access, permissions and other prerequisites.
  • Minimal reproduction steps or a script, expected and actual results, and evidence of the security impact.
  • Synthetic test data and redacted logs or screenshots where useful.

Test on an installation you own or have explicit permission to assess. Use the smallest demonstration that establishes the issue, preserve other people's data, and avoid disruptive testing against public or hosted instances.

Our goal is to provide a preliminary response within 72 hours. This is an acknowledgement and initial assessment target; investigation and remediation time depends on the report. Keen offers no monetary bounties. Authors of validated reports will be credited, using their preferred name or handle, unless they request anonymity. We coordinate disclosure with reporters after assessing impact and remediation.

How this document is organised

Each area below states three things:

  • Guarantees are the controls Keen enforces and tests. A way to break one, from a position the threat model admits, is a security issue that should be reported.
  • Best effort measures reduce a risk without promising to remove it, usually because they depend on how people, browsers or language models read text. A gap in one is a hardening suggestion rather than a vulnerability, unless it also breaks a guarantee.
  • Accepted risks are known limitations Keen has chosen to live with, and the reason for each. A report that only describes an accepted risk describes the policy.

How each guarantee is implemented, with the current limits and defaults behind it, is described in the design notes under docs/security/. The notes help reviewers find the enforcing code; they are not separate promises, and a number they give (a time limit, a size, a count) can change without changing a guarantee here unless the guarantee itself names it.

Scope and trust boundaries

What Keen protects

Keen stores operational evidence, artifacts, assurance mappings, audit discussions, risk and ISMS records, user accounts, integration credentials and agent identities. These records can contain sensitive organisational or personal information. Security objectives include controlling who can read or change them, keeping collection credentials within their intended connection, preserving evidence identity, and maintaining service availability.

A Keen installation is an organisational trust boundary. Users inside it receive access through roles, groups and permissions. Source connections distinguish systems and credentials within that installation. They do not create independent tenants or separate encryption domains. Hosting mutually distrustful organisations requires isolated installations, databases, storage, broker namespaces and secrets.

Actors

The threat model includes an unauthenticated Internet client, a malicious website visited by a signed-in user, a user acting beyond their assigned permissions, a compromised enrolled agent or webhook credential, and hostile content returned by a configured evidence source. A valid source credential establishes who submitted evidence; reviewers still assess the truth and relevance of its contents.

Application administrators are trusted to configure sources, permissions, mapping rules and evidence retention. Deployment operators control the executable code, database, broker, storage and encryption keys. Compromise of these privileges can compromise the installation. An administrator's intended ability to delete data or grant permissions is part of that role; escaping the role's intended authority remains a security issue.

Upstream identity providers and authorised integration servers are trusted for their specific functions. A compromised provider can assert identities; a compromised collection server can return fabricated data and observe credentials issued for that server. Network controls and narrowly scoped upstream credentials reduce the resulting exposure.

Hostile evidence sources

A configured evidence source can turn hostile: a compromised upstream, a third-party feed, or anyone who can write into a log Keen collects. Keen contains what such a source can do to its own collection: its requests, parsing and runs end within time and size limits, one record or rule cannot stop a run, and other sources, the API and the workers carry on.

Within those limits a hostile source can still send false, misleading or incomplete evidence, fail on every run, or use its whole budget each time. Reviewers judge the truth and provenance of what it sent, a failing source reports a bounded, generic error in its run results, and administrators pause or remove a source that misbehaves.

Post-quantum cryptography

A future cryptographically relevant quantum computer matters chiefly for data recorded now and attacked later. Keen Agent traffic is protected against that "harvest now, decrypt later" risk: each request's key exchange is hybrid, ML-KEM-768 (FIPS 203) with X25519, so it stays confidential unless both are broken, and request bodies and responses use AES-256-GCM. Authentication is classical: Keen's identity key, agent keys and the request, batch and evidence signatures are Ed25519, which such a computer could forge. A forgery only helps an attacker who is active at the time, and recorded traffic cannot be impersonated retrospectively; stored evidence also rests on Keen's own receipt records, so passing off forged evidence as historical still needs write access to Keen.

Other Keen traffic (browsers, integrations, webhooks and bearer-token OTLP collectors) relies on TLS alone and is post-quantum only where both ends negotiate a hybrid key exchange, as Go 1.24 and later clients (including Keen Agent) and servers built on TLS libraries such as OpenSSL 3.5 and later do by default. Secrets stored with KEEN_INTEGRATION_SECRET_KEY and KEEN_MFA_ENCRYPTION_KEY use symmetric cryptography, which quantum attacks weaken but do not break.

Authentication

Design notes: docs/security/authentication.md.

Guarantees

  • Browser sessions use random, server-generated identifiers. The session store keeps only a digest of each one, and the browser holds it in an HttpOnly cookie, which takes the __Host- prefix where cookies are Secure and no cookie domain is set.
  • Signing in issues a fresh session. A CSRF-protected POST sign-out ends the server-side session, and a GET never changes authentication state.
  • Every session has a fixed maximum lifetime as well as rolling expiry. Deactivating an account, or changing or resetting its password or second factors, ends its existing sessions, even after reactivation. No session is issued to an account that is deactivated while it signs in.
  • Local passwords are stored as salted PBKDF2-HMAC-SHA256 hashes. A new password must meet the configured minimum length and is refused when it is weak in the ways the design notes list.
  • Password guessing is bounded for each account and each address. Browsers that have not signed in to the account wait longer after each failure, and after 100 consecutive failures they are refused until a correct password from a recognised browser or a reset by an administrator. A browser that has signed in to the account has its own small allowance. The throttle answers the same way whether or not an account exists.
  • Second factors (TOTP, WebAuthn and recovery codes) are verified before a session is issued. Wrong codes are limited for each account. Managing factors requires reauthentication. TOTP secrets are stored encrypted, and recovery codes are stored hashed and work once.
  • OpenID Connect sign-in checks the token's signature, issuer, audience (the configured client ID alone) and nonce, and uses PKCE with single-use state bound to the browser. Callback addresses are configured, never derived from the request.
  • An identity is linked to an existing account automatically only when both Keen and the provider have verified the email address. The account holder is told of each link and can remove it.
  • Trusted remote-user headers are accepted only from a direct peer in KEEN_REMOTE_USER_TRUSTED_CIDRS, on every request. Keen does not start in that mode without the list.
  • Client addresses follow X-Forwarded-For only through hops in KEEN_SECURITY_TRUSTED_PROXY_CIDRS.
  • Sign-in throttling and the other authentication limits fail closed when Valkey is unavailable. While no session can be read, authenticated requests are answered 503 and name no account.

Accepted risks

  • Anyone who knows a username can make sign-in from new browsers wait between attempts and, after 100 failures, refuse them until recovery. The account holder's recognised browsers keep working throughout, and an administrator can reset the password. An attacker without a device cookie gets at most 100 consecutive guesses for each account. Multi-factor authentication covers a guessed password.
  • A session does not follow later changes at a directory or identity provider. A person removed there keeps an existing Keen session until it lapses or an administrator deactivates the Keen account.
  • Keen's own MFA policy covers local and directory sign-in. With SSO or trusted remote-user authentication, the identity provider or authenticating proxy is the authority for second factors.
  • While KEEN_SECURITY_TRUSTED_PROXY_CIDRS is empty behind a proxy, clients share the proxy's address for rate limits, so one client's failures can block others. The API logs a warning when this happens.

Authorisation

Design notes: docs/security/authorisation.md.

Guarantees

  • Authentication is applied centrally. Public routes are listed by method and complete route pattern, and a new route is never public by default.
  • Writes are limited to administrators unless a route is explicitly permission-controlled or self-service. Every route enforces its own permission and object checks on the server; what the UI shows or hides is a convenience, not a control. tools/security_e2e/access_policy.py records the rule for every served route, and the tests fail for a route that has none.
  • The audit trail and the administration namespace are for administrators only, and no permission grants them.
  • Being named on a record (as a risk's owner or a member of the role that owns it, a meeting's or audit's attendee, an incident's coordinator, expert or other participant, an objective's, asset's or legal item's owner, or a quiz participant) lets an account read that record without a permission, as the design notes describe for each kind. Changing who is named, or what account a People record names, needs the permission that manages that access. The design notes list each such rule with the permission that guards it.
  • Lists, searches, counts, relationship views, the Map, stories, incidents, exports and change histories show only records their reader can open. A related record the reader cannot read is left out or shown as unavailable. The exceptions are the deliberate disclosures and the evidence statistics listed under accepted risks.
  • What a risk or PESTLE(E) item affects (people, vendors and assets) is shown only to readers who may read those registers, including in the record's history and over MCP.
  • A person's quiz answers and scores reach only that person, as the quiz allows, and the people who manage the quiz. Results for anyone else are shown only for closed, fully graded rounds of at least three people, without names, answers or the options people chose.
  • A record's comment threads reach only accounts that can read the record, in its Comments tab, the Comments page, My comments, the bell's count and outbound webhooks alike. Starting a thread needs comment.create; a reply comes only from the thread's author or someone who answers for the record (an administrator, a manager of its area or an account the record names); deleting a thread needs comment.delete. Deleting a record deletes its threads.
  • An account sees and marks only its own notifications, and only for records it can open. A notification email is queued only if its recipient could open the record at that time.
  • A disabled feature rejects its operational routes, for administrators too.

Accepted risks

  • An audit's readers see what was sampled into it (a sampled event's summary fields, each sample's title and supported controls) and its scoped documents and SWOT items, without read access to those records. Sampling is a deliberate disclosure by whoever samples, who must be able to read what they sample.
  • Evidence statistics (totals, controls with evidence, per-control counts and dates) can count diary entries a reader cannot open. An events.read holder can therefore infer that a record was linked to a control, and roughly when.
  • Choosing an organisation role as a risk's owner or a quiz's audience gives its current members access. Review a role's members when you choose it.
  • Readers who know who sat a small quiz round can narrow down its members' scores from its average.
  • Feature switches manage availability and are not confidentiality boundaries. Shared references can stay visible through other enabled features.
  • A notification email carries the record's title and goes to the address the account has when the email is queued. An email-only notification stays marked as read even if its email later fails.

Browser boundaries

Design notes: docs/security/browser.md.

Guarantees

  • A cookie-authenticated write needs a CSRF token bound to the session, and an Origin equal to KEEN_PUBLIC_BASE_URL. Request Host and forwarded headers play no part in that check.
  • Plain text is escaped before it is inserted as HTML. Rich text is reduced to a formatting allowlist on the server and sanitised again when it is rendered. The rich-text editor receives saved or pasted content only through the shared sanitiser.
  • Links, post-login destinations and stored URLs are followed only as HTTP(S) addresses or same-origin paths that cannot resolve to another host.
  • The supplied nginx policy allows scripts only from the installation's own origin, and blocks inline scripts, string evaluation and embedded objects.
  • The API refuses request targets with dot segments or encoded separators outside a route's path parameter, and the supplied nginx forwards API targets unchanged.
  • CSV exports neutralise text that a spreadsheet would read as a formula. Downloads are served as attachments with nosniff, and only with a media type a browser displays or saves without interpreting it, so an uploaded file cannot act as same-origin script or style.
  • Application responses are not cached.

Accepted risks

  • The UI's content security policy allows inline styles.
  • A front proxy placed before the supplied nginx must forward request targets unchanged. Keen cannot enforce that.

Inbound machine interfaces

Design notes: docs/security/inbound.md.

Guarantees

  • Webhooks require configured secrets. A missing secret, or one left as an example file's placeholder, fails closed. Identical deliveries within the replay window are rejected. Nothing reveals whether a connection exists, or whether ingestion is paused, before the secret verifies. Allowances for each address and each provider limit verified and refused deliveries separately, so a sender without a secret cannot spend a genuine sender's allowance.
  • Effectiveness-metric submissions are signed with each measure's own secret over the timestamp and exact body. Each submission is accepted only within its time window and only once. A measure's secret can submit results for that measure alone.
  • Keen Agent keys are generated on the device, and Keen stores only public keys. Enrolment codes and bootstrap keys are stored hashed. An enrolment binds a key only with a fresh proof of possession that can be used once, within a profile's restrictions.
  • Every agent request is signed over its method, operation and body, and accepted once within its time window. Requests are refused while replay protection is unavailable.
  • Agent traffic is sealed end to end to Keen's pinned identity with a hybrid post-quantum key exchange, and responses are sealed back to the agent. Proxies, CDNs and holders of a certificate for Keen's hostname see only ciphertext.
  • A compromised agent key can act only as that agent (evidence, heartbeats and renewal) until it is revoked.
  • Evidence envelopes must be canonical JSON. A batch signed by a known key must verify or the whole request is refused. Unsigned batches, and batches signed by unknown keys, are labelled as such. Every change Keen makes before storing an envelope is listed in its custody record.

Accepted risks

  • A generic webhook's secret travels with each delivery, so whoever obtains a delivery can send new ones.
  • A signature shows which key produced a report and that the report is unchanged. A compromised device can still sign false reports.
  • A profile agent can take a free name that an administrator registers later, or one that a pattern-based mapping rule matches. Scope device rules to exact names and review profile enrolments.
  • Erasing expired encryption keys does not reach database backups or archived WAL.
  • Anyone holding the public subject pseudonym key can test guessed account identifiers against public pseudonyms.
  • Bearer-token OTLP collectors rely on TLS alone.

AI agent access (MCP)

Design notes: docs/security/mcp-and-chat.md.

Guarantees

  • MCP is off unless KEEN_MCP_ENABLED is set. While it is off, its endpoints answer 404 and every token fails. Turning it off suspends connections; it does not end them.
  • Apps register as public OAuth clients and must use PKCE (S256). Keen issues no client secrets. A callback must be a loopback http address or an exact entry in KEEN_MCP_REDIRECT_URIS, and a callback removed from that list never receives an answer.
  • The consent page labels every app's name as unverified, shows it with "(not built into Keen)", and shows the host its callback returns to. Consent needs a signed-in session and CSRF proof, is answered once, and is followed by a security email to the account.
  • A grant holds scopes, never a role. On every request a connection acts as its account's current permissions narrowed to those scopes, with no administrator role. The one exception is the mapping-rule routes, and only for an account that is an administrator at that request. Read access an account gets from being named on a record stays with the signed-in account and is not carried into a connection. A connection reaches only the routes its tools use (INNER_ROUTES), within allowances for its reads and its changes.
  • Changes are off unless KEEN_MCP_WRITE_ENABLED is also set. Change scopes are offered unticked, and only to accounts holding the same permission or, for stories, stories.admin, which includes it. No tool deletes a record, or changes accounts, permissions, settings, frameworks or controls. Each change is checked by the route's own permission and object checks, and recorded under the account.
  • An import's preview writes nothing. Saving needs the preview's plan, which works once, expires, and is bound to the connection and to a digest of the rows.
  • Codes, tokens and consent keys are stored as digests. Access tokens are short-lived and refresh tokens rotate. Presenting a used code or refresh token revokes its grant, apart from the short grace period below. Deactivating an account, or changing or resetting its password or second factors, ends its grants. Removing a permission takes effect on the connection's next request.
  • People list and revoke their own connections, and no one else's.

Accepted risks

  • An app, or a model following planted text in what it reads, can do anything the connection's scopes and the account's permissions allow, and can use the app's other tools to send what it has read elsewhere. The instructions Keen gives the model guide it but bind nothing. Approve only the scopes a task needs, and prefer apps that confirm each tool call.
  • Everything a tool returns reaches the app and its model provider, under that provider's terms.
  • A consent request's key travels in the page's query string, so it reaches the proxy's access log.
  • For 30 seconds after a refresh token is used, presenting it again is answered with the same tokens, so a client that retries is not cut off. A copier who presents each new token within 30 seconds of every refresh is not detected; one who refreshes on its own schedule is.
  • Grants do not follow identity-provider deprovisioning or a newly required MFA policy. They end when the Keen account is deactivated or the grant is revoked.
  • Listing a hosted assistant's callback trusts that service to bind each authorisation response to the session that started it.

Keen chat

Design notes: docs/security/mcp-and-chat.md.

Guarantees

  • Keen chat is off unless KEEN_CHAT_ENABLED is set, which also needs MCP, a model base URL and a model. It needs a signed-in session, CSRF proof on writes, and chat.use or the administrator role.
  • A conversation belongs to its owner. Every other account, an administrator included, receives 404 and cannot continue, approve in, upload to or delete it. Administrators read conversations only through read-only review routes. Each read is recorded in the audit trail, and people are told that administrators can read their conversations.
  • The model acts only through Keen's MCP tools, as the person, under the same scope narrowing, routes, write switch and allowances as any app. Each turn's token is never sent to the browser, is deleted when the turn ends, and is accepted only on Keen's own in-process chat transport. The model has no tool that sends a request anywhere else, and nothing it reads can add one.
  • Every call other than the reading tools waits for the person and is made once, only when they approve it, with exactly the arguments shown. A call with an argument its tool does not take, at any depth, is refused when it is proposed. On the approval card, every control, format and invisible character in an argument is shown as a visible escape.
  • Each id in a proposed change is shown with what it names, as Keen reads it. The change is bound to a digest of everything those labels stand for, stored whole: names unclipped, every holder of a role, and each account by id. The change is made only while that digest still holds and within a day of the proposal. A file a change stores is bound by name, size and SHA-256 digest.
  • A tool result or answer read with a scope the owner no longer holds is withheld from their view and from the model, and a pending change withheld this way cannot be approved.
  • Conversations are deleted a set time after their last message, and uploads after a day. An upload's bytes are never served back.
  • Each person's running turns, messages and model tokens are limited, each turn has a deadline, and requests to the model never hold the threads other requests use.

Best effort

  • Text kept from the person, the model, tools and file names has control characters and characters that draw as nothing removed, apart from those that emoji and joining scripts need. The rule is applied again to stored text whenever it is shown or sent to the model. This narrows hidden channels that a model could read and a reviewer could not see, but it cannot close every way a model reads meaning into text.
  • A label that another record of its kind reads the same as, once clipped, with case, accents and letters drawn alike set aside, says so. The record's id on the card, and the binding above, are what hold a change to one record.

Accepted risks

  • Records, evidence and files the model reads, and the model provider itself, can steer what the model reads and proposes. The control is the person's review of each card. A person who approves a steered change makes it.
  • Everything sent to the model, including tool results and uploaded text, reaches the configured model provider under its terms.
  • Administrators can read every conversation.

Outbound connections and collection

Design notes: docs/security/outbound-and-collection.md.

Guarantees

  • HTTPS connections always verify the certificate chain and hostname. No supported option disables this.
  • Built-in HTTP collectors check each destination address, pin connections to the checked addresses, refuse loopback, link-local and other prohibited address classes, and reach private networks only within KEEN_INGESTION_ALLOWED_CIDRS. They follow no redirects and use no ambient proxy, and each request has one deadline from connecting to its last byte. Custom API collectors also need an operator-managed host and port allowlist, and run no supplied code.
  • Credentials stay with their connection. A collector sends a credential only to the endpoints that connection names. Saved credentials cannot be read back, and changing where a connection sends them requires them to be supplied again. Request paths cannot step outside the connection's base path.
  • Integration credentials are encrypted at rest with KEEN_INTEGRATION_SECRET_KEY, and TOTP secrets with a key of their own, both kept outside the database.
  • MIDENA diagrams are fetched only from the configured origin with its token, rebuilt by an allowlist SVG sanitiser, and shown only as images.
  • Outbound notification webhooks use the same checked transport. Untrusted text in them cannot form labelled links or mentions, and links take their host from KEEN_PUBLIC_BASE_URL.
  • Scheduled HTTP collection runs on a queue and worker of its own, and IMAP on another, apart from internal jobs and mail. Every collection run ends within its time budget and keeps what it stored when it is stopped, and no worker task continues past its time limit.
  • IMAP collection uses implicit TLS only, never changes the mailbox, runs each poll in a resource-limited subprocess, bounds what it reads, and masks address headers whole.
  • Collector failures are reported with bounded, generic messages, without upstream response bodies.

Best effort

  • Redaction of secrets in collected evidence recognises secret key names and common formats. Arbitrary prose, unknown key names, secrets in URL paths and binary artifacts can still hold sensitive information.

Accepted risks

  • A hostile or compromised source can send false, misleading or incomplete evidence within its limits, fail on every run, or use its whole budget each time. Reviewers judge evidence, and administrators pause or remove a source that misbehaves.
  • Operator-configured SSO, SMTP and storage endpoints, AWS credential discovery through the platform's metadata service, and the deployment's own transports are separate trust boundaries that the operator manages.
  • Name resolution for an outbound request is bounded by the resolver's own timeouts rather than the request's deadline.
  • Queues separate worker capacity, not authority: every worker shares the deployment's database, storage and broker credentials.
  • Deployment operators can read process memory, environment secrets and encryption keys.

Availability and resource bounds

Design notes: docs/security/availability.md.

Guarantees

  • Request bodies are bounded before they are parsed, chunked bodies included. JSON is limited in size, depth and value count, and non-finite numbers are refused. A client that sends a request slowly holds no API worker.
  • Blocking database, storage and broker work runs outside the event loop that serves every request, and a contract test refuses code that does such work on the loop.
  • One unreadable or deeply nested collected record cannot stop a collection run: it is left out or stored as text and counted.
  • Every regular expression Keen runs passes a shape check that prevents exponential backtracking. Mapping-rule matches are time-limited for each match, and event filters run in PostgreSQL with statement time limits.
  • Event exports, volume charts and the Map are bounded in the rows and time they use.
  • Unauthenticated requests are recorded in the audit trail within a per-address allowance, and audit records are deleted after the configured retention.

Accepted risks

  • These controls limit what one request or one record can cost. They do not protect against sustained or distributed traffic. Connection limits, quotas, worker capacity, monitoring and network rate limiting belong to the deployment.
  • Keen does not rate-limit ordinary signed-in use, including counts and charts of events. Sustained load from a signed-in account is an operational matter for administrators, who can deactivate the account or set limits at the reverse proxy.
  • Keen does not claim complete protection against denial of service, dependency defects or every memory or resource leak.

Evidence storage and integrity

Design notes: docs/security/storage-and-supply-chain.md.

Guarantees

  • Artifacts carry recorded SHA-256 checksums. Each stored object has its own key, and local and hosted storage refuse to replace an existing object.
  • Objects written by a transaction that does not commit are deleted later by the retention worker, once no record references them.
  • Event views and evidence exports present only collected evidence artifacts. Files attached to comments stay with their comment threads, and files attached to incidents with their incidents.
  • Files attached to comments and incidents pass one set of checks, on count, size and whether each file's content matches its declared type, and every file of a request is checked before any is stored.

Accepted risks

  • Immutability and retention depend on the storage backend's permissions, versioning and retention settings. Someone who controls both the records and the storage can alter evidence and its recorded checksum.
  • An object can be left unreferenced if its process is killed after storing it, or if the database is unavailable when its transaction ends, until an operator removes it.

Images and build supply chain

Design notes: docs/security/storage-and-supply-chain.md.

Guarantees

  • Third-party images are pinned by multi-platform index digest in the Dockerfiles, Compose file and CI and release workflows. Third-party Actions are pinned by commit, and Python and npm dependencies follow their lock files.
  • Updates to image digests are proposed as pull requests and never merged without an approving review.
  • npm dependencies fetched from a git host are compared with a reviewed commit and tree digest before any of their code runs, and the build stops on any difference.

Accepted risks

  • An automated check cannot judge whether upstream content is trustworthy. A maintainer reviews each version change.
  • Distribution packages installed during image builds follow the distribution's signed repositories at build time.

Deployment responsibilities

Use HTTPS for browser, agent and credential-bearing traffic; configure KEEN_PUBLIC_BASE_URL, Secure cookies and trusted proxies correctly. The supplied settings enable Secure cookies, which only a plain-HTTP local test should turn off. Production cookies must be Secure and scoped to the installation's host. Keep unrelated or untrusted applications off the same origin, and avoid sharing session cookies across sibling domains.

The provided Compose port bindings are local to the host, and Compose refuses to start until POSTGRES_PASSWORD and KEEN_REDIS_PASSWORD are set. The example environment file ships every credential empty: an empty installation does not start without a bootstrap password that meets the rules for new passwords, and Keen refuses a placeholder as a bootstrap password or webhook secret. The supplied Compose file gives Valkey its password in a configuration file written inside the container as it starts, so the password stays out of process arguments, which every account on the Docker host can list. Keep PostgreSQL, Valkey, worker control interfaces and artifact storage inaccessible to untrusted clients. Use separate strong secrets, restrict upstream account permissions, preserve encryption keys securely, and test backup restoration.

Keep Keen, locked dependencies, container images, the TLS proxy and native tools maintained. Disable unused source types and authentication methods, restrict private-network egress, and monitor authentication failures, ingestion errors, disk use and resource pressure. Validate configuration changes with the documented test workflow and operational checks appropriate to the installation.

Diagnostic tracing

KEEN_SQL_TRACE and tools/keen-perf-trace.sh are diagnostics. While tracing, PostgreSQL logs every statement with its values, and statement comments and the service logs carry each request's method, path (with numeric and UUID segments replaced) and referring page path, without query strings. Trace only where that data may appear in the PostgreSQL and container logs, and delete captures once they have served their purpose.

Required security review checklist

Reviewers check these boundaries after every round of changes and before a release. A green suite establishes only the behaviours it exercises. Record each applicable check's evidence, untested prerequisites and remaining limitations in the review or delivery; do not mark an untested boundary as verified. Use synthetic credentials, local network fixtures and disposable databases. Review the final formatted tree and exercise the assembled application, including middleware, as well as injected administrator fixtures.

  • Timing and account-discovery oracles: compare existing, absent, inactive and externally authenticated accounts on login, recovery, linking and reauthentication paths. Check response bodies, status codes, lengths and expensive operations as well as timing. Require comparable password-derivation work on rejected local-login paths, constant-time secret comparison and bounded inputs. Rate limiting supplements these controls. Test the work performed deterministically; use repeated, interleaved measurements when claiming timing resistance. Network-backed identity providers have separate timing behaviour.
  • TLS identity and credential ordering: verify trusted matching certificates succeed and trusted wrong-name, untrusted and expired certificates fail for every transport, including LDAPS and StartTLS. Prove that credentials are never bound or sent before verification. Inspect the complete library verification path: a disabled SSLContext hostname flag can coexist with explicit library hostname validation. Keep dependency-version regression tests and test custom CA stores.
  • Inbound ingestion credentials: exercise every provider and connection type with absent, empty, incorrect and correct secrets, missing configuration, duplicate credential headers and legacy environment settings. No operator switch may turn a credential-bearing ingestion endpoint into anonymous ingestion. Preserve signature, replay, connection isolation, body-limit and rate-limit checks.
  • Validation and failure propagation: send wrong magic bytes, misleading MIME types, malformed uploads and hostile filenames through the HTTP boundary. Confirm a rejected attachment rejects the operation without committing its comment thread, post or incident file. Exercise read, storage and database failures; broad exception handlers must not turn them into partial success. Review orphaned-object cleanup separately from database rollback. Do not interpolate untrusted filenames or upstream diagnostics into logs.
  • Authorization inventory: compare every mutation's method and full route shape with middleware policy and adapter permissions. Exercise permitted non-admin users, users without the permission, other owners, inactive accounts and unauthenticated callers. Check adjacent paths, extra segments, wrong methods and encoded separators. Permission-owned exceptions remain authenticated and CSRF protected; new routes do not inherit public status.
  • Logout and CSRF: GET and other safe methods must not revoke sessions or mutate account state. Test intentional logout, cross-site GET/POST, missing and wrong CSRF tokens, expired sessions, pending MFA and provider logout. Check Origin against the configured public origin, including proxy deployments. Review cookie scope, sibling-domain cookie injection, duplicate cookies and whether double-submit tokens require session binding under the deployment's threat model. Never assume SameSite alone provides CSRF protection.
  • Proxy identities: require an explicitly trusted direct socket peer and exactly one identity header. Test untrusted peers, duplicate headers, client-supplied forwarding chains, absent headers and malformed addresses. Enforce the same boundary on every protocol Keen serves. Upstream proxies must strip client identity headers; forwarded client addresses do not establish proxy trust.
  • Resources, storage and previews: bound cache bytes and entry counts, masking buffers, downloads, uploads, parser work, decompression, render concurrency and response bodies. Test real byte counts independently of metadata. Close streams on success, rejection and cancellation. Match media types exactly after parsing parameters. Validate object keys before backend selection, and exercise both local and S3 storage. Keep storage locations and credentials out of presentation APIs. Check cache eviction and response delivery together for races.
  • Administrative lockout and concurrency: evaluate effective administrators after proposed group-role, membership, user-role and active-state changes. Cover multiple inherited administrators in one group, replacement with inactive or explicitly normal users, other surviving administrator groups, and concurrent operations. Verify transaction rollback and session/authorisation invalidation. A sequential lockout guard does not establish a concurrency guarantee.
  • MIDENA diagrams: a hostile MIDENA answer (scripts, event handlers, foreignObject, external links and styles in the drawing, oversized or malformed documents, wrong identifiers, unexpected shapes and statuses) is refused or rebuilt before storage, and its body never reaches an error; the token goes only to the configured origin; readers cannot search MIDENA or change what a document shows.
  • Outbound destination authority: review scheme, hostname, port, resolved addresses, redirects, DNS changes, proxy environment, timeouts and response limits independently. Distinguish app-managed integration destinations from operator-managed notification, SSO and storage destinations. Document any separate trust boundary and test its restrictions; a hostname allowlist alone does not constrain ports. Keep certificate checks enabled for all HTTPS paths and never log secret-bearing URLs.
  • Sessions, MFA and linking: exercise fixation, replay, concurrent refresh/revocation, stale permission snapshots, account deactivation/reactivation and pending-ceremony confusion. Check OIDC issuer, audience, nonce, algorithm, PKCE, single-use browser binding and verified-email linking. Test factor reauthentication and recovery-code reuse through the assembled app.
  • Personal results and small groups: check that each person's answers, scores and grades reach only that person, as the record's settings allow, and the people who manage the record; that aggregate views wait for their minimum group and leak no names or choices; and that reviews of answers close before the questions recur. Exercise concurrent submissions against closing and grading.
  • Keen chat: with a scripted hostile model and hostile files and records, check that every tool outside the reading list waits for approval and is made only as shown, once; that the model reaches only the MCP tools and the conversation's own uploads; that its answers render as text; that another account, an administrator included, receives 404 for every conversation route, while administrators' review routes are read-only, refuse everyone else and are audited; that the chat token never reaches the browser, outlives its turn or reaches a route outside INNER_ROUTES; and that body, upload, conversation and daily limits hold.
  • Class sweeps: for each confirmed issue, record the property it violates, the search that found every path sharing it, and the contract or budget test that enforces it across the codebase. A fix at the reported site alone leaves the class open.
  • Untrusted data and isolation: exercise SQL/configuration injection, stored and reflected XSS, unsafe links, CSV formulas, regex resource exhaustion and malicious upstream evidence. Trace credentials, caches, cursors, artifacts and redaction through two connections of the same provider. Check audit output, errors, logs and exports for leaks and preserve evidence identity and ownership.

The full validation workflow uses PostgreSQL and Valkey. Mocked transports and DOM tests are useful focused checks with a narrower reach: real-browser behaviour and resistance to sustained distributed attacks lie outside them. Treat missing coverage as an explicit review limitation that needs follow-up.

The required review procedure describes how a review establishes which surfaces and behaviours it has assessed, and what evidence it records.

Security claims and review records

The security-model sections describe current supported behaviour and realistic risks. Each security claim must identify its enforcing code or configuration and supporting test or other verification evidence in the review record. Where a supported configuration lacks evidence, record the gap and assess whether the claim needs qualification. Review requirements describe obligations; their presence does not assert that the required validation has been performed.

Keep findings, remediation history, per-review results, exceptions and release decisions in the corresponding review or delivery records. Do not turn this document into a cumulative list of fixes or describe an intended future control as current protection.

There aren't any published security advisories