Skip to main content

pawnlogic-security

Scope-gated security tooling for the PawnLogic agent host, distributed independently of the core package.

Installing this package does not authorize or enable it. The PawnLogic Extension stays disabled until an operator explicitly enables it, and its network tools remain unavailable until a valid Engagement Scope is active.

Status

The current public release is 0.1.0, published independently of the PawnLogic core package. It implements:

  • a versioned Engagement Scope file with exact hosts, CIDRs, exclusions, explicit ports, passive/active actions, expiry, and request, concurrency, and duration budgets
  • scope-gated passive DNS, TLS, HTTP-header, and technology reconnaissance
  • scope-gated bounded active port discovery
  • append-only redacted evidence records
  • two built-in, versioned workflows shared by pawn-security and /security
  • reproducible workflow plans and versioned local run records
  • an optional, default-disabled JSON child-process adapter with Operation Policy checks, bounded I/O, timeout cleanup, environment isolation, and output redaction

It does not implement HTTP replay, external scanner adapters, workflow YAML loading, CIDR expansion, exploit or destructive workflows, MCP execution, or an AI-generated planner. No built-in workflow invokes the optional child adapter.

Requirements

  • Python 3.10 or newer
  • pawnlogic>=0.3,<0.4

Install

Install the published package:

python -m pip install pawnlogic-security

For checkout development:

python -m pip install -e .

Nothing is loaded merely because the distribution is installed.

Enable in PawnLogic

/extension list
/extension enable security
/extension status security

The Extension contributes /security after enablement:

/security status
/security scope show
/security scope set <scope-file>
/security scope clear
/security plan <objective>
/security run <workflow>
/security evidence list
/security evidence export <run-id>

/security is an async host command and writes through the active PawnLogic output sink. Scope changes rebuild the complete contribution set atomically: the command remains present while security tools appear or disappear.

Disable the Extension with:

/extension disable security

Engagement Scope

Every operation requires an explicit, unexpired Engagement Scope. A minimal passive scope file looks like:

{
  "version": 1,
  "identifier": "authorized-review",
  "authorized_by": "security-team",
  "reference": "CHANGE-1234",
  "expires_at": 4102444800,
  "targets": ["app.example.com"],
  "exclude": [],
  "ports": ["443"],
  "allow_active": false,
  "actions": ["passive"],
  "destructive": false,
  "max_requests": 20,
  "max_concurrency": 1,
  "max_duration": 300,
  "evidence_dir": "evidence"
}

Active discovery additionally requires allow_active: true, the active action, and explicit ports, for example "ports": ["443", "8000-8010"]. Destructive authorization is rejected because destructive workflows are not implemented.

The passive example explicitly authorizes port 443 because TLS inspection and HTTPS header collection make network connections even though they do not send active probes.

Scope is necessary but never sufficient. The host Network Policy runs after scope validation and may still refuse the target. Resolved addresses and redirect changes must remain in scope. Model-provided tool arguments cannot grant authorization.

Workflows

The built-in workflow manifests have schema version 1 and their own workflow version:

  • passive-recon runs security_passive_recon
  • active-discovery runs security_active_discovery

Both direct and hosted commands call the same WorkflowRunner interface:

pawn-security scope validate <scope-file>
pawn-security run passive-recon --scope <scope-file>
/security run passive-recon

The runner sorts explicit host targets and runs one workflow target at a time. The execution adapters consume the engagement-wide request budget before individual network requests. The runner does not expand a CIDR into hosts. active-discovery additionally requires an active scope; port-scan concurrency remains bounded by the scope.

/security plan <objective> is deliberately conservative. It returns a deterministic suggestion to begin with passive-recon, reports that execution has not started, and performs no network work.

Evidence

When the active scope sets evidence_dir, tool observations and run records are written there. A relative evidence_dir is resolved from the directory containing the scope file. Without evidence_dir, they fall back to:

<runtime home>/security/evidence.jsonl

The direct command uses PAWNLOGIC_HOME when set, otherwise ~/.pawnlogic, for that fallback only.

Within the selected evidence directory, observations use evidence.jsonl and completed workflow records use canonical, schema-versioned JSON with restrictive permissions under:

<evidence directory>/runs/<run-id>.json

/security evidence list shows run summaries. /security evidence export <run-id> writes the selected canonical run record to the active output sink. Export accepts only a fixed-format run ID; it does not accept an output path and does not create an evidence archive.

Trust boundaries

  • No scope, an expired scope, an excluded or unmatched target, an unauthorized port, or an exhausted budget fails closed.
  • Active work requires explicit active authorization and ports.
  • Loopback, private, link-local, metadata, and credential-bearing targets are still governed by PawnLogic Network Policy.
  • The package does not silently download scanners, wordlists, browsers, containers, or system packages.
  • The optional child-process adapter is disabled by default. When explicitly configured by an integrator, it executes a literal argument vector without a shell only after the host Operation Policy allows it; current workflows do not call it.

Development

python -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/python -m pytest -q
.venv/bin/python -m ruff check .

License

MIT. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pawnlogic_security-0.1.0.tar.gz (58.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pawnlogic_security-0.1.0-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file pawnlogic_security-0.1.0.tar.gz.

File metadata

  • Download URL: pawnlogic_security-0.1.0.tar.gz
  • Upload date:
  • Size: 58.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pawnlogic_security-0.1.0.tar.gz
Algorithm Hash digest
SHA256 170b0cf3f1b4350271f00736623574df06ba9ff4f3ac9f03755065b41eb4069d
MD5 bbeb6eb632d6fbc2aa60a2cc6ef8337e
BLAKE2b-256 5574bd9269d768dc49d33d03872498c09d47463d4bb55d81c1a861fd38b0a458

See more details on using hashes here.

Provenance

The following attestation bundles were made for pawnlogic_security-0.1.0.tar.gz:

Publisher: release.yml on john0123412/pawnlogic-security

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pawnlogic_security-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pawnlogic_security-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 274430659f0b1b3994a6260e8e5fdfac390c8b29fdde2cbb5df22297f9895048
MD5 6e1d6b1d747276d3e2b3012b41e255a0
BLAKE2b-256 e39d7ccc63665b7198ccef9ea9f62f3a2481cab7a64f0401d164dcd13318ccdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pawnlogic_security-0.1.0-py3-none-any.whl:

Publisher: release.yml on john0123412/pawnlogic-security

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page