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

Login through RADIUS is not working due to invalid shell #13141

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/radius/nss/libnss-radius/nss_radius_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ static void init_rnm(RADIUS_NSS_CONF_B * conf) {
rnm[0].gid = 999;
rnm[0].groups = "docker";

Choose a reason for hiding this comment

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

To reduce the attack surface, maybe change the default group given here.
MPL = 0 user does not require docker, but maybe it does require the redis group or adm group.

Copy link
Author

@saravanan-i saravanan-i Jul 18, 2023

Choose a reason for hiding this comment

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

Hi @Yarden-Z . They were defined as per the existing RADIUS design document of SoNIC ( RADIUS_Design ). I haven't introduced them as part of this pull request. Can you please confirm if you have to change the same ?

Choose a reason for hiding this comment

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

I understand that these values were introduced in the HLD design.
But given this item - I think we can re-visit this.
From my perspective, a non-privileged user requires redis (potentially) and the default adm group.
If I understood your question

Copy link
Collaborator

@qiluo-msft qiluo-msft Jun 27, 2023

Choose a reason for hiding this comment

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

The readonly user should be in users group, and no docker group membership. #WontFix

Copy link
Author

Choose a reason for hiding this comment

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

Hi @qiluo-msft. User groups were defined based on existing RADIUS design document of SoNiC RADIUS_Design. I haven't introduced them as part of this pull request. Can you please confirm if we have to modify the same ?

rnm[0].gecos = "remote_user";
rnm[0].shell = "/usr/bin/sonic-launch-shell";
rnm[0].shell = "/bin/bash";
rnm[RADIUS_MAX_MPL-1].gid = 1000;
rnm[RADIUS_MAX_MPL-1].groups = "admin,sudo,docker";
rnm[RADIUS_MAX_MPL-1].gecos = "remote_user_su";
rnm[RADIUS_MAX_MPL-1].shell = "/usr/bin/sonic-launch-shell";
rnm[RADIUS_MAX_MPL-1].shell = "/bin/bash";

}

Expand Down