Skip to contents

list_rules() returns a compact inventory of a policy's rule set. It is intended for audits, examples, tests, and pre-deployment reviews.

Usage

list_rules(policy)

Arguments

policy

A shieldr_policy or built-in policy name such as "comprehensive".

Value

A data frame with columns id, owasp, severity, action, has_pattern, and has_fn.

Details

The has_pattern and has_fn columns identify whether each rule is regex based or function based. Regex rules can produce redaction spans directly. Function rules may produce findings without spans unless the function returns span metadata.

Examples

list_rules(policy("custom"))
#> [1] id          owasp       severity    action      has_pattern has_fn     
#> <0 rows> (or 0-length row.names)