Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkov Generating Different Results in Image and Local with the same setups #6295

Open
jqlynchien713 opened this issue May 10, 2024 · 0 comments
Labels

Comments

@jqlynchien713
Copy link

Describe the issue
We run the checkov in both image (ghcr.io/antonbabenko/pre-commit-terraform:latest) and local (MacOS), but got the two different result unfortunately.

We have the AWS EIP attached to the NAT gateway(CKV2_AWS_19) and not setting the default VPC's security group to restrict all traffic(CKV2_AWS_12). The test we run in the image showed these two alerts, whereas the local test showed that all of the checks were passed. The Checkov versions are both the same, which are 3.2.90, in both environments.

The way we test with docker image is to mount the local directory into image by the following command:

docker run -it --entrypoint "" -v $PWD:/app [image_hash] bash

As for the local setup, we install Checkov through HomeBrew.

Examples
The Terraform code for CKV2_AWS_19

resource "aws_eip" "this" {
  tags = {
    Name = "${var.vpc_name}-nat"
  }
}

The result generated in local:
image

The result generated in docker container:
截圖 2024-05-10 18 00 26

Additionally, we run the tests without any customization, so there is no .checkov.yaml example file.

Desktop (please complete the following information):

  • OS: MacOS 14.0 and Docker image
  • Checkov Version: 3.2.90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant