terraform-security

Implement Terraform security best practices for secrets, state backends, and CI/CD workflows.

Updated Jan 18, 2026
One-click install
npx skills add https://github.com/333-333-333/agents --skill terraform-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-security
Source: https://github.com/333-333-333/agents/tree/main/skills/terraform-security
Command: npx skills add https://github.com/333-333-333/agents --skill terraform-security

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

Terraform security practices protect sensitive variables, secret management, state backends, and automation pipelines from leakage and misconfigurations across infrastructure deployments.

Core Features & Use Cases

  • Secrets and sensitive variables management to prevent credentials exposure
  • State protection with remote backends and access controls to avoid state leakage
  • CI/CD integration guidance and Git ignore patterns for Terraform directories to secure pipelines and workflows

Quick Start

Configure your Terraform projects to enforce secret handling, secure state backends, and safe CI/CD workflows.

Frequently Asked Questions about terraform-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent Terraform secrets and sensitive variables from leaking in my infrastructure deployments?

To prevent Terraform secrets from leaking, you must mark sensitive variables in your modules and avoid hardcoding credentials. This ensures sensitive data is protected from exposure in logs and state files during infrastructure deployments.

What is the best way to configure a remote state backend in Terraform for security?

Configuring a secure remote state backend in Terraform involves enabling access controls and encryption. This prevents unauthorized access and avoids state leakage, protecting sensitive infrastructure data stored within the state file.

How do I set up Git ignore patterns for my Terraform directories?

You set up Git ignore patterns for Terraform directories to exclude local state files and secrets from version control. This secures your CI/CD workflows by ensuring sensitive Terraform artifacts are not committed to your repository.

Does this approach work for securing Terraform CI/CD pipelines and automation workflows?

Yes, securing Terraform CI/CD pipelines is a core function of this approach. It provides integration guidance to enforce secret handling and safe workflows, protecting your automation pipelines from misconfigurations and unauthorized access.

When do I need to enforce secure state management for my Terraform modules?

You need to enforce secure state management when adding secrets to Terraform modules or configuring remote backends. This is required to prevent credential exposure and state leakage across your infrastructure deployments.

Why are my sensitive variables still showing up in Terraform plan outputs?

Sensitive variables appear in Terraform plan outputs if they are not explicitly marked as sensitive in your module definitions. Properly marking these variables ensures they are hidden from logs and terminal outputs during execution.