Skip to content

Commit

Permalink
Fix or annotate/ignore checkov issues above low
Browse files Browse the repository at this point in the history
  • Loading branch information
fgogolli committed Dec 6, 2023
1 parent 679a407 commit 6245a0e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/conf/checkov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ soft-fail: true
skip-check:
- CKV_TF_1 # "Ensure Terraform module sources use a commit hash"
- CKV_K8S_21 # "The default namespace should not be used"
- CKV_AWS_18 # "Ensure the S3 bucket has access logging enabled"
- CKV_DOCKER_2 # "Ensure that HEALTHCHECK instructions have been added to container images"
2 changes: 1 addition & 1 deletion deployment/dev_environment_cloud9/cfn/.trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
AVD-AWS-0132
AVD-AWS-0088
AVD-AWS-0132
AVD-AWS-0090
AVD-AWS-0090
6 changes: 6 additions & 0 deletions deployment/dev_environment_cloud9/cfn/cloud9-htc-grid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ Resources:
C9OutputBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Delete
Properties:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true

C9OutputBucketPolicy:
Type: 'AWS::S3::BucketPolicy'
Expand Down
7 changes: 6 additions & 1 deletion deployment/grid/terraform/control_plane/openapi_private.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ resource "aws_cloudwatch_log_group" "htc_private_api_cloudwatch_log_group" {
}


