Closed ekoops closed 1 week ago
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: ekoops, FedeDP
The full list of commands accepted by this bot can be found here.
The pull request process is described here
LGTM label has been added.
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area pkg
What this PR does / why we need it: This PR adds the
test
command, that allows to verify that Falco produces the expected alerts as a response to the executed tests. The command allows to connect to Falco via gRPC, through both Unix an AF_INET/AF_INET6 sockets. The underlying infrastructure has been modified as follows:<ignorePrefix><testUID>
. Each process in the chain but the one before the leaf passes the untouched test ID to the child. The one before the leaf passes the test ID without the<ignorePrefix>
to the leaf. In this way, the leaf process is the only one having the test ID equals to<testUID>
.The following components have been added:
A report is associated with a test (which in turn is associated to a single rule). It contains information regarding (1) the number of alerts successfully matching the expected outcome of the test, and (2) the generated warnings. A successful match is determined when Falco produces an alert whose fields are equal to the one provided in the expected outcome. A warning is associated to a single alert in the context of a rule report. A warning is generated if the alert matches the rule name but doesn't match other expected outcome's fields. In the context of a warning, for each expected outcome's field not matching the alert content, a field warning is generated in the report. If no successful matches and warning are generated during the alerts inspection time interval for a given test, the test is considered failed.
The warning have been added to take into account possible event drops and consequent
<NA>
values in Falco alerts.As last features:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: