Loading
Backport !9744 to 19-3-stable: Allow sshd fast SSH key lookup under SELinux
What does this MR do?
Backport of !9744 (merged) to 19-3-stable (cherry-pick of d4b61859).
Fixes fast SSH key lookup (AuthorizedKeysCommand via gitlab-shell-authorized-keys-check) failing on EL 9 and EL 10 with SELinux in Enforcing mode. The AVC denial was { connectto } on unix_stream_socket from sshd_t to unconfined_service_t (the Workhorse socket).
Changes:
files/gitlab-selinux/gitlab-10.5.0-ssh-authorized-keys.te(1.0 -> 1.1): grantssshd_tunconfined_service_t:unix_stream_socket connecttoandvar_log_t:file { open append }; addsoptional {}blocks forsshd_session_t(OpenSSH 9.8+ / EL 10) andsshd_auth_t(OpenSSH 10+) grantingconnectto,http_cache_port_t name_connect, andvar_log_t { open append }.files/gitlab-selinux/gitlab.te(1.1.0 -> 1.2.0): same rules added to the unified policy.files/gitlab-cookbooks/gitlab/recipes/selinux.rb+SELinuxHelper.module_installed_and_current?: thesemodule -iresources forgitlab-10.5.0-ssh-authorized-keysand the unifiedgitlabmodule now compare the installed module (semodule -E) byte-for-byte against the shipped.pp, so upgraded hosts pick up the new policy once and reconfigure stays idempotent.- ChefSpec coverage in
selinux_spec.rbandselinux_helper_spec.rb.
Depends on !9765 (merged) (backport of !9672 (merged)), already merged to 19-3-stable, for the sshd_session_t baseline on EL 10.
Related issues
Related to gitlab#438140 (closed) Backport of !9744 (merged)
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
- MR title and description are up to date, accurate, and descriptive.
- MR targeting the appropriate branch.
- Latest Merge Result pipeline is green.
- When ready for review, MR is labeled workflowready for review per the Distribution MR workflow.
- The UBT version and corresponding checksum hash have been updated and referenced in the merge request if applicable. (N/A)
- UBT EE pipeline (
Trigger:ee-package-ubt) is green
- UBT EE pipeline (
For GitLab team members
- The manual
Trigger:ee-packagejobs have a green pipeline running against latest commit. - If
config/softwareorconfig/patchesdirectories are changed, make sure thebuild-package-on-all-osjob within theTrigger:ee-packagedownstream pipeline succeeded. (N/A) - If you are changing anything SSL related, then the
Trigger:package:fipsmanual job within theTrigger:ee-packagedownstream pipeline must succeed. (N/A) - If CI configuration is changed, the branch must be pushed to
dev.gitlab.orgto confirm regular branch builds aren't broken. (N/A)
Expected (please provide an explanation if not completing)
- Test plan indicating conditions for success has been posted and passes. (See !9744 (merged))
- Documentation created/updated. (No user-facing config change)
- Tests added.
- Integration tests added to GitLab QA. (N/A, backport)
- Equivalent MR/issue for the GitLab Chart opened. (N/A, SELinux is Omnibus-only)
- Validate potential values for new configuration settings. (N/A, no new settings)