Skip to content

feat: describe controls and explain model properties - #370

Open
0x5t4l1n wants to merge 2 commits into
OWASP:masterfrom
0x5t4l1n:docs/describe-threat-condition-properties
Open

0x5t4l1n wants to merge 2 commits into
OWASP:masterfrom
0x5t4l1n:docs/describe-threat-condition-properties

Conversation

@0x5t4l1n

@0x5t4l1n 0x5t4l1n commented Oct 16, 2026 •

Copy link
Copy Markdown

Model properties used in threat conditions are hard to discover, and --describe Controls previously failed. Add Controls to the existing description registry so the command lists control fields, their descriptions, and defaults using the same mechanism as element classes.

Move the six control definitions covered by the guide into their Pydantic field descriptions: checksInputBounds, validatesInput, sanitizesInput, usesStrongSessionIdentifiers, authenticatesSource, and authorizesSource. Keep the guide focused on how properties drive findings, a runnable example, and how sourceFiles is used by --stale. Link to --describe Controls from the README and guide.

Validation:

  • Full suite on Linux (Python 3.14): pytest -q — 254 passed.
  • CLI regression coverage for Controls, combined Server Controls, and unknown class errors.
  • Manually checked python tm.py --describe Controls on Windows (Python 3.11).
  • Black check for the changed model and new tests; git diff --check passed.
  • Windows full suite: 250 passed, with four diagram fixture failures caused by Windows/Linux path separators.

Closes #28.

@0x5t4l1n
0x5t4l1n requested a review from izar as a code owner October 16, 2026 23:35
@izar

izar commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

I like the idea of a file explaining the properties and threats mechanism, as it will make it easier for LLMs to work with pytm, but I question having Controls explained there rather than added to the current --describe mechanism.

@izar izar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add Controls description to the existing mechanism.

@0x5t4l1n
0x5t4l1n requested a review from colesmj as a code owner November 1, 2026 12:52
@0x5t4l1n 0x5t4l1n changed the title docs: explain model properties used by threat conditions feat: describe controls and explain model properties Nov 1, 2026
@0x5t4l1n

0x5t4l1n commented Nov 1, 2026

Copy link
Copy Markdown
Author

Added Controls to the existing --describe mechanism in c2ba4af and moved the guide's six control definitions into their field descriptions. Updated the docs and added CLI regression tests. All 254 tests pass on Linux.

This branch has not been deployed

No deployments
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.

Missing documentation for conditions

2 participants