-
Notifications
You must be signed in to change notification settings - Fork 201
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
Atomic sudo #189
Merged
Merged
Atomic sudo #189
Conversation
This file contains 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
Updated the Invoke-SetupAtomicRunner.ps1 to use it during setup, and updated cronjob to use current user instead of root. Also updated the Invoke-AtomicRedTeam.psd1 to load the Set-Sudo function to be available as a standalone function.
Invoke-SetupAtomicRunner. Added checks in Invoke-AtomicTest and Invoke-ExecutionCommand to see if passwordless sudo is configured and if so, to append sudo to the $execPrefix for bash and sh executor. It also does an additional check to determine if the YAML requires elevation before attempting it.
redirect before sudo is applied.
… put the $executor into the $execPrefix variable when passwordless sudo has been enabled.
system if passwordless sudo is enabled.
clr2of8
approved these changes
Apr 15, 2024
Merged
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.
The changes made below are intended to provide a new option when installing the atomic runner code on a *Nix machine that will allow it to be configured to use a different user account other than root. That account will require sudo access.
The code updates adds checks for this configuration, and prepends the sudo command before commands that require it. To make this not require a password, the "set-sudo" script will create a sudo config to allow passwordless sudo for the account configured during the invoke-SetupAtomicRunner script. It will prompt the user once for the password and then configure the account to no longer require it for sudo permission.
This optional config will only trigger if you run the Invoke-SetupAtomicRunner as a not-root account with sudo privileged. If run as root, then the normal behavior will be preserved.