Skip to content
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

cluster: check both SELinux status and config #2496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Jan 20, 2025

What problem does this PR solve?

Currently tiup cluster check only checks if SELinux is configured to be disabled. It does not check the current status.

What is changed and how it works?

This now adds a second check (CheckSELinuxStatus) and renames the first one to CheckSELinuxConf.

Another option would be to roll both into CheckSELinux

Check List

Tests

  • Manual test (add detailed scripts or steps below)
tiup-cluster check topology.yaml --apply
...
192.168.122.196  selinux_conf    Fail    will try to disable SELinux, reboot might be needed
192.168.122.196  selinux_status  Fail    will try to disable SELinux, reboot might be needed
...
+ Try to apply changes to fix failed checks
  - Applying changes on 192.168.122.196 ... ⠦ Shell: host=192.168.122.196, sudo=true, command=`sed -i 's/^[[:blank:]]*SELINUX=enforcing/...
tiup-cluster check topology.yaml
192.168.122.196  selinux_status  Warn    SELinux is in Permissive mode, disabling is recommended
192.168.122.196  selinux_conf    Pass    SELinux is disabled in configuration

Code changes

  • Has exported function/method change

Release notes:

`tiup cluster check` now checks the SELinux status in addition to the SELinux configuration

@ti-chi-bot ti-chi-bot bot requested review from breezewish and kaaaaaaang January 20, 2025 15:50
Copy link
Contributor

ti-chi-bot bot commented Jan 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xhebox for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 20, 2025
@dveeden
Copy link
Contributor Author

dveeden commented Jan 20, 2025

/retest

1 similar comment
@dveeden
Copy link
Contributor Author

dveeden commented Jan 21, 2025

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant