Skip to content

Commit c6aebb2

Browse files
committed
add cmd to format examples
Signed-off-by: Nikita Pivkin <[email protected]>
1 parent 3f0a2ab commit c6aebb2

File tree

219 files changed

+3334
-3253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+3334
-3253
lines changed

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,8 @@ verify-bundle:
4949
rm scripts/bundle.tar.gz
5050

5151
build-opa:
52-
go build ./cmd/opa
52+
go build ./cmd/opa
53+
54+
.PHONY: fmt-examples
55+
fmt-examples:
56+
go run ./cmd/fmt-examples

avd_docs/aws/apigateway/AVD-AWS-0001/CloudFormation.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
Enable logging for API Gateway stages
33

44
```yaml
5-
AWSTemplateFormatVersion: 2010-09-09T00:00:00Z
5+
AWSTemplateFormatVersion: "2010-09-09T00:00:00Z"
66
Description: Good Example of ApiGateway
77
Resources:
8-
GoodApi:
9-
Type: AWS::ApiGatewayV2::Api
10-
GoodApiStage:
11-
Properties:
12-
AccessLogSettings:
13-
DestinationArn: gateway-logging
14-
Format: json
15-
ApiId: GoodApi
16-
StageName: GoodApiStage
17-
Type: AWS::ApiGatewayV2::Stage
8+
GoodApi:
9+
Type: AWS::ApiGatewayV2::Api
10+
GoodApiStage:
11+
Properties:
12+
AccessLogSettings:
13+
DestinationArn: gateway-logging
14+
Format: json
15+
ApiId: GoodApi
16+
StageName: GoodApiStage
17+
Type: AWS::ApiGatewayV2::Stage
1818
```
1919
2020

avd_docs/aws/athena/AVD-AWS-0006/CloudFormation.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Enable encryption at rest for Athena databases and workgroup configurations
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
Name: goodExample
9-
WorkGroupConfiguration:
10-
ResultConfiguration:
11-
EncryptionConfiguration:
12-
EncryptionOption: SSE_KMS
13-
Type: AWS::Athena::WorkGroup
6+
GoodExample:
7+
Properties:
8+
Name: goodExample
9+
WorkGroupConfiguration:
10+
ResultConfiguration:
11+
EncryptionConfiguration:
12+
EncryptionOption: SSE_KMS
13+
Type: AWS::Athena::WorkGroup
1414
```
1515
1616

avd_docs/aws/athena/AVD-AWS-0007/CloudFormation.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Enforce the configuration to prevent client overrides
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
Name: goodExample
9-
WorkGroupConfiguration:
10-
EnforceWorkGroupConfiguration: true
11-
ResultConfiguration:
12-
EncryptionConfiguration:
13-
EncryptionOption: SSE_KMS
14-
Type: AWS::Athena::WorkGroup
6+
GoodExample:
7+
Properties:
8+
Name: goodExample
9+
WorkGroupConfiguration:
10+
EnforceWorkGroupConfiguration: true
11+
ResultConfiguration:
12+
EncryptionConfiguration:
13+
EncryptionOption: SSE_KMS
14+
Type: AWS::Athena::WorkGroup
1515
```
1616
1717

avd_docs/aws/cloudfront/AVD-AWS-0010/CloudFormation.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Enable logging for CloudFront distributions
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
DistributionConfig:
9-
DefaultCacheBehavior:
10-
TargetOriginId: target
11-
ViewerProtocolPolicy: https-only
12-
Enabled: true
13-
Logging:
14-
Bucket: logging-bucket
15-
Origins:
16-
- DomainName: https://some.domain
17-
Id: somedomain1
18-
Type: AWS::CloudFront::Distribution
6+
GoodExample:
7+
Properties:
8+
DistributionConfig:
9+
DefaultCacheBehavior:
10+
TargetOriginId: target
11+
ViewerProtocolPolicy: https-only
12+
Enabled: true
13+
Logging:
14+
Bucket: logging-bucket
15+
Origins:
16+
- DomainName: https://some.domain
17+
Id: somedomain1
18+
Type: AWS::CloudFront::Distribution
1919
```
2020
2121

avd_docs/aws/cloudfront/AVD-AWS-0011/CloudFormation.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ Enable WAF for the CloudFront distribution
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
DistributionConfig:
9-
DefaultCacheBehavior:
10-
TargetOriginId: target
11-
ViewerProtocolPolicy: https-only
12-
Enabled: true
13-
Logging:
14-
Bucket: logging-bucket
15-
Origins:
16-
- DomainName: https://some.domain
17-
Id: somedomain1
18-
WebACLId: waf_id
19-
Type: AWS::CloudFront::Distribution
6+
GoodExample:
7+
Properties:
8+
DistributionConfig:
9+
DefaultCacheBehavior:
10+
TargetOriginId: target
11+
ViewerProtocolPolicy: https-only
12+
Enabled: true
13+
Logging:
14+
Bucket: logging-bucket
15+
Origins:
16+
- DomainName: https://some.domain
17+
Id: somedomain1
18+
WebACLId: waf_id
19+
Type: AWS::CloudFront::Distribution
2020
```
2121
2222

