snowflakedb / SnowAlert

Security Analytics Using The Snowflake Data Warehouse
Apache License 2.0
184 stars 57 forks source link

[DC]: Add Accountwide S3 Bucket Public Access Block #457

Closed edulop91 closed 4 years ago

edulop91 commented 4 years ago

Related to https://github.com/snowflakedb/SnowAlert/pull/454 and https://github.com/snowflakedb/SnowAlert/issues/453

Pulls the account level S3 Bucket Public Access. There is something a bit wonky where the api requires me to pass in the accountid (of the account i'm calling this from). Seemed like the cleanest solution was to also chain an sts.get_caller_identity to rely on the parameter propagation. Please let me know if there is a better way. Also kind of confusing that the api call is s3control, not intuitive that this is an account wide resource.

Tested by:

  1. python runners/connectors_runner.py "AWS_COLLECT_%%"
  2. select * from "SNOWALERT"."DATA"."AWS_COLLECT_S3CONTROL_GET_PUBLIC_ACCESS_BLOCK";
  3. select * from "SNOWALERT"."DATA"."AWS_COLLECT_STS_GET_CALLER_IDENTITY";
sfc-gh-afedorov commented 4 years ago

merged in #459