openscap icon indicating copy to clipboard operation
openscap copied to clipboard

Add Service Probe for Windows

Open OSCAPC opened this issue 4 years ago • 6 comments

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, ...

OSCAPC avatar Aug 23 '21 12:08 OSCAPC

Can one of the admins verify this patch?

openscap-ci avatar Aug 23 '21 12:08 openscap-ci

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.

evgenyz avatar Sep 06 '21 13:09 evgenyz

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.

OSCAPC avatar Oct 05 '21 16:10 OSCAPC

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.

evgenyz avatar Oct 11 '21 13:10 evgenyz

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.

OSCAPC avatar Dec 02 '21 14:12 OSCAPC

@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?

marcusburghardt avatar Apr 07 '22 17:04 marcusburghardt

Closing due to the lack of activity.

evgenyz avatar Feb 09 '24 14:02 evgenyz