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

cartography fails to scan account that has denied regions at org level #1114

Open
VishalAgarW opened this issue Feb 9, 2023 · 5 comments
Open
Labels
AWS Related to cartography's AWS module bug Something isn't working

Comments

@VishalAgarW
Copy link
Contributor

Title: cartography fails to scan account that has denied regions at org level

Description:

If you have an AWS Account as part of an AWS Org and Org is configured to deny region (https://docs.aws.amazon.com/controltower/latest/userguide/region-deny.html ), scanning the account crashes when it tries to enumerate resources in the denied regions.

To Reproduce:

  1. Create an AWS Account and make it part of AWS Org.
    2. Configure AWS Region deny for the regions you don't want your organization to use.
    3. Try to scan the AWS account.

Logs:

Fails with 'UnauthorizedOperation' exception.
raise error_class(parsed_response, operation_name)\nbotocore.exceptions.ClientError: An error occurred (UnauthorizedOperation) when calling the DescribeVolumes operation: You are not authorized to perform this operation.\n"

Additional context:
'UnauthorizedOperation' need to be added in ERROR_CODES list of aws_handle_regions function
ERROR_CODES = [
'AccessDenied',
'AccessDeniedException',
'AuthFailure',
'InvalidClientTokenId',
'UnrecognizedClientException',
'InternalServerErrorException',
]

@HerRomero
Copy link

HerRomero commented Feb 17, 2023

I'm having this same problem, it seems that execution stops when it finds an explicit deny from an SCP
A simple solution could be adding an aws-regions parameter in the execution command

@HerRomero
Copy link

#1011

@achantavy achantavy added the bug Something isn't working label Feb 18, 2023
@CalvinRodo
Copy link

I've run into this same issue, we have implemented AWS Control Tower and so for compliance reasons have limited access to 3 possible regions Cartography did work until we set that up, it would be nice to just limit asset discovery to only specific regions since we know it's impossible to create resources in all ones that are denied.

@HerRomero
Copy link

Any news on this issue?

@achantavy achantavy added the AWS Related to cartography's AWS module label Jul 14, 2023
@wanisfahmyDE
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AWS Related to cartography's AWS module bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants