Skip to content

chore(security): add draft threat model and SECURITY.md for security-model discoverability#3509

Open
potiuk wants to merge 1 commit into
apache:unstablefrom
potiuk:asf-security/threat-model-2026-05-31
Open

chore(security): add draft threat model and SECURITY.md for security-model discoverability#3509
potiuk wants to merge 1 commit into
apache:unstablefrom
potiuk:asf-security/threat-model-2026-05-31

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented May 31, 2026

This is a draft proposal for the Kvrocks PMC to review — please correct, reject, or discuss as needed. Nothing here is a requirement; the maintainers are the decision-makers, and this document describes Kvrocks as the PMC says it is.

This PR adds THREAT_MODEL.md + SECURITY.md and a Security section in AGENTS.md, so an automated scan agent can mechanically find the model via AGENTS.md → SECURITY.md → THREAT_MODEL.md.

It is draft-first and mostly inferred (~16 documented / 0 maintainer / ~50 inferred). Every *(inferred)* claim routes to a numbered question in §14 Open questions — the fastest review is to walk §14 (three short waves) and answer in-thread; we then promote the tags to *(maintainer)*.

The wave-1 rulings are load-bearing:

  • Is running without requirepass (the default) a supported posture relying on bind/network controls, or must operators set it before exposing the port — i.e. is an unauthenticated-access report BY-DESIGN or VALID?
  • Same for TLS-off on an untrusted network — operator responsibility or a claimed gap?
  • Are replication / cluster peers trusted (out of the adversary model) or should a malicious peer be in scope?

apache/kvrocks-controller is in scope for the scan too; per §14 q10 it will get its own model (its trust surface — the cluster control plane — differs), which we'll open as a separate PR.

Context: the ASF Security team is preparing the project for an automated agentic security scan we're piloting; a complete, discoverable threat model keeps that scan's output signal-rich. We drafted this via the threat-model-producer rubric. If you'd rather author it yourselves, close this PR and we'll regroup.

…ecurity-model discoverability

Adds a draft (v0) project threat model plus a SECURITY.md, and links both from
AGENTS.md so an automated scan agent can mechanically discover the model via
AGENTS.md -> SECURITY.md -> THREAT_MODEL.md. The threat model is a proposal for
the PMC to review; most claims are (inferred) and route to open questions in
its section 14.

Generated-by: Claude Code (Claude Opus 4.8)
@jihuayu jihuayu requested review from PragmaTwice and git-hulk May 31, 2026 01:45
Comment thread THREAT_MODEL.md
Comment on lines +289 to +293
1. Is running **without `requirepass`** a supported production posture (relying on `bind`/network controls),
or must operators set it before exposing the port — i.e. is an unauth-access report `BY-DESIGN` or `VALID`?
*Proposed:* operator must set it before non-localhost exposure; default no-auth is dev-only.
2. Same question for **TLS-off** on an untrusted network — operator responsibility (§10) or a claimed gap?
*Proposed:* operator responsibility; plaintext is documented and opt-out.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If requirepass is not set, operators are responsible for restricting access to trusted personnel only. The same applies to TLS.

Comment thread THREAT_MODEL.md
Comment on lines +294 to +295
3. Are **replication / cluster peers trusted** (out of §7) or should a malicious peer holding valid topology
credentials be in the adversary model? *Proposed:* peers trusted; out of scope.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peers should be trusted.

Comment thread THREAT_MODEL.md
Comment on lines +304 to +305
6. Is **RocksDB data-at-rest** considered out of model for confidentiality (operator-trusted disk), i.e. no
per-namespace encryption is claimed? *Proposed:* yes, at-rest is operator's domain.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, no per-namespace encryption is claimed.

Comment thread THREAT_MODEL.md
Comment on lines +301 to +303
5. May **non-admin (namespace) clients run `EVAL`/`FUNCTION`**, and what is the Lua sandbox's scope — is host
I/O denied and is a script confined to its caller's namespace? *Proposed:* scripting confined to namespace;
no host access; `luajit_bytecode_dos` already treated as a bug.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripting confined to namespace; no host access.

Comment thread THREAT_MODEL.md
Comment on lines +298 to +300
4. How is **namespace isolation** enforced at the command layer, and which commands (if any) can observe data
or metadata across namespaces (e.g. `INFO`, `CLIENT`, keyspace scans, `__namespace`)? *Proposed:* strict
per-namespace keyspace confinement; admin-only metadata.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strict per-namespace keyspace confinement; admin-only metadata. Known limit: pub/sub doesn't respect namespaces currently.

Comment thread THREAT_MODEL.md
Comment on lines +311 to +312
8. Is `AUTH` **throttled / constant-time**, and is brute-force of the token in the model? *Proposed:* network
controls expected; constant-time compare desirable — confirm.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

network controls expected; constant-time compare desirable.

Comment thread THREAT_MODEL.md
Comment on lines +308 to +310
7. Where is the **resource line** (§8.6)? Are super-linear commands / Lua run-time / deep pipelines bugs, or
is the only contract "configure `maxclients` and size limits"? *Proposed:* no intrinsic guarantee beyond
configured limits, except sandbox-DoS which is a bug.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no intrinsic guarantee beyond configured limits.

@PragmaTwice PragmaTwice changed the title Add draft threat model + SECURITY.md + AGENTS.md link for security-model discoverability chore(security): add draft threat model and SECURITY.md for security-model discoverability May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants