> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envzero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the TFsec plugin

> Integrate the tfsec plugin with env zero to scan Terraform code for security misconfigurations and built-in rule violations during deployment pipelines.

## Overview

This plugin executes the `tfsec` CLI to analyze your code and find misconfigurations and enforce built-in rules.

This plugin will install the `tfsec` binary and execute it on the given directory.

For more information, check out the [tfsec Plugin git repository](https://github.com/env0/env0-tfsec-plugin).

For an example repository that integrates the TFSec plugin, [here](https://github.com/env0/templates/tree/master/plugins/tfsec).

## Inputs

To use the tfsec plugin, [add it to a custom flow step](https://docs.envzero.com/guides/integrations/plugins.md) with the following inputs:

1. `version` (required) - the specific version of tfsec you wish to use
2. `directory` (required) - the path to the directory with the IaC code to analyze (the root folder is your project's root folder)
3. `flags` - a string containing additional flags as one string

## Further reading

* [What is tfsec: benefits, key features, and examples](https://www.envzero.com/blog/best-iac-scan-tool-what-is-tfsec)
* [Top infrastructure as code security tools](https://www.envzero.com/blog/top-infrastructure-as-code-security-tools)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.