Expand description
Runtime security policy types.
Defines CommandPolicy and UrlPolicy – the runtime
representations of command execution and URL safety policies.
These are constructed from the config-level [CommandPolicyConfig]
and [UrlPolicyConfig] at startup time.
CommandPolicy::validate provides the standard command validation
logic (allowlist/denylist + dangerous pattern checks). Full URL/SSRF
validation lives in clawft-tools::url_safety which depends on
external crates (url, ipnet).
Structs§
- Command
Policy - Configurable command execution policy (runtime representation).
- UrlPolicy
- Runtime URL safety policy for SSRF protection.
Enums§
- Command
Policy Error - Errors returned when a command fails policy validation.
- Policy
Mode - Whether the command policy operates in allowlist or denylist mode.
Constants§
- DEFAULT_
COMMAND_ ALLOWLIST - The default set of safe executable basenames for allowlist mode.
- DEFAULT_
DANGEROUS_ PATTERNS - The default set of dangerous patterns.
Functions§
- extract_
first_ token - Extract the first whitespace-delimited token from a command string, stripping any leading path components (basename extraction).
- split_
shell_ commands - Split a command string on shell compound operators (
&&,||,;,|).