#checkov:skip=CKV_AWS_237: Create before destroy already implemented in the deployment
resource "aws_api_gateway_rest_api" "htc_private_api" {

Check failure on line 59 in deployment/grid/terraform/control_plane/openapi_private.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV_AWS_237: "Ensure Create before destroy for API GATEWAY"
name = "htc-private-api-${var.cluster_name}"

Expand All @@ -72,6 +73,7 @@ resource "aws_api_gateway_rest_api" "htc_private_api" {
}

Check failure

Code scanning / checkov

Ensure Create before destroy for API GATEWAY Error

Ensure Create before destroy for API GATEWAY


#checkov:skip=CKV_AWS_237: Create before destroy already implemented
resource "aws_api_gateway_deployment" "htc_private_api_deployment" {
rest_api_id = aws_api_gateway_rest_api.htc_private_api.id

Expand All @@ -94,7 +96,8 @@ resource "aws_api_gateway_deployment" "htc_private_api_deployment" {
]
}


#checkov:skip=CKV_AWS_120: API Gateway caching wouldn't work for this API
#checkov:skip=CKV2_AWS_51:[TODO] Client certificate authentication will be implemented instead of Cognito
resource "aws_api_gateway_stage" "htc_private_api_stage" {

Check failure on line 101 in deployment/grid/terraform/control_plane/openapi_private.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV_AWS_120: "Ensure API Gateway caching is enabled"

Check failure on line 101 in deployment/grid/terraform/control_plane/openapi_private.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV2_AWS_51: "Ensure AWS API Gateway endpoints uses client certificate authentication"
rest_api_id = aws_api_gateway_rest_api.htc_private_api.id
deployment_id = aws_api_gateway_deployment.htc_private_api_deployment.id
Expand All @@ -113,6 +116,8 @@ resource "aws_api_gateway_stage" "htc_private_api_stage" {
]
}

Check failure

Code scanning / checkov

Ensure API Gateway caching is enabled Error

Ensure API Gateway caching is enabled

Check failure

Code scanning / checkov

Ensure AWS API Gateway endpoints uses client certificate authentication Error

Ensure AWS API Gateway endpoints uses client certificate authentication

#checkov:skip=CKV_AWS_308: API Gateway method setting caching encryption wouldn't work for this API
#checkov:skip=CKV_AWS_225: API Gateway method setting caching wouldn't work for this API
resource "aws_api_gateway_method_settings" "htc_private_api_method_settings" {

Check failure on line 121 in deployment/grid/terraform/control_plane/openapi_private.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV_AWS_308: "Ensure API Gateway method setting caching is set to encrypted"

Check failure on line 121 in deployment/grid/terraform/control_plane/openapi_private.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV_AWS_225: "Ensure API Gateway method setting caching is enabled"
rest_api_id = aws_api_gateway_rest_api.htc_private_api.id
stage_name = aws_api_gateway_stage.htc_private_api_stage.stage_name
Expand Down
8 changes: 8 additions & 0 deletions deployment/grid/terraform/control_plane/openapi_public.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ resource "aws_cloudwatch_log_group" "htc_public_api_cloudwatch_log_group" {
}


#checkov:skip=CKV_AWS_237: Create before destroy already implemented in the deployment
resource "aws_api_gateway_rest_api" "htc_public_api" {

Check failure on line 59 in deployment/grid/terraform/control_plane/openapi_public.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV_AWS_237: "Ensure Create before destroy for API GATEWAY"
name = "htc-public-api-${var.cluster_name}"

Expand All @@ -73,6 +74,7 @@ resource "aws_api_gateway_rest_api" "htc_public_api" {
}

Check failure

Code scanning / checkov

Ensure Create before destroy for API GATEWAY Error

Ensure Create before destroy for API GATEWAY


#checkov:skip=CKV_AWS_237: Create before destroy already implemented
resource "aws_api_gateway_deployment" "htc_public_api_deployment" {
rest_api_id = aws_api_gateway_rest_api.htc_public_api.id

Expand All @@ -93,6 +95,9 @@ resource "aws_api_gateway_deployment" "htc_public_api_deployment" {
}


#checkov:skip=CKV_AWS_120: API Gateway caching wouldn't work for this API
#checkov:skip=CKV2_AWS_51:[TODO] Client certificate authentication will be implemented instead of Cognito
#checkov:skip=CKV2_AWS_29:[TODO] WAF Protection will be added for the public API
resource "aws_api_gateway_stage" "htc_public_api_stage" {

Check failure on line 101 in deployment/grid/terraform/control_plane/openapi_public.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV_AWS_120: "Ensure API Gateway caching is enabled"
rest_api_id = aws_api_gateway_rest_api.htc_public_api.id
deployment_id = aws_api_gateway_deployment.htc_public_api_deployment.id
Expand All @@ -111,6 +116,9 @@ resource "aws_api_gateway_stage" "htc_public_api_stage" {
]
}

Check failure

Code scanning / checkov

Ensure API Gateway caching is enabled Error

Ensure API Gateway caching is enabled

Check failure

Code scanning / checkov

Ensure AWS API Gateway endpoints uses client certificate authentication Error

Ensure AWS API Gateway endpoints uses client certificate authentication

Check failure

Code scanning / checkov

Ensure public API gateway are protected by WAF Error

Ensure public API gateway are protected by WAF


#checkov:skip=CKV_AWS_308: API Gateway method setting caching encryption wouldn't work for this API
#checkov:skip=CKV_AWS_225: API Gateway method setting caching wouldn't work for this API
resource "aws_api_gateway_method_settings" "htc_public_api_method_settings" {

Check failure on line 122 in deployment/grid/terraform/control_plane/openapi_public.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV_AWS_308: "Ensure API Gateway method setting caching is set to encrypted"

Check failure on line 122 in deployment/grid/terraform/control_plane/openapi_public.tf

View workflow job for this annotation

GitHub Actions / checkov

CKV_AWS_225: "Ensure API Gateway method setting caching is enabled"
rest_api_id = aws_api_gateway_rest_api.htc_public_api.id
stage_name = aws_api_gateway_stage.htc_public_api_stage.stage_name
Expand Down
2 changes: 1 addition & 1 deletion deployment/grid/terraform/control_plane/redis.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ resource "random_password" "htc_data_cache_password" {
min_special = 1
}


#checkov:skip=CKV2_AWS_50:[TODO] Make HTC Data Cache Multi AZ Configrable
resource "aws_elasticache_replication_group" "htc_data_cache" {
replication_group_id = "htc-data-cache-${lower(local.suffix)}"
description = "Replication group for htc_data_cache cluster"
Expand Down

0 comments on commit 6245a0e

Please sign in to comment.