avd_docs/aws/cloudfront/AVD-AWS-0012/CloudFormation.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ Only allow HTTPS for CloudFront distribution communication
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
DistributionConfig:
9-
DefaultCacheBehavior:
10-
TargetOriginId: target
11-
ViewerProtocolPolicy: https-only
12-
Enabled: true
13-
Logging:
14-
Bucket: logging-bucket
15-
Origins:
16-
- DomainName: https://some.domain
17-
Id: somedomain1
18-
WebACLId: waf_id
19-
Type: AWS::CloudFront::Distribution
6+
GoodExample:
7+
Properties:
8+
DistributionConfig:
9+
DefaultCacheBehavior:
10+
TargetOriginId: target
11+
ViewerProtocolPolicy: https-only
12+
Enabled: true
13+
Logging:
14+
Bucket: logging-bucket
15+
Origins:
16+
- DomainName: https://some.domain
17+
Id: somedomain1
18+
WebACLId: waf_id
19+
Type: AWS::CloudFront::Distribution
2020
```
2121
2222

avd_docs/aws/cloudfront/AVD-AWS-0013/CloudFormation.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ Use the most modern TLS/SSL policies available
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
DistributionConfig:
9-
DefaultCacheBehavior:
10-
TargetOriginId: target
11-
ViewerProtocolPolicy: https-only
12-
Enabled: true
13-
Logging:
14-
Bucket: logging-bucket
15-
Origins:
16-
- DomainName: https://some.domain
17-
Id: somedomain1
18-
ViewerCertificate:
19-
MinimumProtocolVersion: TLSv1.2_2021
20-
Type: AWS::CloudFront::Distribution
6+
GoodExample:
7+
Properties:
8+
DistributionConfig:
9+
DefaultCacheBehavior:
10+
TargetOriginId: target
11+
ViewerProtocolPolicy: https-only
12+
Enabled: true
13+
Logging:
14+
Bucket: logging-bucket
15+
Origins:
16+
- DomainName: https://some.domain
17+
Id: somedomain1
18+
ViewerCertificate:
19+
MinimumProtocolVersion: TLSv1.2_2021
20+
Type: AWS::CloudFront::Distribution
2121
```
2222
2323

avd_docs/aws/cloudtrail/AVD-AWS-0014/CloudFormation.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Enable Cloudtrail in all regions
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
IsLogging: true
9-
IsMultiRegionTrail: true
10-
S3BucketName: CloudtrailBucket
11-
S3KeyPrefix: /trailing
12-
TrailName: Cloudtrail
13-
Type: AWS::CloudTrail::Trail
6+
GoodExample:
7+
Properties:
8+
IsLogging: true
9+
IsMultiRegionTrail: true
10+
S3BucketName: CloudtrailBucket
11+
S3KeyPrefix: /trailing
12+
TrailName: Cloudtrail
13+
Type: AWS::CloudTrail::Trail
1414
```
1515
1616

avd_docs/aws/cloudtrail/AVD-AWS-0015/CloudFormation.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Use Customer managed key
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
IsLogging: true
9-
IsMultiRegionTrail: true
10-
KmsKeyId: alias/CloudtrailKey
11-
S3BucketName: CloudtrailBucket
12-
S3KeyPrefix: /trailing
13-
TrailName: Cloudtrail
14-
Type: AWS::CloudTrail::Trail
6+
GoodExample:
7+
Properties:
8+
IsLogging: true
9+
IsMultiRegionTrail: true
10+
KmsKeyId: alias/CloudtrailKey
11+
S3BucketName: CloudtrailBucket
12+
S3KeyPrefix: /trailing
13+
TrailName: Cloudtrail
14+
Type: AWS::CloudTrail::Trail
1515
```
1616
1717
#### Remediation Links

