mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
fix(admincenter): admincenter_users_admins_reduced_license_footprint logic (#7779)
Co-authored-by: Andoni A. <14891798+andoniaf@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
118f3d163d
commit
6e184dae93
@@ -14,6 +14,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
|
||||
|
||||
### Fixed
|
||||
- Fix `m365_powershell test_credentials` to use sanitized credentials. [(#7761)](https://github.com/prowler-cloud/prowler/pull/7761)
|
||||
- Fix `admincenter_users_admins_reduced_license_footprint` check logic to pass when admin user has no license. [(#7779)](https://github.com/prowler-cloud/prowler/pull/7779)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ class admincenter_users_admins_reduced_license_footprint(Check):
|
||||
"""Execute the check for users with administrative roles and their licenses.
|
||||
|
||||
This method iterates over all users and checks if those with administrative roles
|
||||
have an allowed license. If a user has a valid license (AAD_PREMIUM or AAD_PREMIUM_P2),
|
||||
have an allowed license. If a user has a valid license (AAD_PREMIUM or AAD_PREMIUM_P2) or no license,
|
||||
the check passes; otherwise, it fails.
|
||||
|
||||
Returns:
|
||||
@@ -45,7 +45,7 @@ class admincenter_users_admins_reduced_license_footprint(Check):
|
||||
resource_name=user.name,
|
||||
resource_id=user.id,
|
||||
)
|
||||
report.status = "FAIL"
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"User {user.name} has administrative roles {admin_roles} and does not have a license."
|
||||
|
||||
if user.license:
|
||||
|
||||
+1
-1
@@ -210,7 +210,7 @@ class Test_admincenter_users_admins_reduced_license_footprint:
|
||||
check = admincenter_users_admins_reduced_license_footprint()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
assert result[0].status == "PASS"
|
||||
assert (
|
||||
result[0].status_extended
|
||||
== "User User1 has administrative roles Global Administrator and does not have a license."
|
||||
|
||||
Reference in New Issue
Block a user