tfsec icon indicating copy to clipboard operation
tfsec copied to clipboard

bug: --run-statistics ignores --format setting

Open sergei-ivanov opened this issue 3 years ago • 1 comments

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

sergei-ivanov avatar Jun 14 '22 13:06 sergei-ivanov

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.

github-actions[bot] avatar Jul 14 '22 15:07 github-actions[bot]

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.

github-actions[bot] avatar Aug 15 '22 15:08 github-actions[bot]

This is now fixed upstream in defsec.

liamg avatar Aug 18 '22 08:08 liamg