-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(queries): update queries catalog
- Loading branch information
Showing
21 changed files
with
3,081 additions
and
2,419 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
215 changes: 215 additions & 0 deletions
215
docs/queries/cloudformation-queries/aws/1bf3b3d4-f373-4d7c-afbb-7d85948a67a5.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
--- | ||
title: DocDB Logging Is Disabled | ||
hide: | ||
toc: true | ||
navigation: true | ||
--- | ||
|
||
<style> | ||
.highlight .hll { | ||
background-color: #ff171742; | ||
} | ||
.md-content { | ||
max-width: 1100px; | ||
margin: 0 auto; | ||
} | ||
</style> | ||
|
||
- **Query id:** 1bf3b3d4-f373-4d7c-afbb-7d85948a67a5 | ||
- **Query name:** DocDB Logging Is Disabled | ||
- **Platform:** CloudFormation | ||
- **Severity:** <span style="color:#CC0">Low</span> | ||
- **Category:** Observability | ||
- **URL:** [Github](https://github.com/Checkmarx/kics/tree/master/assets/queries/cloudFormation/aws/docdb_logging_disabled) | ||
|
||
### Description | ||
DocDB logging should be enabled<br> | ||
[Documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-docdb-dbcluster.html#cfn-docdb-dbcluster-enablecloudwatchlogsexports) | ||
|
||
### Code samples | ||
#### Code samples with security vulnerabilities | ||
```json title="Postitive test num. 1 - json file" hl_lines="6" | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Resources": { | ||
"MyDocDBCluster": { | ||
"Type": "AWS::DocDB::DBCluster", | ||
"Properties": { | ||
"AvailabilityZones": ["us-east-1a", "us-east-1b"], | ||
"BackupRetentionPeriod": 30, | ||
"CopyTagsToSnapshot": true, | ||
"DBClusterIdentifier": "my-docdb-cluster", | ||
"DBClusterParameterGroupName": "default.docdb3.6", | ||
"DBSubnetGroupName": "my-docdb-subnet-group", | ||
"DeletionProtection": false, | ||
"EngineVersion": "3.6.0", | ||
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab", | ||
"MasterUsername": "mydocdbuser", | ||
"MasterUserPassword": "mysecretpassword123", | ||
"Port": 27017, | ||
"PreferredBackupWindow": "07:00-09:00", | ||
"PreferredMaintenanceWindow": "sun:05:00-sun:06:00", | ||
"StorageEncrypted": true, | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "MyDocDBCluster" | ||
} | ||
], | ||
"UseLatestRestorableTime": true, | ||
"VpcSecurityGroupIds": ["sg-0123456789abcdef0", "sg-abcdef01234567890"] | ||
} | ||
} | ||
} | ||
} | ||
|
||
``` | ||
```yaml title="Postitive test num. 2 - yaml file" hl_lines="15" | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Resources: | ||
MyDocDBCluster: | ||
Type: AWS::DocDB::DBCluster | ||
Properties: | ||
AvailabilityZones: | ||
- us-east-1a | ||
- us-east-1b | ||
BackupRetentionPeriod: 30 | ||
CopyTagsToSnapshot: true | ||
DBClusterIdentifier: my-docdb-cluster | ||
DBClusterParameterGroupName: default.docdb3.6 | ||
DBSubnetGroupName: my-docdb-subnet-group | ||
DeletionProtection: false | ||
EnableCloudwatchLogsExports: [] | ||
EngineVersion: "3.6.0" | ||
KmsKeyId: "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab" | ||
MasterUsername: mydocdbuser | ||
MasterUserPassword: mysecretpassword123 | ||
Port: 27017 | ||
PreferredBackupWindow: "07:00-09:00" | ||
PreferredMaintenanceWindow: "sun:05:00-sun:06:00" | ||
StorageEncrypted: true | ||
Tags: | ||
- Key: Name | ||
Value: MyDocDBCluster | ||
UseLatestRestorableTime: true | ||
VpcSecurityGroupIds: | ||
- sg-0123456789abcdef0 | ||
- sg-abcdef01234567890 | ||
|
||
``` | ||
```yaml title="Postitive test num. 3 - yaml file" hl_lines="15" | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Resources: | ||
MyDocDBCluster: | ||
Type: AWS::DocDB::DBCluster | ||
Properties: | ||
AvailabilityZones: | ||
- us-east-1a | ||
- us-east-1b | ||
BackupRetentionPeriod: 30 | ||
CopyTagsToSnapshot: true | ||
DBClusterIdentifier: my-docdb-cluster | ||
DBClusterParameterGroupName: default.docdb3.6 | ||
DBSubnetGroupName: my-docdb-subnet-group | ||
DeletionProtection: false | ||
EnableCloudwatchLogsExports: | ||
- error | ||
- general | ||
- profiler | ||
EngineVersion: "3.6.0" | ||
KmsKeyId: "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab" | ||
MasterUsername: mydocdbuser | ||
MasterUserPassword: mysecretpassword123 | ||
Port: 27017 | ||
PreferredBackupWindow: "07:00-09:00" | ||
PreferredMaintenanceWindow: "sun:05:00-sun:06:00" | ||
StorageEncrypted: true | ||
Tags: | ||
- Key: Name | ||
Value: MyDocDBCluster | ||
UseLatestRestorableTime: true | ||
VpcSecurityGroupIds: | ||
- sg-0123456789abcdef0 | ||
- sg-abcdef01234567890 | ||
|
||
``` | ||
<details><summary>Postitive test num. 4 - json file</summary> | ||
|
||
```json hl_lines="14" | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Resources": { | ||
"MyDocDBCluster": { | ||
"Type": "AWS::DocDB::DBCluster", | ||
"Properties": { | ||
"AvailabilityZones": ["us-east-1a", "us-east-1b"], | ||
"BackupRetentionPeriod": 30, | ||
"CopyTagsToSnapshot": true, | ||
"DBClusterIdentifier": "my-docdb-cluster", | ||
"DBClusterParameterGroupName": "default.docdb3.6", | ||
"DBSubnetGroupName": "my-docdb-subnet-group", | ||
"DeletionProtection": false, | ||
"EnableCloudwatchLogsExports": ["error", "general", "audit"], | ||
"EngineVersion": "3.6.0", | ||
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab", | ||
"MasterUsername": "mydocdbuser", | ||
"MasterUserPassword": "mysecretpassword123", | ||
"Port": 27017, | ||
"PreferredBackupWindow": "07:00-09:00", | ||
"PreferredMaintenanceWindow": "sun:05:00-sun:06:00", | ||
"StorageEncrypted": true, | ||
"Tags": [ | ||
{ | ||
"Key": "Name", | ||
"Value": "MyDocDBCluster" | ||
} | ||
], | ||
"UseLatestRestorableTime": true, | ||
"VpcSecurityGroupIds": ["sg-0123456789abcdef0", "sg-abcdef01234567890"] | ||
} | ||
} | ||
} | ||
} | ||
|
||
``` | ||
</details> | ||
|
||
|
||
#### Code samples without security vulnerabilities | ||
```yaml title="Negative test num. 1 - yaml file" | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Resources: | ||
MyDocDBCluster: | ||
Type: AWS::DocDB::DBCluster | ||
Properties: | ||
AvailabilityZones: | ||
- us-east-1a | ||
- us-east-1b | ||
BackupRetentionPeriod: 30 | ||
CopyTagsToSnapshot: true | ||
DBClusterIdentifier: my-docdb-cluster | ||
DBClusterParameterGroupName: default.docdb3.6 | ||
DBSubnetGroupName: my-docdb-subnet-group | ||
DeletionProtection: false | ||
EnableCloudwatchLogsExports: | ||
- error | ||
- general | ||
- profiler | ||
- audit | ||
EngineVersion: "3.6.0" | ||
KmsKeyId: "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab" | ||
MasterUsername: mydocdbuser | ||
MasterUserPassword: mysecretpassword123 | ||
Port: 27017 | ||
PreferredBackupWindow: "07:00-09:00" | ||
PreferredMaintenanceWindow: "sun:05:00-sun:06:00" | ||
StorageEncrypted: true | ||
Tags: | ||
- Key: Name | ||
Value: MyDocDBCluster | ||
UseLatestRestorableTime: true | ||
VpcSecurityGroupIds: | ||
- sg-0123456789abcdef0 | ||
- sg-abcdef01234567890 | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.