Truth in IT
    • Sign In
    • Register
        • Videos
        • Channels
        • Pages
        • Galleries
        • News
        • Events
        • All
Truth in IT Truth in IT
  • Data Management ▼
    • Converged Infrastructure
    • DevOps
    • Networking
    • Storage
    • Virtualization
  • Cybersecurity ▼
    • Application Security
    • Backup & Recovery
    • Data Security
    • Identity & Access Management (IAM)
    • Zero Trust
    • Compliance & GRC
    • Endpoint Security
  • Cloud ▼
    • Hybrid Cloud
    • Private Cloud
    • Public Cloud
  • Webinar Library
  • TiPs
  • DRAW

tfsec Security Scanner for Terraform: Features & Examples

envzero
03/29/2026
0 (0%)
Share
  • Comments
  • Download
  • Transcript
Report Like Favorite
  • Share/Embed
  • Email
Link
Embed

Transcript


that. Let's clear here and look at our TFSEC guide here. So the command that you'd run for TFSEC is very simple. You just run TFSEC and then the directory that you want to scan. So in this case we are going to scan the Terraform directory. So once again here we go we got our TFSEC output and you can see that it gives you a summary, a nice summary at the very end. It tells you the results so we've got six past policies, zero ignored, five critical, 18 high, four medium and six low. So a total of 33 potential problems have been detected and this is all open source out of the box. There is no API or anything like that that I'm running so that is available completely open source. Now you can see each one of those policies, you can see the results, low security, this is a low vulnerability, security group rule does not have a description and gives you the file, exactly the location, an ID for this check, the impact, the resolution, add descriptions for all security group rules. So it's a nice touch here giving you the resolution right in the CLI and of course more information. And TFSEC is backed by Aqua security so you can see some of the docs have Aqua security in it right here and you can follow these links for more information. Now you can also similar to what we saw with checkoff, you can specify a particular output format. So in this case we are going to output everything in JSON as you can see here. And you can also exclude certain checks by specifying the check ID as shown in this command. So I can go ahead and run this command with the exclude flag and exclude a particular check and now we can see that we've ignored two checks right here. Okay and now we have only 31 potential problems. Alright so that's it for the built-in policies by TFSEC. Now let's take a look at a custom policy and we're going to do the same thing we did with checkoff. So basically the exact same scenario where we have a an S3 bucket that has a PCI requirement with scope PCI that tag we saw and also we have the public read in the ACL of that S3 bucket. So once again we can just run this and TFSEC against the Terraform folder and let's look for this PCI policy tfchecks.yaml in the .tfsec folder. So by default if you create a .tfsec folder inside the the folder that you're scanning which is the Terraform folder, it's going to create or you can put the PCI policy here that we just mentioned. So any custom policies that are here will be scanned automatically by .tfsec. And this is using YAML. There are two ways of using custom policy with .tfsec. You can use YAML or a Rego policy or Rego. It's spelled R-E-G-O but it's pronounced Rego from OPA. In this case I opted to use a YAML. It could be YAML or it could be JSON. I'm using YAML here and I give it the code or the check ID if you will of custom or CUS999 and give it a description. Make sure S3 bucket ACL is not public read if it has a scope equals to PCI tag. You can give it an impact, a message, a resolution. The required type is resource. The required label is AWS S3 bucket. Severity in this case I chose critical. And a match spec. So we're matching if any of these happen. So if it doesn't contain tags with the key scope and the value PCI or if it doesn't contain an ACL with a value of public read. So we're actually looking for this to pass right. So if any of this doesn't contain tags or it doesn't contain this public read it will pass the check right. So you got to think of it in the opposite way. And now if I go ahead and search for 999 I will see here we go our custom CUS999 check has failed and it's a critical check and the message that we put it in the description here shows up as well. And here is our resource and once again the particular file and so on. So this is how you create a custom check or custom policy inside of TFSEC.

TL;DR

  • tfsec is an open-source security scanner for Terraform that performs static analysis to detect misconfigurations and security risks without requiring API access or external services
  • The tool provides built-in policies with severity classifications (critical, high, medium, low) and offers detailed remediation guidance directly in the CLI output
  • Custom policies can be created using YAML or Rego (OPA) and are automatically detected when placed in a .tfsec folder within the scanned directory

Summary

