This directory contains the scenario test for alertchain. Scenario test can be done by play
command. The scenario test is a test that runs with alert
and action
policies and a scenario file as JSONNET format.
event
: Event data for scenario testguardduty.json
: GuardDuty event data
policy
: Policy data for scenario testalert.json
: Alert policy dataaction.json
: Action policy data
scenario
: Scenario data for scenario testscenario.jsonnet
: Scenario data in JSONNET format
results
: The respond data of each action.chatgpt.json
: The respond data of ChatGPT action
output/scenario1/data.json
: The output data of scenario test (that will be created after running the scenario test)test.rego
: Rego policy for testing the output data of scenario test
- Run the scenario test by
play
command# at root directory of the repository $ alertchain play \ -s ./examples/test/scenarios/scenario.jsonnet \ -d ./examples/test/policy \ -o ./examples/test/output
-s
: The path of the scenario file-d
: The path of the policy directory-o
: The path of the output directory
- Check the output data
$ cat examples/test/output/scenario1/data.json | jq
- Test the output data
$ opa test -v test.rego examples/test/output/scenario1/data.json