Jeremy Cooper [AFS MBP] 780e3d9967 Updates tfsec/chekov ignores | S3 Enable Logging/Versioning 3 lat temu
..
README.md 2a9f97b0b7 Adds a codebuild module for the documentation from content_source 3 lat temu
constants.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 lat temu
globals.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 lat temu
iam.tf 82b8d76a53 Updates tfsec/checkov Ignore comments for aws-iam-no-policy-wildcards 3 lat temu
kms.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 lat temu
locals.tf baa1f43824 Applied `terraform fmt` to all modules 3 lat temu
outputs.tf 56aad1d5b3 Combines the S3 Bucket for portal-shared-artifacts with the codebuild project 3 lat temu
s3.tf 780e3d9967 Updates tfsec/chekov ignores | S3 Enable Logging/Versioning 3 lat temu
vars.tf 21a776da18 Adds CORS policy for S3 bucket 3 lat temu

README.md

Creates an S3 bucket, KMS key, and a role that can be assumed to access them

Full Bucket and Role Names

The bucket and roles will be prefixed with "xdr-{environment}-". If the splunk_prefix is required, it will need to be passed in as part of the name.

Important Note about Lifecycles

Versioning is enabled in the bucket. The current version and the previous version are always kept. Older versions are expired after 90 days.

All items transition to a intelligent tiering after 30 days.

Testing

For testing, the instance must assume-role first. To do this from the command-line:

aws --region us-gov-east-1 sts assume-role --role-session-name ftd_testing --role-arn [ARN]
# Output will contain AccessKeyId and SecretAcessKeyID
AWS_ACCESS_KEY_ID=[REPLACE] AWS_SECRET_ACCESS_KEY=[REPLACE] AWS_SESSION_TOKEN=[replace] aws --region us-gov-east-1 s3 ls

NOTE: You cannot generate the correct presigned url with older versions of the AWS CLI, such as the one presently (2022-04-19) installed on the portal boxes. You will get the error:

<Error>
  <Code>InvalidRequest</Code>
  <Message>The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.</Message>
  <RequestId>VJF9V2CAQR1XZER6</RequestId>
  <HostId>bJ/waruDGO4FC2VQoTRRtwGnehzOScUpu8JbXnCQ7L8vVULm9RGLF8EqAXjSAViM+HdXXDI4rqM=</HostId>
</Error>

Newer boto3 requests will use signature version 4, which works correctly.