OS Manuals

/usr/bin/tfsec

Security scanner for your Terraform code

From tfsec 1.28.14-r58 (os), captured 2026-11-07 by running tfsec --help (exit 0). permalink

======================================================
tfsec is joining the Trivy family

tfsec will continue to remain available
for the time being, although our engineering
attention will be directed at Trivy going forward.

You can read more here:
https://github.com/aquasecurity/tfsec/discussions/1994
======================================================
tfsec is a simple tool to detect potential security vulnerabilities in your terraformed infrastructure.

Usage:
  tfsec [directory] [flags]

Flags:
      --code-theme string            Theme for annotated code. Either 'light' or 'dark'. (default "dark")
      --concise-output               Reduce the amount of output and no statistics
      --config-file string           Config file to use during run
      --config-file-url string       Config file to download from a remote location. Must be json or yaml
      --custom-check-dir string      Explicitly set the custom checks dir location
      --custom-check-url string      Download a custom check file from a remote location. Must be json or yaml
      --debug                        Enable debug logging (same as verbose)
  -G, --disable-grouping             Disable grouping of similar results
  -e, --exclude string               Provide comma-separated list of rule IDs to exclude from run.
      --exclude-downloaded-modules   Remove results for downloaded modules in .terraform folder
  -E, --exclude-ignores string       Provide comma-separated list of ignored rule to exclude from run.
      --exclude-path strings         Folder path to exclude, can be used multiple times and evaluated in order of specification
      --filter-results string        Filter results to return specific checks only (supports comma-delimited input).
      --force-all-dirs               Don't search for tf files, include everything below provided directory.
  -f, --format string                Select output format: lovely, json, csv, checkstyle, junit, sarif, text, markdown, html, gif. To use multiple formats, separate with a comma and specify a base output filename with --out. A file will be written for each type. The first format will additionally be written stdout. (default "lovely")
  -h, --help                         help for tfsec
      --ignore-hcl-errors            Do not report an error if an HCL parse error is encountered
      --include-ignored              Include ignored checks in the result output
      --include-passed               Include passed checks in the result output
      --migrate-ignores              Migrate ignore codes to the new ID structure
  -m, --minimum-severity string      The minimum severity to report. One of CRITICAL, HIGH, MEDIUM, LOW.
      --no-code                      Don't include the code snippets in the output.
      --no-color                     Disable colored output (American style!)
      --no-colour                    Disable coloured output
      --no-ignores                   Do not apply any ignore rules - normally ignored checks will fail
      --no-module-downloads          Do not download remote modules.
  -O, --out string                   Set output file. This filename will have a format descriptor appended if multiple formats are specified with --format
      --print-rego-input             Print a JSON representation of the input supplied to rego policies.
      --rego-only                    Run rego policies exclusively.
      --rego-policy-dir string       Directory to load rego policies from (recursively).
      --run-statistics               View statistics table of current findings.
      --single-thread                Run checks using a single thread
  -s, --soft-fail                    Runs checks but suppresses error code
      --tfvars-file strings          Path to .tfvars file, can be used multiple times and evaluated in order of specification
      --update                       Update to latest version
      --var-file strings             Path to .tfvars file, can be used multiple times and evaluated in order of specification (same functionality as --tfvars-file but consistent with Terraform)
      --verbose                      Enable verbose logging (same as debug)
  -v, --version                      Show version information and exit
  -w, --workspace string             Specify a workspace for ignore limits (default "default")
Options (39)
OptionDescriptionSource
--code-theme stringTheme for annotated code.help
--concise-outputReduce the amount of output and no statisticshelp
--config-file stringConfig file to use during runhelp
--config-file-url stringConfig file to download from a remote location.help
--custom-check-dir stringExplicitly set the custom checks dir locationhelp
--custom-check-url stringDownload a custom check file from a remote location.help
--debugEnable debug logging (same as verbose)help
-G, --disable-groupingDisable grouping of similar resultshelp
-e, --exclude stringProvide comma-separated list of rule IDs to exclude from run.help
--exclude-downloaded-modulesRemove results for downloaded modules in .terraform folderhelp
-E, --exclude-ignores stringProvide comma-separated list of ignored rule to exclude from run.help
--exclude-path stringsFolder path to exclude, can be used multiple times and evaluated in order of specificationhelp
--filter-results stringFilter results to return specific checks only (supports comma-delimited input).help
--force-all-dirsDon't search for tf files, include everything below provided directory.help
-f, --format stringSelect output format: lovely, json, csv, checkstyle, junit, sarif, text, markdown, html, gif.help
-h, --helphelp for tfsechelp
--ignore-hcl-errorsDo not report an error if an HCL parse error is encounteredhelp
--include-ignoredInclude ignored checks in the result outputhelp
--include-passedInclude passed checks in the result outputhelp
--migrate-ignoresMigrate ignore codes to the new ID structurehelp
-m, --minimum-severity stringThe minimum severity to report.help
--no-codeDon't include the code snippets in the output.help
--no-colorDisable colored output (American style!)help
--no-colourDisable coloured outputhelp
--no-ignoresDo not apply any ignore rules - normally ignored checks will failhelp
--no-module-downloadsDo not download remote modules.help
-O, --out stringSet output file.help
--print-rego-inputPrint a JSON representation of the input supplied to rego policies.help
--rego-onlyRun rego policies exclusively.help
--rego-policy-dir stringDirectory to load rego policies from (recursively).help
--run-statisticsView statistics table of current findings.help
--single-threadRun checks using a single threadhelp
-s, --soft-failRuns checks but suppresses error codehelp
--tfvars-file stringsPath to .tfvars file, can be used multiple times and evaluated in order of specificationhelp
--updateUpdate to latest versionhelp
--var-file stringsPath to .tfvars file, can be used multiple times and evaluated in order of specification (same functionality as --tfvars-file but consistent with Terraform)help
--verboseEnable verbose logging (same as debug)help
-v, --versionShow version information and exithelp
-w, --workspace stringSpecify a workspace for ignore limits (default "default")help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.