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

bug(result): false positive with variable type detection #6850

Open
cgrard opened this issue Jan 12, 2024 · 1 comment
Open

bug(result): false positive with variable type detection #6850

cgrard opened this issue Jan 12, 2024 · 1 comment
Assignees
Labels
bug Something isn't working community Community contribution docker Docker query query New query feature terraform Terraform query

Comments

@cgrard
Copy link

cgrard commented Jan 12, 2024

Expected Behavior

I expect the following variable definition to be correct, it works and every property of the object has a valid type :

variable "virtual_machines" {
  type = map(object({
    ipv4_address = string
    cpu          = number
    ram          = number
    disksize     = number
    annotation   = string
  }))
  description = "List of virtual machines to be deployed"
}

Actual Behavior

KICS detects query fc5109bf-01fd-49fb-8bde-4492b543c34a which is Variable Without Type

Oddly enough it seems to be on the disksize = number line, don't know if it is relevant

Steps to Reproduce the Problem

(Command line arguments and flags used)

  1. Build a sample terraform code as illustrated above
  2. docker run -t -v ${PWD}:/path checkmarx/kics scan --path /path/platform --output-path /path --report-formats junit --output-path /path --output-name kics.xml
  3. Result is :
Variable Without Type, Severity: INFO, Results: 1
Description: All variables should contain a valid type.
Platform: Terraform
Learn more about this vulnerability: https://docs.kics.io/latest/queries/terraform-queries/common/fc5109bf-01fd-49fb-8bde-4492b543c34a
	[1]: ../../path/platform/variables.tf:54
		053:     ram          = number
		054:     disksize     = number
		055:     annotation   = string
Results Summary:
HIGH: 0
MEDIUM: 0
LOW: 0
INFO: 1
TOTAL: 1
Results saved to file /path/junit-kics.xml
Generating Reports: Done
Scan duration: 33.981364498s

Specifications

  • Version: 1.7.12
  • Platform: Docker on Ubuntu 22.04.3 with latest checkmarx/kics image
  • Subsystem: N/A
@cgrard cgrard added bug Something isn't working community Community contribution labels Jan 12, 2024
@github-actions github-actions bot added query New query feature docker Docker query terraform Terraform query labels Jan 12, 2024
@cgrard cgrard changed the title bug(<scope>): <title starting with lowercase letter> bug: false positive with variable type detection Jan 12, 2024
@cgrard cgrard changed the title bug: false positive with variable type detection bug(terraform): false positive with variable type detection Jan 12, 2024
@cgrard cgrard changed the title bug(terraform): false positive with variable type detection bug(result): false positive with variable type detection Jan 12, 2024
@ArturRibeiro-CX
Copy link
Contributor

Hi @cgrard,

Unfortunately, we were unable to reproduce your results with KICS version 1.7.12 or the latest version, 2.0.1.

Could you kindly provide more information or a larger sample for us to address this issue? Additionally, could you test the latest KICS version, 2.0.1, to see if the problem persists? We believe it may have been resolved in this version.

Thank you!

@ArturRibeiro-CX ArturRibeiro-CX self-assigned this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community Community contribution docker Docker query query New query feature terraform Terraform query
Projects
None yet
Development

No branches or pull requests

2 participants