feat(seharden): add crypto_policy, logging, ssh enforcers and expand CIS reinforce coverage#3
Open
rain-Qing wants to merge 1 commit into
Open
feat(seharden): add crypto_policy, logging, ssh enforcers and expand CIS reinforce coverage#3rain-Qing wants to merge 1 commit into
rain-Qing wants to merge 1 commit into
Conversation
…CIS reinforce coverage Signed-off-by: YuQing Yang <yyq01323329@alibaba-inc.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds three new seharden enforcers (
crypto_policy,logging,ssh)and significantly expands the CIS Alinux 3 reinforce profile coverage.
New Enforcers
update-crypto-policiesand manage policy module files./var/loglog filesaccording to CIS baseline requirements.
the SSH daemon configuration.
Enforcer Expansions
ensure_syscall_rule(with comparisons, fields, exitvalues, auid defaults),
ensure_path_exec_rule,ensure_privileged_command_rules,reload_rules, andensure_directive.set_password_defaults,fix_future_password_changes,lock_nologin_accounts,lock_root_account,disable_system_account_shells, andfix_dotfiles. All functions thatconstruct shell commands validate usernames with
is_safe_username().fix_bootloader_configandfix_sshd_config_accesswith directory traversal and Include-directive tracking.
Probe Updates
Profile
Alinux 3 Level-1 and Level-2 controls.
Tests
in
tests/unit/seharden/test_seharden_enforcers.lua, includingunsafe-username rejection, idempotency, and error propagation cases.
Checklist
is_safe_username,is_safe_key,is_safe_path, arch/syscall regex patterns)