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

Error with XML output #290

Closed
nightwatchcyber opened this issue Aug 18, 2020 · 2 comments · Fixed by #291
Closed

Error with XML output #290

nightwatchcyber opened this issue Aug 18, 2020 · 2 comments · Fixed by #291
Labels

Comments

@nightwatchcyber
Copy link

nightwatchcyber commented Aug 18, 2020

  • terrascan version: 1.0.0
  • Python version: 3.8.5
  • Operating System: MacOS 10.15.6 (Catalina)

Description

Getting error with XML output option - getting the following error:

2020-08-17T20:35:08.082-0400	error
writer/xml.go:39	
failed to write XML output. error: 'xml: unsupported type: results.Violation'

What I Did

/terrascan scan -t aws -o xml
@cesar-rodriguez
Copy link
Contributor

I was able to replicate this issue

$ terrascan scan -t aws --output xml
2020-08-17T21:16:15.849-0400	error	writer/xml.go:39	failed to write XML output. error: 'xml: unsupported type: results.Violation'

@kanchwala-yusuf
Copy link
Contributor

Raised a PR #291 ,

The xml output would look like:

<results>
  <violations>
    <violation rule_name="cloudfrontNoLogging" description="Ensure that your AWS Cloudfront distributions have the Logging feature enabled in order to track all viewer requests for the content delivered through the Content Delivery Network (CDN)." rule_id="AWS.CloudFront.Logging.Medium.0567" severity="MEDIUM" category="Logging" resource_name="s3-distribution-TLS-v1" resource_type="aws_cloudfront_distribution" file="aws_cloudfront_distribution.tf" line="7"></violation>
    <violation rule_name="cloudfrontNoSecureCiphers" description="Secure ciphers are not used in CloudFront distribution" rule_id="AWS.CloudFront.EncryptionandKeyManagement.High.0408" severity="HIGH" category="Encryption and Key Management" resource_name="s3-distribution-TLS-v1" resource_type="aws_cloudfront_distribution" file="aws_cloudfront_distribution.tf" line="7"></violation>
    <violation rule_name="cloudfrontNoHTTPSTraffic" description="Use encrypted connection between CloudFront and origin server" rule_id="AWS.CloudFront.EncryptionandKeyManagement.High.0407" severity="HIGH" category="Encryption and Key Management" resource_name="s3-distribution-TLS-v1" resource_type="aws_cloudfront_distribution" file="aws_cloudfront_distribution.tf" line="7"></violation>
    <violation rule_name="cloudfrontNoHTTPSTraffic" description="Use encrypted connection between CloudFront and origin server" rule_id="AWS.CloudFront.EncryptionandKeyManagement.High.0407" severity="HIGH" category="Encryption and Key Management" resource_name="s3-distribution-TLS-v1" resource_type="aws_cloudfront_distribution" file="aws_cloudfront_distribution.tf" line="7"></violation>
    <violation rule_name="cloudfrontNoGeoRestriction" description="Ensure that geo restriction is enabled for your Amazon CloudFront CDN distribution to whitelist or blacklist a country in order to allow or restrict users in specific locations from accessing web application content." rule_id="AWS.CloudFront.Network Security.Low.0568" severity="LOW" category="Network Security" resource_name="s3-distribution-TLS-v1" resource_type="aws_cloudfront_distribution" file="aws_cloudfront_distribution.tf" line="7"></violation>
  </violations>
  <count low="1" medium="1" high="3" total="5"></count>
</results>

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.

3 participants