Fred Damstra [afs macbook] 56aad1d5b3 Combines the S3 Bucket for portal-shared-artifacts with the codebuild project 3 jaren geleden
..
README.md 2a9f97b0b7 Adds a codebuild module for the documentation from content_source 3 jaren geleden
constants.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 jaren geleden
globals.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 jaren geleden
iam.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 jaren geleden
kms.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 jaren geleden
locals.tf baa1f43824 Applied `terraform fmt` to all modules 3 jaren geleden
outputs.tf 56aad1d5b3 Combines the S3 Bucket for portal-shared-artifacts with the codebuild project 3 jaren geleden
s3.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 jaren geleden
vars.tf 7a08ba10cf Migrated most variables out of xdr-terraform-live and into xdr-terraform-modules 3 jaren geleden

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.