Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Create 3.xCloudTrailMetrics.json #2

Merged
merged 1 commit into from
May 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
247 changes: 247 additions & 0 deletions 2.xCloudtrail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"CTT1AZQC": {
"DependsOn": [
"S3B42WBC"
],
"Properties": {
"CloudWatchLogsLogGroupArn": {
"Fn::GetAtt": [
"LLG39AOL",
"Arn"
]
},
"CloudWatchLogsRoleArn": {
"Fn::GetAtt": [
"CloudTrailRole",
"Arn"
]
},
"EnableLogFileValidation": true,
"IncludeGlobalServiceEvents": true,
"IsLogging": true,
"IsMultiRegionTrail": true,
"KMSKeyId": {
"Ref": "CloudTrailKey"
},
"S3BucketName": {
"Ref": "S3B42WBC"
}
},
"Type": "AWS::CloudTrail::Trail"
},
"CloudTrailKey": {
"Properties": {
"Description": "CloudTrail At-Rest Key",
"EnableKeyRotation": true,
"Enabled": true,
"KeyPolicy": {
"Id": "Key policy created by CloudTrail",
"Statement": [
{
"Action": "kms:*",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::958320089221:root"
},
"Resource": "*",
"Sid": "Enable IAM User Permissions"
},
{
"Action": "kms:GenerateDataKey*",
"Condition": {
"StringLike": {
"kms:EncryptionContext:aws:cloudtrail:arn": "arn:aws:cloudtrail:*:958320089221:trail/*"
}
},
"Effect": "Allow",
"Principal": {
"Service": "cloudtrail.amazonaws.com"
},
"Resource": "*",
"Sid": "Allow CloudTrail to encrypt logs"
},
{
"Action": "kms:DescribeKey",
"Effect": "Allow",
"Principal": {
"Service": "cloudtrail.amazonaws.com"
},
"Resource": "*",
"Sid": "Allow CloudTrail to describe key"
},
{
"Action": [
"kms:Decrypt",
"kms:ReEncryptFrom"
],
"Condition": {
"StringEquals": {
"kms:CallerAccount": "958320089221"
},
"StringLike": {
"kms:EncryptionContext:aws:cloudtrail:arn": "arn:aws:cloudtrail:*:958320089221:trail/*"
}
},
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Resource": "*",
"Sid": "Allow principals in the account to decrypt log files"
},
{
"Action": "kms:CreateAlias",
"Condition": {
"StringEquals": {
"kms:CallerAccount": "958320089221",
"kms:ViaService": "ec2.us-west-2.amazonaws.com"
}
},
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Resource": "*",
"Sid": "Allow alias creation during setup"
},
{
"Action": [
"kms:Decrypt",
"kms:ReEncryptFrom"
],
"Condition": {
"StringEquals": {
"kms:CallerAccount": "958320089221"
},
"StringLike": {
"kms:EncryptionContext:aws:cloudtrail:arn": "arn:aws:cloudtrail:*:958320089221:trail/*"
}
},
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Resource": "*",
"Sid": "Enable cross account log decryption"
}
],
"Version": "2012-10-17"
}
},
"Type": "AWS::KMS::Key"
},
"CloudTrailRole": {
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": [
"sts:AssumeRole"
],
"Effect": "Allow",
"Principal": {
"Service": [
"cloudtrail.amazonaws.com"
]
}
}
],
"Version": "2012-10-17"
},
"Path": "/",
"Policies": [
{
"PolicyDocument": {
"Statement": [
{
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Effect": "Allow",
"Resource": "arn:aws:logs:*:*:*"
}
],
"Version": "2012-10-17"
},
"PolicyName": "root"
}
]
},
"Type": "AWS::IAM::Role"
},
"LLG39AOL": {
"Properties": {
"RetentionInDays": 1
},
"Type": "AWS::Logs::LogGroup"
},
"S3B42WBC": {
"Properties": {},
"Type": "AWS::S3::Bucket"
},
"S3BP3BLA0": {
"Properties": {
"Bucket": {
"Ref": "S3B42WBC"
},
"PolicyDocument": {
"Statement": [
{
"Action": "s3:GetBucketAcl",
"Effect": "Allow",
"Principal": {
"Service": "cloudtrail.amazonaws.com"
},
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{
"Ref": "S3B42WBC"
}
]
]
},
"Sid": "AWSCloudTrailAclCheck20150319"
},
{
"Action": "s3:PutObject",
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control"
}
},
"Effect": "Allow",
"Principal": {
"Service": "cloudtrail.amazonaws.com"
},
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{
"Ref": "S3B42WBC"
},
"/AWSLogs/",
{
"Ref": "AWS::AccountId"
},
"/*"
]
]
},
"Sid": "AWSCloudTrailWrite20150319"
}
]
}
},
"Type": "AWS::S3::BucketPolicy"
}
}
}
Loading