mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 06:45:08 +00:00
feat(global_aws_session): Global data structure for the current AWS audit (#1212)
* fix(audit info): Common data structure for current audit * fix(iam): iam session audit fixed * feat(aws_session): Include else block Co-authored-by: Pepe Fagoaga <pepe@verica.io>
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
from lib.logger import logger
|
||||
from providers.aws.aws_provider import aws_session
|
||||
from providers.aws.aws_provider import current_audit_info
|
||||
|
||||
|
||||
################## IAM
|
||||
class IAM:
|
||||
def __init__(self, session):
|
||||
def __init__(self, audit_info):
|
||||
self.service = "iam"
|
||||
self.session = session
|
||||
self.client = session.client(self.service)
|
||||
self.session = audit_info.audit_session
|
||||
self.client = self.session.client(self.service)
|
||||
self.users = self.__get_users__()
|
||||
self.roles = self.__get_roles__()
|
||||
self.customer_managed_policies = self.__get_customer_managed_policies__()
|
||||
@@ -89,7 +89,7 @@ class IAM:
|
||||
|
||||
|
||||
try:
|
||||
iam_client = IAM(aws_session)
|
||||
iam_client = IAM(current_audit_info)
|
||||
except Exception as error:
|
||||
logger.critical(f"{error.__class__.__name__} -- {error}")
|
||||
quit()
|
||||
|
||||
Reference in New Issue
Block a user