[EPIC][module-options] Typed module options, datastore-style layering, validation, and operation scoping #195

Open
opened 2026-09-05 08:07:21 +00:00 by nsaspy · 0 comments
Owner

Parent: #192

Mission

Give native Hackmode modules a typed configuration model that provides the useful ergonomics of a Metasploit-style datastore without introducing a second global mutable state store.

Configuration layers

Resolve module options deterministically from explicit layers such as:

module schema/defaults
        ↓
operator/profile defaults
        ↓
operation-scoped values
        ↓
module-instance values
        ↓
run-local overrides

The final effective configuration is frozen/recorded with the run for audit/replay.

Option schema

Support typed fields including:

  • string / enum / integer / boolean;
  • hostname/domain/IP/URL/service references;
  • canonical Hackmode asset references;
  • paths/artifact references where explicitly allowed;
  • credentials/secrets by opaque reference rather than accidental plaintext persistence;
  • lists/sets/ranges represented as typed values;
  • required/optional/default/derived values;
  • validation constraints;
  • sensitivity/redaction metadata;
  • applicability/conditional requirements.

Avoid ad-hoc stringly-typed option bags as the canonical representation.

Operation/workspace mapping

The Metasploit "workspace" concept maps to the canonical Hackmode operation. Module configuration must never create or infer a second target scope.

Operation-scoped defaults may reference the selected operation's assets/scope, but effectful values still pass authority/scope validation at run time.

Secrets

Secret-bearing options must support opaque secret references or backend resolution. Do not leak resolved secret values into module metadata, traces, LISH history or Tek9 evidence unless explicitly required and safely redacted.

UX/API

Expose typed APIs sufficient for LISH/Emacs to:

  • show options;
  • show effective/default/current value source;
  • set/unset instance values;
  • validate before run;
  • explain missing/invalid/blocked values;
  • show redacted sensitive fields;
  • clone/reset a module instance configuration.

Acceptance

  • canonical typed module option schema exists;
  • layer precedence is deterministic and documented;
  • final effective run config is immutable/auditable;
  • invalid or missing required options block dispatch with structured errors;
  • operation scope remains authoritative over target-like values;
  • sensitive values support redaction/opaque references;
  • LISH can show defaults, overrides and their source without reparsing prose;
  • module instances can be reset/cloned without mutating global descriptors;
  • deterministic tests cover precedence, validation, conditional requirements, redaction and replay;
  • Hackpert/Prolog-RLM can consume schema/allowed values as typed metadata without receiving resolved secrets by default.

Non-goals

  • No second persistent module database.
  • No ambient global RHOST/RPORT-style variables that silently cross operations.
  • No option value may widen operation scope or authority.

First slice

Implement typed defaults + instance override + operation-scoped value + validation for one harmless fixture module, then expose the effective config and source-of-value information to a test/LISH-facing API.

Parent: #192 ## Mission Give native Hackmode modules a typed configuration model that provides the useful ergonomics of a Metasploit-style datastore without introducing a second global mutable state store. ## Configuration layers Resolve module options deterministically from explicit layers such as: ```text module schema/defaults ↓ operator/profile defaults ↓ operation-scoped values ↓ module-instance values ↓ run-local overrides ``` The final effective configuration is frozen/recorded with the run for audit/replay. ## Option schema Support typed fields including: - string / enum / integer / boolean; - hostname/domain/IP/URL/service references; - canonical Hackmode asset references; - paths/artifact references where explicitly allowed; - credentials/secrets by opaque reference rather than accidental plaintext persistence; - lists/sets/ranges represented as typed values; - required/optional/default/derived values; - validation constraints; - sensitivity/redaction metadata; - applicability/conditional requirements. Avoid ad-hoc stringly-typed option bags as the canonical representation. ## Operation/workspace mapping The Metasploit "workspace" concept maps to the canonical Hackmode **operation**. Module configuration must never create or infer a second target scope. Operation-scoped defaults may reference the selected operation's assets/scope, but effectful values still pass authority/scope validation at run time. ## Secrets Secret-bearing options must support opaque secret references or backend resolution. Do not leak resolved secret values into module metadata, traces, LISH history or Tek9 evidence unless explicitly required and safely redacted. ## UX/API Expose typed APIs sufficient for LISH/Emacs to: - show options; - show effective/default/current value source; - set/unset instance values; - validate before run; - explain missing/invalid/blocked values; - show redacted sensitive fields; - clone/reset a module instance configuration. ## Acceptance - [ ] canonical typed module option schema exists; - [ ] layer precedence is deterministic and documented; - [ ] final effective run config is immutable/auditable; - [ ] invalid or missing required options block dispatch with structured errors; - [ ] operation scope remains authoritative over target-like values; - [ ] sensitive values support redaction/opaque references; - [ ] LISH can show defaults, overrides and their source without reparsing prose; - [ ] module instances can be reset/cloned without mutating global descriptors; - [ ] deterministic tests cover precedence, validation, conditional requirements, redaction and replay; - [ ] Hackpert/Prolog-RLM can consume schema/allowed values as typed metadata without receiving resolved secrets by default. ## Non-goals - No second persistent module database. - No ambient global RHOST/RPORT-style variables that silently cross operations. - No option value may widen operation scope or authority. ## First slice Implement typed defaults + instance override + operation-scoped value + validation for one harmless fixture module, then expose the effective config and source-of-value information to a test/LISH-facing API.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/hackmode#195
No description provided.