Slide 1

Slide 1 text

WAF ͷϩάΛ ผͷΞΧ΢ϯτͷS3ʹอଘ͢Δ 2020/05/29

Slide 2

Slide 2 text

ࡾӜҰथ ๺ւಓςϨϏ์ૹ +"846(ࡳຈ .FEJB+"84 +1@4USJQFTࡳຈ ήετϒϩΨʔ ࣗݾ঺հ

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

WAF ͷϩάΛS3ʹอଘ ALB Kinesis Firehose S3

Slide 5

Slide 5 text

WAF ͷϩάΛS3ʹอଘ ALB Kinesis Firehose S3 ϚϧνΞΧ΢ϯτ͍ͨ࣌͠΋͋Γ·͢ΑͶ

Slide 6

Slide 6 text

WAF ͷϩάΛS3ʹอଘ ALB Kinesis Firehose S3 ϚϧνΞΧ΢ϯτ͍ͨ࣌͠΋͋Γ·͢ΑͶ ίϯιʔϧ͔ΒઃఆͰ͖ͳ͍ʂʂ

Slide 7

Slide 7 text

CloudFormation͕͋Δ͡Όͳ͍͔

Slide 8

Slide 8 text

10࣌ؒ͘Β͍ʁͰ͔͚ͨ

Slide 9

Slide 9 text

AWSTemplateFormatVersion: 2010-09-09 Parameters: BucketArn: Default: “arn:aws:s3:::bucketname" Description: "Please enter the ARN of the destination S3" Type: String StreamName: Default: "aws-waf-logs-XXXX" Description: "Enter a name for the delivery stream. The name must start with aws-waf-logs- and end with an arbitrary suffix. For example, it's aws-waf-logs-demo" Type: String IAMRoleName: Default: 'FirehoseToCrossAccountS3Role' Description: "Please enter the name of the IAM Role that this cloudformation stack will generate." Type: String IAMPolicyName: Default: 'firehose_delivery_cross_account_policy' Description: "Please enter the name of the IAM Policy that this cloudformation stack will generate." Type: String Parameter

Slide 10

Slide 10 text

Resources: Stream: Type: AWS::KinesisFirehose::DeliveryStream Properties: DeliveryStreamName: !Ref StreamName DeliveryStreamType: DirectPut S3DestinationConfiguration: BucketARN: !Ref BucketArn BufferingHints: IntervalInSeconds: 300 SizeInMBs: 5 CloudWatchLoggingOptions: Enabled: True LogGroupName: /aws/kinesisfirehose/aws-waf-logs-alb LogStreamName: sodane CompressionFormat: 'GZIP' ErrorOutputPrefix: !Join - '' - - 'AWSLogs/' - !Ref 'AWS::AccountId' - '/WAF-error/' - !Ref 'AWS::Region' - '/' Prefix: !Join - '' - - 'AWSLogs/' - !Ref 'AWS::AccountId' - '/WAF/' - !Ref "AWS::Region" - '/' RoleARN: !GetAtt deliveryRole.Arn Resources

Slide 11

Slide 11 text

deliveryRole: Type: AWS::IAM::Role Properties: RoleName: !Ref IAMRoleName AssumeRolePolicyDocument: Version: 2012-10-17 Statement: - Sid: '' Effect: Allow Principal: Service: 'firehose.amazonaws.com' Action: 'sts:AssumeRole' Condition: StringEquals: 'sts:ExternalId': !Ref 'AWS::AccountId' Path: '/' Policies: - PolicyName: !Ref IAMPolicyName PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - 's3:AbortMultipartUpload' - 's3:GetBucketLocation' - 's3:GetObject' - 's3:ListBucket' - 's3:ListBucketMultipartUploads' - 's3:PutObject' - 's3:PutObjectAcl' Resource: - !Ref BucketArn - !Join - '' - - !Ref BucketArn - '/*' - Effect: Allow Action: 'logs:PutLogEvents' Resource: - !Join - '' - - 'arn:aws:logs:' - !Ref 'AWS::Region' - ':' - !Ref 'AWS::AccountId' - ':log-group:/aws/kinesisfirehose' - ':log-stream:*' IAM

Slide 12

Slide 12 text

Outputs: StreamName: Value: !Ref Stream Description: Delivery Stream Name RoleARN: Description: Please tell him the ARN of the IAM Role Value: !GetAtt deliveryRole.Arn OutPuts ͜ͷIAM RoleͷARNΛ όέοτϙϦγʔʹೖΕͯ͋͛Δ

Slide 13

Slide 13 text

͜ͷIAM RoleͷARNΛ όέοτϙϦγʔʹೖΕͯ͋͛Δ { "Sid": "Kinesis Firehose to S3", "Effect": "Allow", "Principal": { "AWS": [ "arn:aws:iam::XXXXXXXXXXXX:role/FirehoseToCrossAccountS3Role" ] }, "Action": [ "s3:AbortMultipartUpload", "s3:GetBucketLocation", "s3:GetObject", "s3:ListBucket", "s3:ListBucketMultipartUploads", "s3:PutObject", "s3:PutObjectAcl" ], "Resource": [ "arn:aws:s3:::bucketname", “arn:aws:s3:::bucketname/*" ] }

Slide 14

Slide 14 text

΄΅ॳΊͯॻ͖·͚ͨ͠Ͳศར CloudFormation ɾผͷਓʹ౉ͯ͠࡞ۀͯ͠΋Β͏ͷ͕ͱͬͯ΋ָ ɾೖग़ྗͷը໘΋࡞ΕΔͷͰखॱॻͱ߹ΘͤͨΒ୭Ͱ΋࡞ۀͰ͖Δ ɾStack͕࢒ΔͷͰԿ΍͔ͬͨ΋ݟ͍͍͑ͯײ͡

Slide 15

Slide 15 text

No content