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

T5554: Disable sudo for PAM RADIUS #2220

Merged
merged 1 commit into from
Sep 8, 2023
Merged

T5554: Disable sudo for PAM RADIUS #2220

merged 1 commit into from
Sep 8, 2023

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Sep 7, 2023

Change Summary

Disable sudo for PAM RADIUS template that slows down the CLI commands

To fix it, add:

...
session [default=ignore success=2] pam_succeed_if.so service = sudo

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

pam

Proposed changes

How to test

Add some fake RADIUS server

set system login radius server 203.0.113.24 key 'key1'
commit

Commit time before the fix:

vyos@r14# set interfaces ethernet eth1 description test1
[edit]
vyos@r14# time commit

real	0m13.349s
user	0m0.616s
sys	0m0.300s
[edit]
vyos@r14#

After the fix:

vyos@r14# set interfaces ethernet eth1 description test2
[edit]
vyos@r14# time commit

real	0m1.316s
user	0m0.626s
sys	0m0.303s
[edit]
vyos@r14# 

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team September 7, 2023 17:28
@sever-sever sever-sever marked this pull request as draft September 7, 2023 17:31
@c-po
Copy link
Member

c-po commented Sep 8, 2023

It's a good catch, but mangling PAM files by hand is risky and unmaintainable.

Can you please use https://manpages.ubuntu.com/manpages/trusty/man8/pam-auth-update.8.html to update the file?

We have the RADIUS config here https://github.com/vyos/vyos-1x/blob/current/src/pam-configs/radius so it looks like it only needs to be adjusted. Check Session-Interactive-Only in https://wiki.ubuntu.com/PAMConfigFrameworkSpec

@sever-sever sever-sever marked this pull request as ready for review September 8, 2023 10:48
@vyosbot vyosbot requested a review from a team September 8, 2023 10:48
@sever-sever
Copy link
Member Author

We have the RADIUS config here https://github.com/vyos/vyos-1x/blob/current/src/pam-configs/radius so it looks like it only needs to be adjusted.

Done!

Disable sudo for PAM RADIUS template that slows down the CLI commands
To fix it add:

session [default=ignore success=2] pam_succeed_if.so service = sudo
@c-po c-po merged commit 28ccebe into vyos:current Sep 8, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants