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

improves: filename in remote module #867

Merged

Conversation

Rchanger
Copy link
Contributor

  • Improves the filename when the remote module is used.
  • Output of the scan of terraform directory with the remote module.
~ ./bin/terrascan scan -d  testfolder  -o json -i terraform
{
 "results": {
   "violations": [
     {
       "rule_name": "eksControlPlaneLoggingDisabled",
       "description": "Ensure EKS clusters have control plane logging enabled.",
       "rule_id": "AWS.AEC.LM.MEDIUM.0071",
       "severity": "MEDIUM",
       "category": "Logging and Monitoring",
       "resource_name": "this",
       "resource_type": "aws_eks_cluster",
       "module_name": "eks",
       "file": "git::https:/github.com/terraform-aws-modules/terraform-aws-eks?ref=v17.1.0/cluster.tf",
       "plan_root": "./",
       "line": 9
     },
     {
       "rule_name": "kmsKeyRotationDisabled",
       "description": "Ensure rotation for customer created CMKs is enabled",
       "rule_id": "AWS.AKK.DP.HIGH.0012",
       "severity": "HIGH",
       "category": "Data Protection",
       "resource_name": "kmsKeyDisabled",
       "resource_type": "aws_kms_key",
       "module_name": "sub-cloudfront",
       "file": "cloudfront/sub-cloudfront/main.tf",
       "plan_root": "cloudfront",
       "line": 1
     },
     {
       "rule_name": "imdsv1LaunchConfig",
       "description": "Launch configuration uses IMDSv1 which vulnerable to SSRF",
       "rule_id": "AC-AW-CA-LC-H-0439",
       "severity": "HIGH",
       "category": "Configuration and Vulnerability Analysis",
       "resource_name": "launch_configuration",
       "resource_type": "aws_launch_configuration",
       "module_name": "consul_servers",
       "file": "git::https:/github.com/hashicorp/terraform-aws-consul?ref=v0.1.0/modules/consul-cluster/main.tf",
       "plan_root": "./",
       "line": 48
     },
   ],
   "skipped_violations": null,
   "scan_summary": {
     "file/folder": "/Users/suvarna/testfolder",
     "iac_type": "terraform",
     "scanned_at": "2021-06-15 12:14:46.002086 +0000 UTC",
     "policies_validated": 65,
     "violated_policies": 3
     "low": 0,
     "medium": 1,
     "high": 2
   }
 }
}

@codecov
Copy link

codecov bot commented Jun 15, 2021

Codecov Report

Merging #867 (45b052d) into master (2ca5eb1) will decrease coverage by 0.01%.
The diff coverage is 77.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #867      +/-   ##
==========================================
- Coverage   78.29%   78.28%   -0.02%     
==========================================
  Files         164      164              
  Lines        4359     4388      +29     
==========================================
+ Hits         3413     3435      +22     
- Misses        730      734       +4     
- Partials      216      219       +3     
Impacted Files Coverage Δ
pkg/cli/run.go 88.88% <0.00%> (-2.54%) ⬇️
pkg/downloader/interface.go 100.00% <ø> (ø)
pkg/iac-providers/terraform/commons/load-dir.go 84.70% <80.76%> (-0.92%) ⬇️
pkg/downloader/module-download.go 82.90% <100.00%> (+0.14%) ⬆️
pkg/http-server/remote-repo.go 71.01% <100.00%> (+0.86%) ⬆️

@Rchanger Rchanger linked an issue Jun 15, 2021 that may be closed by this pull request
patilpankaj212
patilpankaj212 previously approved these changes Jun 17, 2021
Copy link
Contributor

@patilpankaj212 patilpankaj212 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !!

}
}
}
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering, why this return with insufficient return params is not causing a build failure

Copy link
Contributor Author

@Rchanger Rchanger Jun 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it won’t because I have used named return

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see it now :)

@kanchwala-yusuf
Copy link
Contributor

Hey @Rchanger ,

We may also need to cater the below use case:

$ ./bin/terrascan scan -t aws -r git -u [email protected]:accurics/KaiMonkey.git//terraform/aws
Scan Summary -
	File/Folder         :	/var/folders/qq/r4b0j3fd1gd5m8vclyc5cyy40000gn/T/myiyoc/terraform/aws
	IaC Type            :	all
	Scanned At          :	2021-06-17 11:17:43.993269 +0000 UTC
	Policies Validated  :	79
	Violated Policies   :	38
	Low                 :	5
	Medium              :	13
	High                :	20

@sonarcloud
Copy link

sonarcloud bot commented Jun 17, 2021

Kudos, SonarCloud Quality Gate passed!

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kanchwala-yusuf kanchwala-yusuf merged commit 4fd7642 into tenable:master Jun 21, 2021
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.

Improve filenames in remote modules
3 participants