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

Extract Docker images from Terraform templates #937

Merged
merged 7 commits into from
Aug 21, 2021

Conversation

devang-gaur
Copy link
Contributor

@devang-gaur devang-gaur commented Jul 20, 2021

To test:

make build
./bin/terrascan scan -i terraform -d pkg/iac-providers/terraform/v12/testdata/terraform-k8s-provider/

closes #898

@codecov
Copy link

codecov bot commented Jul 30, 2021

Codecov Report

Merging #937 (605cf22) into master (5c6a2c1) will increase coverage by 0.05%.
The diff coverage is 82.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #937      +/-   ##
==========================================
+ Coverage   78.58%   78.63%   +0.05%     
==========================================
  Files         224      225       +1     
  Lines        5659     5781     +122     
==========================================
+ Hits         4447     4546      +99     
- Misses        932      946      +14     
- Partials      280      289       +9     
Impacted Files Coverage Δ
pkg/iac-providers/terraform/commons/load-dir.go 78.50% <ø> (ø)
pkg/iac-providers/terraform/commons/load-file.go 92.30% <ø> (ø)
...ders/terraform/commons/extract-container-images.go 79.46% <79.46%> (ø)
pkg/iac-providers/terraform/commons/resource.go 75.67% <100.00%> (+9.00%) ⬆️

@cesar-rodriguez cesar-rodriguez changed the title extract container images from tf iac files Extract Docker images from Terraform templates Aug 6, 2021
@Rchanger Rchanger force-pushed the extract_image_from_tf branch from cf95ef4 to b0aa724 Compare August 19, 2021 09:35
@Rchanger Rchanger force-pushed the extract_image_from_tf branch 2 times, most recently from cca825e to 119746e Compare August 19, 2021 14:34
@Rchanger Rchanger marked this pull request as ready for review August 19, 2021 15:16
@Rchanger Rchanger force-pushed the extract_image_from_tf branch from 119746e to d4357a7 Compare August 19, 2021 16:50
@Rchanger Rchanger force-pushed the extract_image_from_tf branch from d4357a7 to 2f94726 Compare August 20, 2021 12:27
patilpankaj212
patilpankaj212 previously approved these changes Aug 20, 2021
@sonarcloud
Copy link

sonarcloud bot commented Aug 20, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@cesar-rodriguez cesar-rodriguez merged commit 6ae1274 into tenable:master Aug 21, 2021
cesar-rodriguez pushed a commit to nasir-rabbani/terrascan that referenced this pull request Aug 22, 2021
* extract container images from tf iac files

* increase kubernetes resource scan coverage

* using constants for common strings

* adds: extract image ref from tf file

* code nits: added comments and removed unwanted variables

* adds: extracting containers from aws and azure resources

* code nits: added new method for jsoncode type

Co-authored-by: Suvarna Rokade <suvarnarokade11@gmail.com>
cesar-rodriguez pushed a commit that referenced this pull request Aug 22, 2021
* added binary based support for kustomize v2 and v3

* updated sigs.k8s.io/kustomize/api to v0.8.11 and removed depricated uses

* updated go.sum

* updated doc, added kustomize install script

* removed code smells

* added copyright message

* Extract Docker images from Terraform templates (#937)

* extract container images from tf iac files

* increase kubernetes resource scan coverage

* using constants for common strings

* adds: extract image ref from tf file

* code nits: added comments and removed unwanted variables

* adds: extracting containers from aws and azure resources

* code nits: added new method for jsoncode type

Co-authored-by: Suvarna Rokade <suvarnarokade11@gmail.com>

* Initial support for image scanning (#989)

* inital support for image vulnerability scanning

* adds: flag for vul scanning and human readable output support

* Adds: unit test cases and code refactoring

* made vulnerability methods mockable

* adds: documentation for vulnerability scanning

* adds: support google artifact registry

* updates docs

* updates flag message

* fixes: tf file image extraction and e2e test

Co-authored-by: Cesar Rodriguez <cesar@accurics.com>

* merging go.sum

* updates docs

Co-authored-by: Devang Gaur <devang.gaur@accurics.com>
Co-authored-by: Suvarna Rokade <suvarnarokade11@gmail.com>
Co-authored-by: Cesar Rodriguez <cesar@accurics.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add capability to extract references to container images in terraform
5 participants