fix(m365): add powershell.close() to msgraph services (#7817)

Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
Co-authored-by: Sergio Garcia <hello@mistercloudsec.com>
Co-authored-by: HugoPBrito <hugopbrit@gmail.com>
This commit is contained in:
Prowler Bot
2025-05-28 16:03:49 +02:00
committed by GitHub
parent e05a9381e6
commit 0e44bebc79
4 changed files with 12 additions and 0 deletions
+4
View File
@@ -55,6 +55,10 @@ All notable changes to the **Prowler SDK** are documented in this file.
- Cover policies with conditions with SNS endpoint in `sns_topics_not_publicly_accessible`. [(#7750)](https://github.com/prowler-cloud/prowler/pull/7750)
- Fix `m365_powershell test_credentials` to use sanitized credentials. [(#7761)](https://github.com/prowler-cloud/prowler/pull/7761)
- Change severity logic for `ec2_securitygroup_allow_ingress_from_internet_to_all_ports` check. [(#7764)](https://github.com/prowler-cloud/prowler/pull/7764)
### 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)
- Fix `m365_powershell` to close the PowerShell sessions in msgraph services. [(#7816)](https://github.com/prowler-cloud/prowler/pull/7816)
---
@@ -12,6 +12,9 @@ class AdminCenter(M365Service):
def __init__(self, provider: M365Provider):
super().__init__(provider)
if self.powershell:
self.powershell.close()
loop = get_event_loop()
# Get users first alone because it is a dependency for other attributes
@@ -14,6 +14,8 @@ from prowler.providers.m365.m365_provider import M365Provider
class Entra(M365Service):
def __init__(self, provider: M365Provider):
super().__init__(provider)
if self.powershell:
self.powershell.close()
loop = get_event_loop()
self.tenant_domain = provider.identity.tenant_domain
@@ -13,6 +13,9 @@ from prowler.providers.m365.m365_provider import M365Provider
class SharePoint(M365Service):
def __init__(self, provider: M365Provider):
super().__init__(provider)
if self.powershell:
self.powershell.close()
loop = get_event_loop()
self.tenant_domain = provider.identity.tenant_domain
attributes = loop.run_until_complete(