tfsec
tfsec copied to clipboard
bug: --run-statistics ignores --format setting
Describe the bug
It seems that statistics are output in the same plain text format regardless of format setting.
To Reproduce
$ tfsec --format markdown --soft-fail --no-module-downloads --run-statistics
+---------------------------+--------------------------------+-----------------------------------------------------------------+-------+
| RULE ID | DESCRIPTION | LINK | COUNT |
+---------------------------+--------------------------------+-----------------------------------------------------------------+-------+
| aws-lambda-enable-tracing | Lambda functions should have | https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html | 1 |
| | X-Ray tracing enabled | | |
+---------------------------+--------------------------------+-----------------------------------------------------------------+-------+
$ tfsec --format json --soft-fail --no-module-downloads --run-statistics
+---------------------------+--------------------------------+-----------------------------------------------------------------+-------+
| RULE ID | DESCRIPTION | LINK | COUNT |
+---------------------------+--------------------------------+-----------------------------------------------------------------+-------+
| aws-lambda-enable-tracing | Lambda functions should have | https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html | 1 |
| | X-Ray tracing enabled | | |
+---------------------------+--------------------------------+-----------------------------------------------------------------+-------+
Expected behavior Statistics to be output in the specified format(s).
Screenshots/Output Please see above.
System Info
$ tfsec --version
v1.24.3
$ terraform --version
Terraform v1.0.11
$ uname -irso
Linux 5.4.0-113-generic x86_64 GNU/Linux
Example Code N/A
Additional context N/A
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This is now fixed upstream in defsec.