openscap
openscap copied to clipboard
Add Service Probe for Windows
Creation of a new probe for OVAL service_test for Windows systems. The probe use Windows API to reach services information.
Configuration used :
- Dev OS : Windows 10 Pro 21H1
- Tested OS : Windows 10 Pro 21H1
I can provide an OVAL test file for this probe. What is the best manner to do it ? gist, pull request, ...
Can one of the admins verify this patch?
Would you be interested in creating a CTest-based test suite (for probes) for Windows? You can get some inspiration from existing *NIX test suite, but I doubt it would be sensible to try and make it portable.
I'm not talking about anything fancy here, just basic smoke test against a simple OVAL/XCCDF/DS file to make sure that the probe behaves properly.
Hi, I never created CTest-based test suite. Have you got some example for Windows ? If you got some, I can try to create one for the probe, else, I'll need more explanation on how CTest-based test suite works.
CTest is part of CMake and it is really simple (https://gitlab.kitware.com/cmake/community/-/wikis/doc/ctest/Testing-With-CTest).
We have the implementation for *NIX OSes (tests subdir), the initialization is here: https://github.com/OpenSCAP/openscap/blob/2f27ffca9e042ed4399bcf3c618b48004993ab48/CMakeLists.txt#L332
It is turned off for Windows because the whole test suite is based on Linux-specific tools and commands. And I would not ask anyone to make it portable or recreate using Windows' tools. It is OK that platform-independent code is checked only on Linux (better to check everywhere, but the effort is too big).
But! It is important to be able to test Windows-only things, like Windows probes. I'm pretty much OK with merging your two PRs as they are, because they won't affect Linux version in any way. But you would be the one who will suffer when somebody would accidentally ruin these probes without knowing it.
I'm sorry to answer this late, I can't work on the project anymore. You can use my work as you wish. Thank you for your time.
@evgenyz and @jan-cerny , assuming the tests were not created and the author can't work on it anymore, would you agree to close this PR and the other, also related?
Closing due to the lack of activity.