Add CIS Level 1 profiles for Ubuntu 26.04 - #15097
Conversation
Scope missing_parameter_pass on sshd_disable_empty_passwords to ubuntu2604 so the STIG-mapped presence requirement is preserved on other products. Add ubuntu2604 OVAL overrides for sshd_set_keepalive and sshd_use_strong_kex, and a cis_ubuntu2604 option to sshd_strong_kex.var.
|
Hi @realstuffie. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
The Acquire::* remediations only removed the option from the file they write, so a conflicting value in /etc/apt/apt.conf or another apt.conf.d file survived. The checks use none_exist across all APT configuration files, so the rules stayed non-compliant after remediation. Strip the option from every APT configuration file before writing the compliant value. Unrelated settings are preserved and the scripts remain idempotent.
47 scenarios covering the 13 new rules. The APT scenarios exercise quoted and unquoted values, case variants, commented settings, deb-src entries, options blocks such as [signed-by=...], and deb822 URIs lines carrying more than one URI. service_update-notifier-motd_disabled ships only a pass scenario. The unit is a static oneshot, so it is never enabled and never lingers active, and the check reports the same result whether or not it has been masked. Recorded in the rule's warnings block.
|
Pushed two more commits. Added test scenarios for all 13 new rules (47 scenarios). Writing them surfaced a
|
Description:
Adds
cis_level1_serverandcis_level1_workstationfor Ubuntu 26.04, driven by a new control file atproducts/ubuntu2604/controls/cis_ubuntu2604.ymlwith 274 controls (274 l1_server, 266 l1_workstation, 7 l2_workstation).Adds 15 rules the benchmark needs that were not in the tree yet: four
Acquire::*APT settings (AllowInsecureRepositories,AllowWeakRepositories,AllowDowngradeToInsecureRepositories,Check-Date), HTTPS enforcement forsources.listandsources.list.d, the update-notifier-motd service and timer,pam_motd_configured,file_permissions_pam_motd,package_cracklib-runtime_installed, and threeaccounts_user_dot_dirs_*rules.Adds ubuntu2604 OVAL overrides for
chronyd_specify_remote_server,sshd_set_keepaliveandsshd_use_strong_kex, plus acis_ubuntu2604option onsshd_strong_kex.var.This covers Level 1 only. I left the L2 controls out but kept the l2 level definitions so they can be filled in later.
Rationale:
Ubuntu 26.04 already exists as a product here but has no CIS profiles. USG builds its benchmarks from a ComplianceAsCode tag named in
tools/release_metadata/, so the content has to land here first.Profile titles keep a
DRAFT -prefix until someone has checked them against the published benchmark independently.Review Hints:
Commit 1 is the port and stands on its own. Commit 2 only touches sshd and can be reviewed separately.
What I checked before opening this. The build passes with OVAL schematron and SCAP validation on.
utils/controleval.pyreports 100% assessed for both levels. A live scan ofcis_level1_workstationon Ubuntu 26.04 evaluated 441 rules with no error, unknown or notchecked results (250 pass, 144 fail, 30 notapplicable, 17 notselected). yamllint run the wayci_lint.ymlruns it, with Jinja stripped, and shellcheck at-s bash -S warning, are both clean on every changed file.Four things I know are unresolved:
chronyd_specify_remote_serverdrops thevar_multiple_time_servershostname check thatubuntu.xmldoes. The control file still sets the variable.sshd_set_keepaliveandsshd_use_strong_kexoverrides ignorevar_sshd_set_keepaliveandsshd_strong_kex, which the control file also sets.tests/test_config.ymlforsshd_disable_empty_passwordsusesdeny_templated_scenarios. That file is read throughssg.yaml.open_rawwith no Jinja, so I cannot scope it per product, and it drops one negative scenario on every other product. The cleaner fix is to makeline_not_there.fail.shinshared/templates/sshd_lineinfile/tests/conditional onMISSING_PARAMETER_PASSand delete thetest_config.yml. This rule is the only thing using that flag on the template, so the change is contained. I did not want to touch a shared template without asking first.package_installed, which only checks that the package is there.CODEOWNERS has no
/products/ubuntu*/controls/line, soproducts/ubuntu2604/controls/cis_ubuntu2604.ymlwill not request ubuntu-maintainers review automatically. There is an equivalent/products/rhel*/controls/line already. I can add one here, or move the file tocontrols/cis_ubuntu2604.ymlnext tocis_ubuntu2404.ymlif you would rather keep the CIS control files together.cc @alanmcanonical @mpurg @dodys