Synopsis
--show-input. Use jq '.input' to extract
the policy input from a --show-input --output json capture.
The policy must use package policy and define an allow rule.
An optional violations rule (a set of strings) can provide human-readable denial reasons.
By default a deny exits with code 1. Pass --no-assert to print the verdict
and exit 0 even on deny, when this command is feeding another tool as a
policy decision point.
When --input-file is omitted, JSON is read from stdin.
Use --params to pass configuration data to the policy as data.params.
This accepts inline JSON or a file reference (@file.json).
Flags
Flags inherited from parent commands
Live Examples in different CI systems
- GitHub
View an example of the
kosli evaluate input command in GitHub.In this YAML fileExamples Use Cases
These examples all assume that the flags--api-token, --org, --host, (and --flow, --trail when required), are set/provided.
capture trail data for local policy iteration
capture trail data for local policy iteration
then iterate on your policy locally
then iterate on your policy locally
evaluate and show the data passed to the policy
evaluate and show the data passed to the policy
read input from stdin
read input from stdin
evaluate with policy parameters (inline JSON)
evaluate with policy parameters (inline JSON)
evaluate with policy parameters from a file
evaluate with policy parameters from a file
evaluate using a policy fetched from a remote URL
evaluate using a policy fetched from a remote URL
evaluate as a decision point (print verdict, never fail the step)
evaluate as a decision point (print verdict, never fail the step)