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

Support user-defined entries for sudo NOPASSWD #507

Merged
merged 5 commits into from
Mar 12, 2024

Conversation

achilleas-k
Copy link
Member

Replace the wheel-sudo-nopasswd (bool) installer customization with sudo-nopasswd ([]string). Users can now specify a list of users or groups (groups must be prefixed with %). For each element in the array, the kickstart file will create a file that enables sudo with NOPASSWD for that entry. Each entry is added as a separate file in the sudoers.d drop-in directory.

@achilleas-k achilleas-k force-pushed the sudo-nopasswd branch 2 times, most recently from f2c9278 to bfe28e6 Compare March 11, 2024 16:54
bcl
bcl previously approved these changes Mar 11, 2024
Copy link
Contributor

@bcl bcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

supakeen
supakeen previously approved these changes Mar 11, 2024
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat. I assume WheelSudoNopasswd removal won't break existing blueprints?

@achilleas-k
Copy link
Member Author

Neat. I assume WheelSudoNopasswd removal won't break existing blueprints?

It's not exposed in composer yet. This change came from a discussion in chat that I started because I want to add it to composer and wanted to find a better name for it before it's finalised :)

mvo5
mvo5 previously approved these changes Mar 11, 2024
Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this a lot, thank you! This is fine as is, I would love a test and have more ideas/suggestions inline but really more about me thinking out loud than that anything needs to be changed :)

pkg/manifest/anaconda_installer_iso_tree.go Show resolved Hide resolved
pkg/manifest/anaconda_installer_iso_tree.go Show resolved Hide resolved
pkg/manifest/anaconda_installer_iso_tree.go Show resolved Hide resolved
Replace the wheel-sudo-nopasswd (bool) installer customization with
sudo-nopasswd ([]string).  Users can now specify a list of users or
groups (groups must be prefixed with %).  For each element in the array,
the kickstart file will create a file that enables sudo with NOPASSWD
for that entry.  Each entry is added as a separate file in the sudoers.d
drop-in directory.

Duplicate entries are silently ignored.
The new configs are functionally equivalent to the old options, but
since the drop-in filenames changed from /etc/sudoers.d/wheel to
/etc/sudoers.d/%wheel, the hardcoded kickstart contents will change.
Add %sudo as well to the unattended-iso test as a test that multiple
groups work.
When testing if the relevant stages were created in the Anaconda
installer ISO tree pipeline, also check that the content ID for the
embedded (raw) kickstart file is the expected one based on the groups
added to the NoPasswd option.
Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@achilleas-k achilleas-k added this pull request to the merge queue Mar 12, 2024
Merged via the queue into osbuild:main with commit 8018640 Mar 12, 2024
14 checks passed
@achilleas-k achilleas-k deleted the sudo-nopasswd branch March 12, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants