Skip to content

Saml group mapping v2 #2489

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

Antiksec
Copy link
Contributor

@Antiksec Antiksec commented Feb 6, 2025

Describe the Pull Request

Rework for SSO mapping:
1) Using list of mapped groups instead of one
2) Exception when SSO logged-in user doesn't have suitable SSO groups
3) Default role for use when SSO logged-in user has no groups

Checklist for PR

  • Run MobSF unit tests and lint tox -e lint,test
  • Tested Working on Linux, Mac, Windows, and Docker
  • Add unit test for any new Web API (Refer: StaticAnalyzer/tests.py)
  • Make sure tests are passing on your PR MobSF tests

Additional Comments (if any)

DESCRIBE HERE

Khabarov Konstantin Olegovich added 3 commits February 6, 2025 17:27
elif vrole or settings.IDP_MOBSF_DEFAULT_GROUP == 'Viewer':
logger.info('User assigned to %s group.', VIEWER_GROUP)
return VIEWER_GROUP
logger.warning('User does not have an authorized SSO group.')
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to support this? We do not want to over complicate SSO roles. MobSF only has two role privileges a read-only default role for everyone and a read-write maintainer role for maintainer group.

@@ -174,6 +183,9 @@ def saml_acs(request):
'role attribute not found in SAML response.')
email = attributes['email'][0]
role = get_user_role(attributes['role'])
if not role:
raise Exception(
Copy link
Member

Choose a reason for hiding this comment

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

Users/Groups that doesn't need MobSF access shouldn't be added in the MobSF SAML app.
https://mobsf.github.io/docs/#/sso

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.

2 participants