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

Introduce new admin scopes in order to access IAM API endpoints #562

Merged
merged 24 commits into from
May 29, 2023

Conversation

rmiccoli
Copy link
Contributor

@rmiccoli rmiccoli commented Feb 10, 2023

This PR avoids that token created by IAM admin have full access to IAM API (issue #543). In fact, the authorisation at IAM API endpoints is based on user's ROLE. The identity of the user is evaluated from browser session or from token sub value. This means that scopes are ignored. This fix introduces the fact that authorisation is based on the user's identity only if it's a browser session, otherwise only scopes count. Two new scopes have been added:

  • iam:admin.read: it gives the same read privileges of an administrator;
  • iam:admin.write: it gives the same read & write privileges of an administrator.

- if the API is accessed with a token, a check on the scope should be considered
- if the API is accessed through the web interface, access is based on the IAM role
@rmiccoli rmiccoli changed the title Add a new expression to check authN Add a new expression to check authZ Feb 10, 2023
@sonarcloud
Copy link

sonarcloud bot commented Feb 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@github-advanced-security
Copy link

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

- add admin:read scope for read-only access
- add admin:write scope for write/delete access

These scopes are taken into account when
admin/group manager accesses the APIs with a token.
and change their name from admin:read/write to
iam:admin:read/write.
@enricovianello enricovianello changed the title Add a new expression to check authZ Introduce new admin scopes in order to access IAM API endpoints May 29, 2023
@rmiccoli rmiccoli merged commit 43c89ee into develop May 29, 2023
8 checks passed
@rmiccoli rmiccoli deleted the issue-543 branch May 29, 2023 14:35
@sonarcloud
Copy link

sonarcloud bot commented May 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

93.9% 93.9% Coverage
0.3% 0.3% Duplication

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.

None yet

1 participant