diff --git a/docs/tutorials/developer-guide/checks.md b/docs/tutorials/developer-guide/checks.md index bac0181b..cbd14768 100644 --- a/docs/tutorials/developer-guide/checks.md +++ b/docs/tutorials/developer-guide/checks.md @@ -95,7 +95,19 @@ class ec2_ami_public(Check): return findings ``` -All checks must fill the `report.resource_id` and `report.resource_arn` with the following criteria: +### Check Status + +All the checks MUST fill the `report.status` and `report.status_extended` with the following criteria: + +- Status -- `report.status` + - `PASS` --> If the check is passing against the configured value. + - `FAIL` --> If the check is passing against the configured value. + - `INFO` --> This value cannot be used unless a manual operation is required in order to determine if the `report.status` is whether `PASS` or `FAIL`. +- Status Extended -- `report.status_extended` + - MUST end in a dot `.` + - MUST include the service audited with the resource and a brief explanation of the result generated, e.g.: `EC2 AMI ami-0123456789 is not public.` +### Resource ID, Name and ARN +All the hecks must fill the `report.resource_id` and `report.resource_arn` with the following criteria: - AWS - Resource ID -- `report.resource_id` diff --git a/docs/tutorials/developer-guide/unit-testing.md b/docs/tutorials/developer-guide/unit-testing.md index 0728011f..1933d18c 100644 --- a/docs/tutorials/developer-guide/unit-testing.md +++ b/docs/tutorials/developer-guide/unit-testing.md @@ -59,10 +59,13 @@ To run the Prowler test suite you need to install the testing dependencies alrea Then in the project's root path execute `pytest -n auto -vvv -s -x` or use the `Makefile` with `make test`. Other commands to run tests: + - Run tests for a provider: `pytest -n auto -vvv -s -x tests/providers//services` - Run tests for a provider service: `pytest -n auto -vvv -s -x tests/providers//services/` - Run tests for a provider check: `pytest -n auto -vvv -s -x tests/providers//services//` +> Refer to the [pytest documentation](https://docs.pytest.org/en/7.1.x/getting-started.html) documentation for more information. + ## AWS For the AWS provider we have ways to test a Prowler check based on the following criteria: