-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rethink matrix-based hardening testing #89
Comments
Hardening tests (files) could be all inside
TMT/FMF would see just one "test", that being: Results would be reported directly under that, ie.
Not sure whether all matrix combinations should be encoded in the name, the note, or additional TMT metadata fields, but it needs to be somehow possible and easy to distinguish ie. bare metal oscap hardening test results from ansible VM hardening results. Waivers could fortunately use extra python variables, opening up possibilities like # applies to all hardening methods
/hardening/pci-dss/some_rule_name
True
# only Ansible, no matter if host-os, VM or elsewhere
/hardening/ospp/setup_fips_enabled
remediation == 'ansible'
# fails on UEFI on bare metal, but not in VMs
/hardening/ospp/some_grub2_thing
machine == 'bare' and boot == 'uefi' and arch == 'x86_64' # not on ppc64le UEFI Test execution itself would be done via documented env variables,
and the defaults, or the "just run all tests" version would be done via TMT plans, which would pre-configure a test set according to some matrix combinations (see first post here), so productization and similar testing could just
without enumerating the env variables. We could use it manually like that too, with So I guess the biggest hurdle is representing results in some meaningful way in HTML reports and on the console, because
is just not descriptive enough, and if we were to extend it to include ie.
then getting rid of the extra info when writing waiver rules would be too arbitrary (apply only to hardening tests) and if we don't remove it, we'd have to write |
I guess one way of reducing
would be to consider all possible combinations of each dimension for the current run, and if one dimension never changes, just don't include it in the result name. For example, if all tests in a single run ( This way, the result test names would only contain dimensions relevant to that run (dimensions which have at least 2 possible values). Waiver rules and their python code would use some concept of "dimensions", python objects that support attribute access - the point is to not use strings (which may have typos), so ie. # fails on UEFI on bare metal, but not in VMs
/hardening/ospp/some_grub2_thing
status.error and machine.bare and boot.uefi and arch.x86_64 # not on ppc64le UEFI would trigger an error if a user wrote I imagine these could also support key ( |
We have a lot of combinations to test, consider these axes:
That creates a huge amount of combinations / tests to run.
Consider not just specifying per-profile tests for each test type, but parametrize everything externally, ie. via a TMT plan. Because some axes (uefi) will be just an env variable for library code, with no test change needed. It would be therefore nice to treat profiles the same way.
Ie.
These matrix combinations could be handled externally (by
runcontest2
) and/or via TMT plans. We could even have TMT plan good-enough defaults with some minimal test sets, and doruncontest2
to run everything.By "run everything", I mean to run smart combinations of variables to give us beneficial results (Orthogonal Arrays), not
a*b*c*d...
"everything".Ie. from
we effectively test everything with everything else, with 4 instead of 9 combinations.
The text was updated successfully, but these errors were encountered: