The Wayback Machine - https://web.archive.org/web/20201226003439/https://github.com/mozilla/MozDef/issues/1518
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

Use standard boto credential provider chain instead of using configlib #1518

Open
andrewkrug opened this issue Nov 14, 2019 · 0 comments
Open

Use standard boto credential provider chain instead of using configlib #1518

andrewkrug opened this issue Nov 14, 2019 · 0 comments

Comments

@andrewkrug
Copy link
Contributor

@andrewkrug andrewkrug commented Nov 14, 2019

Currently many calls to MozDef make assumptions about the environment where code is executing. Code like: https://github.com/mozilla/MozDef/blob/master/alerts/actions/dashboard_geomodel.py#L40

boto3.session.Session(
            aws_access_key_id=self.config['aws_access_key_id'],
            aws_secret_access_key=self.config['aws_secret_access_key'],
            region_name=self.config['aws_region']
        )

The above will fail to fallback to using the native AWS metadata service as it advances in spaces like ECS, Fargate, and EC2 due to the presumption of static access keys.

Recommendation

Store credentials in the standard AWS $HOME/.aws/credentials directory in boto profiles and use code that calls:

boto3.session.Session(profile=)

Where profile should expect a config value and then fall through to default for the highest level of compatibility with all clouds and static keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.