
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
63 lines
1.4 KiB
Plaintext
63 lines
1.4 KiB
Plaintext
include::../description.adoc[]
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
== Sensitive Code Example
|
|
|
|
This policy allows all users, including anonymous ones, to access an S3 bucket:
|
|
|
|
[source,yaml]
|
|
----
|
|
AWSTemplateFormatVersion: 2010-09-09
|
|
Resources:
|
|
S3BucketPolicy:
|
|
Type: 'AWS::S3::BucketPolicy' # Sensitive
|
|
Properties:
|
|
Bucket: !Ref S3Bucket
|
|
PolicyDocument:
|
|
Version: "2012-10-17"
|
|
Statement:
|
|
- Effect: Allow
|
|
Principal:
|
|
AWS: "*" # all principals / anonymous access
|
|
Action: "s3:PutObject" # can put object
|
|
Resource: arn:aws:s3:::mybucket/*
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
This policy allows only the authorized users:
|
|
|
|
[source,yaml]
|
|
----
|
|
AWSTemplateFormatVersion: 2010-09-09
|
|
Resources:
|
|
S3BucketPolicy:
|
|
Type: 'AWS::S3::BucketPolicy' # Compliant
|
|
Properties:
|
|
Bucket: !Ref S3Bucket
|
|
PolicyDocument:
|
|
Version: "2012-10-17"
|
|
Statement:
|
|
- Effect: Allow
|
|
Principal:
|
|
AWS:
|
|
- !Sub 'arn:aws:iam::${AWS::AccountId}:root' # only this principal
|
|
Action: "s3:PutObject" # can put object
|
|
Resource: arn:aws:s3:::mybucket/*
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|