forked from tenable/terrascan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tenable#357 from accurics/feature/aws-serverless-r…
…egos Adds new policies/regos for AWS serverless services
- Loading branch information
Showing
12 changed files
with
104 additions
and
3 deletions.
There are no files selected for viewing
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
10 changes: 10 additions & 0 deletions
10
...cies/opa/rego/aws/aws_apigatewayv2_api/AWS.ApiGatewayV2Api.AccessControl.Medium.0630.json
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,10 @@ | ||
{ | ||
"name": "apiGatewayMiconfiguredCors", | ||
"file": "apiGatewayMiconfiguredCors.rego", | ||
"template_args": null, | ||
"severity": "Medium", | ||
"description": "Insecure Cross-Origin Resource Sharing Configuration allowing all domains", | ||
"reference_id": "AWS.ApiGatewayV2Api.AccessControl.0630", | ||
"category": "AccessControl", | ||
"version": 2 | ||
} |
8 changes: 8 additions & 0 deletions
8
pkg/policies/opa/rego/aws/aws_apigatewayv2_api/apiGatewayMiconfiguredCors.rego
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,8 @@ | ||
package accurics | ||
|
||
apiGatewayMiconfiguredCors[api.id] { | ||
api := input.aws_apigatewayv2_api[_] | ||
cors := api.config.cors_configuration[_] | ||
origins := cors.allow_origins[_] | ||
not origins == ["*"] | ||
} |
10 changes: 10 additions & 0 deletions
10
pkg/policies/opa/rego/aws/aws_apigatewayv2_stage/AWS.ApiGatewayV2Stage.Logging.Low.0630.json
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,10 @@ | ||
{ | ||
"name": "apiGatewayNoAccessLogs", | ||
"file": "apiGatewayNoAccessLogs.rego", | ||
"template_args": null, | ||
"severity": "Low", | ||
"description": "AWS API Gateway V2 Stage is missing access logs", | ||
"reference_id": "AWS.ApiGatewayV2Stage.Logging.0630", | ||
"category": "Logging", | ||
"version": 2 | ||
} |
6 changes: 6 additions & 0 deletions
6
pkg/policies/opa/rego/aws/aws_apigatewayv2_stage/apiGatewayNoAccessLogs.rego
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,6 @@ | ||
package accurics | ||
|
||
apiGatewayNoAccessLogs[stage.id] { | ||
stage := input.aws_apigatewayv2_stage[_] | ||
not stage.config.access_log_settings | ||
} |
10 changes: 10 additions & 0 deletions
10
...cies/opa/rego/aws/aws_cloudwatch/AWS.CloudWatch.EncryptionandKeyManagement.High.0632.json
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,10 @@ | ||
{ | ||
"name": "logGroupNotEncryptedWithKms", | ||
"file": "logGroupNotEncryptedWithKms.rego", | ||
"template_args": null, | ||
"severity": "HIGH", | ||
"description": "AWS CloudWatch log group is not encrypted with a KMS CMK", | ||
"reference_id": "AWS.CloudWatch.EncryptionandKeyManagement.High.0632", | ||
"category": "Encryption and Key Management", | ||
"version": 2 | ||
} |
6 changes: 6 additions & 0 deletions
6
pkg/policies/opa/rego/aws/aws_cloudwatch/logGroupNotEncryptedWithKms.rego
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,6 @@ | ||
package accurics | ||
|
||
logGroupNotEncryptedWithKms[log_group.id] { | ||
log_group := input.aws_cloudwatch_log_group[_] | ||
not log_group.config.kms_key_id | ||
} |
12 changes: 12 additions & 0 deletions
12
...rego/aws/aws_lambda_function/AWS.LambdaFunction.EncryptionandKeyManagement.High.0471.json
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,12 @@ | ||
{ | ||
"name": "lambdaNotEncryptedWithKms", | ||
"file": "lambdaNotEncryptedWithKms.rego", | ||
"template_args": { | ||
"prefix": "" | ||
}, | ||
"severity": "High", | ||
"description": "Lambda does not use KMS CMK key to protect environment variables.", | ||
"reference_id": "AWS.LambdaFunction.EncryptionandKeyManagement.0471", | ||
"category": "Encryption and Key Management", | ||
"version": 2 | ||
} |
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
12 changes: 12 additions & 0 deletions
12
pkg/policies/opa/rego/aws/aws_lambda_function/AWS.LambdaFunction.Logging.Low.0472.json
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,12 @@ | ||
{ | ||
"name": "lambdaNotInVpc", | ||
"file": "lambdaNotInVpc.rego", | ||
"template_args": { | ||
"prefix": "" | ||
}, | ||
"severity": "Low", | ||
"description": "Lambda function doesn't not include a VPC configuration.", | ||
"reference_id": "AWS.LambdaFunction.Logging.0472", | ||
"category": "Logging", | ||
"version": 2 | ||
} |
6 changes: 6 additions & 0 deletions
6
pkg/policies/opa/rego/aws/aws_lambda_function/lambdaNotEncryptedWithKms.rego
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,6 @@ | ||
package accurics | ||
|
||
lambdaNotEncryptedWithKms[lambda.id] { | ||
lambda := input.aws_lambda_function[_] | ||
not lambda.config.kms_key_arn | ||
} |
6 changes: 6 additions & 0 deletions
6
pkg/policies/opa/rego/aws/aws_lambda_function/lambdaNotInVpc.rego
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,6 @@ | ||
package accurics | ||
|
||
lambdaNotInVpc[lambda.id] { | ||
lambda := input.aws_lambda_function[_] | ||
not lambda.config.vpc_config | ||
} |