avd_docs/aws/cloudtrail/AVD-AWS-0016/CloudFormation.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Turn on log validation for Cloudtrail
33

44
```yaml
55
Resources:
6-
GoodExample:
7-
Properties:
8-
EnableLogFileValidation: true
9-
IsLogging: true
10-
IsMultiRegionTrail: true
11-
S3BucketName: CloudtrailBucket
12-
S3KeyPrefix: /trailing
13-
TrailName: Cloudtrail
14-
Type: AWS::CloudTrail::Trail
6+
GoodExample:
7+
Properties:
8+
EnableLogFileValidation: true
9+
IsLogging: true
10+
IsMultiRegionTrail: true
11+
S3BucketName: CloudtrailBucket
12+
S3KeyPrefix: /trailing
13+
TrailName: Cloudtrail
14+
Type: AWS::CloudTrail::Trail
1515
```
1616
1717

avd_docs/aws/cloudtrail/AVD-AWS-0161/CloudFormation.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ Restrict public access to the S3 bucket
33

44
```yaml
55
Resources:
6-
GoodExampleBucket:
7-
Properties:
8-
AccessControl: Private
9-
BucketName: my-bucket
10-
Type: AWS::S3::Bucket
11-
GoodExampleTrail:
12-
Properties:
13-
IsLogging: true
14-
S3BucketName: my-bucket
15-
TrailName: Cloudtrail
16-
Type: AWS::CloudTrail::Trail
6+
GoodExampleBucket:
7+
Properties:
8+
AccessControl: Private
9+
BucketName: my-bucket
10+
Type: AWS::S3::Bucket
11+
GoodExampleTrail:
12+
Properties:
13+
IsLogging: true
14+
S3BucketName: my-bucket
15+
TrailName: Cloudtrail
16+
Type: AWS::CloudTrail::Trail
1717
```
1818
1919

avd_docs/aws/cloudtrail/AVD-AWS-0162/CloudFormation.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Enable logging to CloudWatch
33

44
```yaml
55
Resources:
6-
GoodExampleTrail:
7-
Properties:
8-
CloudWatchLogsLogGroupArn: arn:aws:logs:us-east-1:123456789012:log-group:CloudTrail/DefaultLogGroup:*
9-
TrailName: Cloudtrail
10-
Type: AWS::CloudTrail::Trail
6+
GoodExampleTrail:
7+
Properties:
8+
CloudWatchLogsLogGroupArn: arn:aws:logs:us-east-1:123456789012:log-group:CloudTrail/DefaultLogGroup:*
9+
TrailName: Cloudtrail
10+
Type: AWS::CloudTrail::Trail
1111
```
1212
1313

avd_docs/aws/cloudtrail/AVD-AWS-0163/CloudFormation.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Enable access logging on the bucket
33

44
```yaml
55
Resources:
6-
GoodExampleBucket:
7-
Properties:
8-
BucketName: my-bucket
9-
LoggingConfiguration:
10-
DestinationBucketName: logging-bucket
11-
LogFilePrefix: accesslogs/
12-
Type: AWS::S3::Bucket
13-
GoodExampleTrail:
14-
Properties:
15-
IsLogging: true
16-
S3BucketName: my-bucket
17-
TrailName: Cloudtrail
18-
Type: AWS::CloudTrail::Trail
6+
GoodExampleBucket:
7+
Properties:
8+
BucketName: my-bucket
9+
LoggingConfiguration:
10+
DestinationBucketName: logging-bucket
11+
LogFilePrefix: accesslogs/
12+
Type: AWS::S3::Bucket
13+
GoodExampleTrail:
14+
Properties:
15+
IsLogging: true
16+
S3BucketName: my-bucket
17+
TrailName: Cloudtrail
18+
Type: AWS::CloudTrail::Trail
1919
```
2020
2121

0 commit comments

Comments
 (0)