-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[CSPM] Add support for XCCDF benchmarks #15537
Conversation
533f5bc
to
f110a46
Compare
d510083
to
e287995
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small suggestion
ed31b76
to
102b219
Compare
6937e1e
to
12b27e4
Compare
d351708
to
a68ca04
Compare
b48e453
to
de15e83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 the PR mostly looks good, I left couple points inline to address/talk about. In addition, we need to add the ship_source_offer true
line to all the new GPL/LGPL software.
patch source: "disable_systemd.patch", env: env | ||
patch source: "cmake-bindir.patch", env: env | ||
|
||
if (!File.exist? '/usr/bin/triehash') && (!File.exist? '/usr/local/bin/triehash') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the triehash
file something that we should add to our buildimages longer term? Again, this is not something I see as a blocker, but it looks like a build dependency that won't change (often) and could live there - it's not part of the distributed agent, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
triehash
is a build time dependency for building APT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, so eventually it would be great to move it to buildimages, rather than have it in this repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question was raised at some point, but I finally preferred to install triehash
as part of the apt build, since it's only used to build apt. My feeling was that the build images had a more general purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reopened the PR with only the triehash relevant bits : DataDog/datadog-agent-buildimages#378
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening the PR! Because we're a bit short on time, I'll approve this PR with triehash file included and ask you to, later on, upgrade the buildimages and remove the file from here in a followup PR.
e013b3a
to
8b80ad0
Compare
a2236d8
to
61f7b31
Compare
12679c4
to
173ec29
Compare
173ec29
to
989fb4d
Compare
Bloop Bleep... Dogbot HereRegression Detector ResultsRun ID: 348b99dc-ceaf-418d-bd8a-387a7fca4d83 ExplanationA regression test is an integrated performance test for The table below, if present, lists those experiments that have experienced a statistically significant change in mean optimization goal performance between baseline and comparison SHAs with 90.00% confidence OR have been detected as newly erratic. Negative values mean that baseline is faster, positive comparison. Results that do not exhibit more than a ±5.00% change in their mean optimization goal are discarded. An experiment is erratic if its coefficient of variation is greater than 0.1. The abbreviated table will be omitted if no interesting change is observed. No interesting changes in experiment optimization goals with confidence ≥ 90.00% and |Δ mean %| ≥ 5.00%. Fine details of change detection per experiment.
|
3366def
to
76a6746
Compare
76a6746
to
8ab82b8
Compare
OpenSCSAP is an implementation of the SCAP standards. It provides tools and libraries to handle SCAP documents. This change adds the following software definitions: - apt - attr - elfutils - file - glib - gmp - gnutls - libacl - libdb - libgcrypt - libgpg-error - liblz4 - libselinux - libsepol - libtasn1 - libxxhash - lua - m4 - nettle - openscap - pcre2 - popt - rpm - sqlite - util-linux - xmlsec - zstd Some patches were required: - apt/cmake-bindir.patch: allow to update BIN_DIR CMake CACHE entry - apt/disable_arch_check.patch: disable architecture check - apt/disable_systemd.patch: remove dependency on udev and systemd - apt/no_doc.patch: don't install documentation - apt/triehash.patch: add the triehash tool, needed at build time - libselinux/fcntl_o_path.patch: fix build with old glibc - libselinux/ln_no_relative.patch: don't use relative symlink on installed libraries - libsepol/ln_no_relative.patch: don't use relative symlink on installed libraries - lua/nodoc.patch: don't install documentation - nettle/install_to_lib.patch: omit lib directory suffix - rpm/0001-Include-fcntl.patch: fix build OpenSCAP includes a number of fixes, backported from maint-1.3 branch and also some fixes which are currently being reviewed. We added -I. before -I#{install_dir}/embedded/include in CGO_CFLAGS, so the Go zstd package use its own zstd.h instead of using the one provided by the newly added zstd software. This change is the result of a collaborative work between Sylvain Baubeau, Pierre Guilleminot and David du Colombier. Co-authored-by: Sylvain Baubeau <[email protected]> Co-authored-by: Pierre Guilleminot <[email protected]>
This change adds support for XCCDF benchmarks in the pkg/compliance package. XCCDF is an XML format specifying security benchmarks, which is part of the SCAP standards. The XCCDF support relies on the OpenSCAP library, which is provided as part of a previous change. The XCCDF files should be located into the compliance directory, specified by the "compliance_config.dir" configuration option. Support of XCCDF benchmark is disabled by default, and can be enabled by setting the new "compliance_config.xccdf.enabled" configuration option. This change is the result of a collaborative work between Sylvain Baubeau, Pierre Guilleminot and David du Colombier. Co-authored-by: Pierre Guilleminot <[email protected]> Co-authored-by: David du Colombier <[email protected]>
This change removes the implementation of XCCDF which relies on the OpenSCAP library. Instead we use xccdf_no_cgo.go, which relies on the OpenSCAP tool. This prevents the Agent to link with OpenSCAP and its dependencies.
8ab82b8
to
40d433c
Compare
The
Which seems to be related to PR #16220. |
What does this PR do?
This change adds support for XCCDF benchmarks in the pkg/compliance package.
XCCDF is an XML format specifying security benchmarks, which is part of the SCAP standards.
The XCCDF support relies on the OpenSCAP library.
Motivation
The goal was to implement support of CIS benchmarks for Linux operating systems into the Datadog Agent.
Instead of writing the checks ourselves, we chose to rely on the automated checks available as part of the ComplianceAsCode project. The checks are written in SCAP format and can be executed with the OpenSCAP library and tools.
Additional Notes
Possible Drawbacks / Trade-offs
The major drawback of including the OpenSCAP library is that it requires its own set of dependencies, adding 25 new software definitions to omnibus.
However, we tried to limit the size of the new dependencies, by removing the unnecessary files from the Agent installation, like documentation and static libraries. The total size of the newly installed shared libraries approximates 20 MB.
Describe how to test/QA your changes
Build for RHEL:
Or build for Ubuntu:
Run RHEL 7, 8 or 9:
Or run Ubuntu 20.04 or 22.04:
Remove the
/.dockerenv
file, so OpenSCAP doesn't know it's running in a container:Install curl (on RHEL):
Or install curl (on Ubuntu):
Install CSPM rules:
Configure datadog-agent:
Run the compliance checks from the
security-agent
, on docker:Run the compliance checks from the
security-agent
, on the host's operating system:Go to the CSPM web page and verify that you can see the check results.
Reviewer's Checklist
Triage
milestone is set.major_change
label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.changelog/no-changelog
label has been applied.qa/skip-qa
label is not applied.team/..
label has been applied, indicating the team(s) that should QA this change.need-change/operator
andneed-change/helm
labels have been applied.k8s/<min-version>
label, indicating the lowest Kubernetes version compatible with this feature.