This tutorial demonstrates tfsec, an open-source security scanner for Terraform infrastructure-as-code. The tool performs static analysis to detect misconfigurations and security risks before deployment. The demonstration covers basic scanning workflows, output formatting options, policy exclusion capabilities, and custom policy creation using YAML. tfsec is backed by Aqua Security and provides out-of-the-box security checks with severity classifications ranging from low to critical. The tutorial includes a practical example of creating a custom policy to enforce PCI compliance requirements for AWS S3 buckets, showing how organizations can extend the tool's built-in ruleset to meet specific security and compliance needs.

Chapters

0:00 - Introduction to tfsec
0:27 - Running Basic tfsec Scan
1:49 - Output Formats and Exclusions
2:28 - Custom Policy Creation with YAML

Key Quotes

0:56 "... a total of 33 potential problems have been detected and this is all open source out of the Box. There is no API or anything like that that I'm running so that is available completely open source."
1:28 "... it's a NICE touch here giving you the resolution right in the CLI ..."
1:38 "TFSEC is backed by Aqua security so you can see some of the docs have Aqua security in it ..."
Categories:
  • » Webinar Library » envzero
  • » Cybersecurity » Application Security
  • » Cybersecurity » Cloud Security
  • » Data Protection
Channels:
News:
Events:
Tags:
  • Cloud Security
  • DevSecOps
  • Compliance & Governance
  • How-To
  • Technical Deep Dive
  • Infrastructure as Code Security
  • Terraform Security Scanning
  • Static Code Analysis
  • Security Policy Enforcement
  • Cloud Security Misconfiguration Detection
  • PCI Compliance
Show more Show less

Browse videos

  • Related
  • Featured
  • By date
  • Most viewed
  • Top rated
  •  

              Video's comments: tfsec Security Scanner for Terraform: Features & Examples

              XStreaminars (watch here)

              • Aug
                27

                Becoming Agent Ready with Cyera: Essential Strategies and Insights

                08/27/202601:00 PM ET
                • Sep
                  03

                  Verge.io: Can You Afford Your Next Storage Refresh?

                  09/03/202601:00 PM ET
                  More events

                  Industry Events (Sponsor Hosted)

                  • Aug
                    13

                    Innovative Security Solutions with Netskope & Omada in Enterprise AI

                    08/13/202612:00 PM ET
                    • Aug
                      27

                      Summer of Satori: FunFoneFarm's Transformation of Fraud into Seamless Integration

                      08/27/202601:00 PM ET
                      More events

                      Upcoming Webinar Calendar

                      • 08/13/2026
                        12:00 PM
                        08/13/2026
                        Innovative Security Solutions with Netskope & Omada in Enterprise AI
                        https://www.truthinit.com/index.php/channel/2065/innovative-security-solutions-with-netskope-omada-in-enterprise-ai/
                      • 08/27/2026
                        01:00 PM
                        08/27/2026
                        Becoming Agent Ready with Cyera: Essential Strategies and Insights
                        https://www.truthinit.com/index.php/channel/2081/becoming-agent-ready-with-cyera-essential-strategies-and-insights/
                      • 08/27/2026
                        01:00 PM
                        08/27/2026
                        Summer of Satori: FunFoneFarm's Transformation of Fraud into Seamless Integration
                        https://www.truthinit.com/index.php/channel/2086/summer-of-satori-funfonefarms-transformation-of-fraud-into-seamless-integration/
                      • 09/02/2026
                        12:00 PM
                        09/02/2026
                        Unified Data Security in Action: Uncover, Analyze, and Resolve Threats
                        https://www.truthinit.com/index.php/channel/2045/unified-data-security-in-action-uncover-analyze-and-resolve-threats/
                      • 09/03/2026
                        01:00 PM
                        09/03/2026
                        Verge.io: Can You Afford Your Next Storage Refresh?
                        https://www.truthinit.com/index.php/channel/2082/verge-io-can-you-afford-your-next-storage-refresh/
                      • 09/30/2026
                        04:00 AM
                        09/30/2026
                        AI Command Center: Optimizing Visibility and Control in Your Operations
                        https://www.truthinit.com/index.php/channel/2024/ai-command-center-optimizing-visibility-and-control-in-your-operations/
                      • 11/19/2026
                        01:00 PM
                        11/19/2026
                        360View: Govern, Secure & Recover Your Microsoft 365 Environment
                        https://www.truthinit.com/index.php/channel/2076/360view-govern-secure-recover-your-microsoft-365-environment/
                      Truth in IT
                      • Sponsor
                      • About Us
                      • Terms of Service
                      • Privacy Policy
                      • Contact Us
                      • Preference Management
                      Desktop version
                      Standard version