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

Issue with Terrascan and CloudFormation #1235

Closed
markl11 opened this issue May 4, 2022 · 1 comment · Fixed by #1238
Closed

Issue with Terrascan and CloudFormation #1235

markl11 opened this issue May 4, 2022 · 1 comment · Fixed by #1238
Assignees
Labels

Comments

@markl11
Copy link

markl11 commented May 4, 2022

  • terrascan version: v1.14.0
  • Operating System: macos (monteray/12.3)

Description

Hi, I have been told that it supports CloudFormation, but when I run 'terrascan scan' it doesn't seem to scan CloudFormation. I am doing something wrong? Does it support Cloudformation? I get errors ('panic: runtime error: invalid memory address or nil pointer dereference') when I run 'terrascan scan' against some Cloudformation (https://github.com/bridgecrewio/cfngoat). These are valid cloudformation templates (I have validated them with 'aws cloudformation validate-template' AWS CLI command). Thanks!

What I Did

% terrascan scan
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x202d43a]

goroutine 12 [running]:
github.com/accurics/terrascan/pkg/mapper/iac-providers/cft/config.GetIamUserConfig(0xc000e93590)
/home/runner/work/terrascan/terrascan/pkg/mapper/iac-providers/cft/config/iam-user.go:78 +0x21a
github.com/accurics/terrascan/pkg/mapper/iac-providers/cft.cftMapper.mapConfigForResource({}, {0x3ceefa0, 0xc000e93590}, {0xc000c42070, 0xc000d2fce0})
/home/runner/work/terrascan/terrascan/pkg/mapper/iac-providers/cft/cft.go:183 +0x49e5
github.com/accurics/terrascan/pkg/mapper/iac-providers/cft.cftMapper.Map({}, {0x3805600, 0xc000b6a120}, {0xc000b24558, 0x31113e0, 0xc0010338f0})
/home/runner/work/terrascan/terrascan/pkg/mapper/iac-providers/cft/cft.go:106 +0x157
github.com/accurics/terrascan/pkg/iac-providers/cft/v1.(*CFTV1).translateResources(0xc000637298, 0xc000754ea0, {0xc000754ea0, 0x5a})
/home/runner/work/terrascan/terrascan/pkg/iac-providers/cft/v1/load-file.go:159 +0x6e
github.com/accurics/terrascan/pkg/iac-providers/cft/v1.(*CFTV1).getConfig(0xc000754ea0, {0xc000754ea0, 0x5a}, 0xc000732290, 0x0)
/home/runner/work/terrascan/terrascan/pkg/iac-providers/cft/v1/load-file.go:86 +0xe9
github.com/accurics/terrascan/pkg/iac-providers/cft/v1.(*CFTV1).LoadIacFile(0xc000637bd8, {0xc000754ea0, 0x5a}, 0x5)
/home/runner/work/terrascan/terrascan/pkg/iac-providers/cft/v1/load-file.go:48 +0x365
github.com/accurics/terrascan/pkg/iac-providers/cft/v1.(*CFTV1).LoadIacDir(0xc00081a570, {0xc0000588c0, 0x4d}, 0xc000434cf0)
/home/runner/work/terrascan/terrascan/pkg/iac-providers/cft/v1/load-dir.go:53 +0x75c
github.com/accurics/terrascan/pkg/runtime.(*Executor).getResourceConfigs.func1({0x959d1a0, 0xc00081a570})
/home/runner/work/terrascan/terrascan/pkg/runtime/executor.go:315 +0x4b
created by github.com/accurics/terrascan/pkg/runtime.(*Executor).getResourceConfigs
/home/runner/work/terrascan/terrascan/pkg/runtime/executor.go:314 +0x6e9

@patilpankaj212
Copy link
Contributor

Hello @markl11, thanks for reporting this issue. Terrascan supports scanning cft templates.
This is a defect. The panic is occurring while mapping a cft resource to terrascan config and needs to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants