46 lines
888 B
Plaintext
46 lines
888 B
Plaintext
![]() |
include::../description.adoc[]
|
||
|
|
||
|
include::../ask-yourself.adoc[]
|
||
|
|
||
|
include::recommended.adoc[]
|
||
|
|
||
|
== Sensitive Code Example
|
||
|
|
||
|
S3 bucket objects access through TLS is not enforced by default:
|
||
|
|
||
|
[source,javascript]
|
||
|
----
|
||
|
const s3 = require('aws-cdk-lib/aws-s3');
|
||
|
|
||
|
const bucket = new s3.Bucket(this, 'example'); // Sensitive
|
||
|
----
|
||
|
|
||
|
== Compliant Solution
|
||
|
|
||
|
[source,javascript]
|
||
|
----
|
||
|
const s3 = require('aws-cdk-lib/aws-s3');
|
||
|
|
||
|
const bucket = new s3.Bucket(this, 'example', {
|
||
|
bucketName: 'example',
|
||
|
versioned: true,
|
||
|
publicReadAccess: false,
|
||
|
enforceSSL: true
|
||
|
});
|
||
|
----
|
||
|
|
||
|
include::../see.adoc[]
|
||
|
* https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html[AWS CDK version 2] - Bucket
|
||
|
|
||
|
ifdef::env-github,rspecator-view[]
|
||
|
|
||
|
'''
|
||
|
== Implementation Specification
|
||
|
(visible only on this page)
|
||
|
|
||
|
include::message.adoc[]
|
||
|
|
||
|
include::highlighting.adoc[]
|
||
|
|
||
|
endif::env-github,rspecator-view[]
|