Test attestation Package
Conforma can verify test result attestations attached to images as in-toto statements. This package inspects the content of verified test-result predicates and produces violations for failed tests and warnings for warned tests. The package is a no-op when no test-result attestations are present.
Rules Included
No erred test attestations
Produce a violation if any test result attestation has an erred result. The result type is configurable by the "erred_test_attestation_results" key in the rule data.
Solution: A test attestation has an erred result, indicating an infrastructure or execution failure. Review the test attestation and re-run the test.
-
Rule type: FAILURE
-
FAILURE message:
Test attestation %q has an erred result -
Code:
test_attestation.no_erred_test_attestations
No failed informative test attestations
Produce a warning if any informative test attestation has a failed result. Informative tests produce warnings instead of violations, allowing teams to roll out new tests without blocking releases. The list of informative tests is configurable by the "informative_test_attestations" key, and the result type by the "failed_test_attestation_results" key in the rule data.
Solution: An informative test attestation has a failed result. While this does not block the release, review the test attestation output for details.
-
Rule type: WARNING
-
WARNING message:
Informative test attestation %q has a failed result, failures: %s -
Code:
test_attestation.no_failed_informative_test_attestations
No failed test attestations
Produce a violation if any non-informative test result attestation has a failed result. Failed test names from the attestation predicate are included in the message when available. The result type is configurable by the "failed_test_attestation_results" key, and the list of informative tests by the "informative_test_attestations" key in the rule data.
Solution: Ensure all test attestations have a passing result. Review the test attestation output for details.
-
Rule type: FAILURE
-
FAILURE message:
Test attestation %q has a failed result, failures: %s -
Code:
test_attestation.no_failed_tests
No skipped test attestations
Produce a violation if any test result attestation has a skipped result. A skipped result means a pre-requirement for executing the test was not met. The result type is configurable by the "skipped_test_attestation_results" key in the rule data.
Solution: A test attestation was skipped, indicating a missing prerequisite such as a scanner license. Ensure prerequisites are available and re-run the test.
-
Rule type: FAILURE
-
FAILURE message:
Test attestation %q has a skipped result -
Code:
test_attestation.no_skipped_test_attestations
No test attestation warnings
Produce a warning if any test result attestation has a warned result. Warned test names from the attestation predicate are included in the message when available. The result type is configurable by the "warned_test_attestation_results" key in the rule data.
Solution: Review the test attestation output for warning details.
-
Rule type: WARNING
-
WARNING message:
Test attestation %q has warnings, warnings: %s -
Code:
test_attestation.no_test_warnings
No unsupported test attestation result values
Ensure the result field of each test result attestation is a recognized value. Valid values are configurable by the "supported_test_attestation_results" key in the rule data. Defaults are PASSED, WARNED, FAILED, ERROR, and SKIPPED per the in-toto test-result predicate specification.
Solution: The test result attestation contains an unrecognized result value. Valid values are configurable via rule data.
-
Rule type: FAILURE
-
FAILURE message:
Test attestation %q has an unsupported result value %q -
Code:
test_attestation.test_result_known
Rule data provided
Confirm the expected rule data keys have been provided in the expected format. The keys are "supported_test_attestation_results", "failed_test_attestation_results", "erred_test_attestation_results", "skipped_test_attestation_results", "warned_test_attestation_results", and "informative_test_attestations".
Solution: If provided, ensure the rule data is in the expected format.
-
Rule type: FAILURE
-
FAILURE message:
%s -
Code:
test_attestation.rule_data_provided
Test attestation data includes result
Each test result attestation must include a result field in its predicate. Verify that the result field is present.
Solution: The test result attestation predicate must include a "result" field with a recognized value such as PASSED, WARNED, or FAILED.
-
Rule type: FAILURE
-
FAILURE message:
Test attestation %q is missing the required result field -
Code:
test_attestation.test_data_found
Test attestation subject matches image
Verify that each test-result attestation’s subject includes the digest of the image being evaluated. An attestation produced for a different image should not satisfy this image’s test requirements.
Solution: The test result attestation was produced for a different image than the one being evaluated. Ensure the test pipeline produces attestations with the correct subject digest.
-
Rule type: FAILURE
-
FAILURE message:
Test attestation %q subject does not match image digest %q -
Code:
test_attestation.subject_mismatch