To follow this guide you need a SafeDep Cloud API Key and Tenant Identifier. See Cloud Quickstart on how to onboard to SafeDep Cloud and get an API key.
Why Audit Terraform Providers?
Supply Chain Security
Unofficial providers may lack security oversight and could introduce vulnerabilities
Compliance Requirements
Many organizations require approved provider lists for infrastructure code
Risk Management
Understand the security posture of your infrastructure dependencies
Centralized Visibility
Get organization-wide visibility into Terraform provider usage
Prerequisites
vet
installed (see quickstart for installation options)- SafeDep Cloud account with API key and tenant identifier
- Terraform project with initialized providers (
.terraform.lock.hcl
must exist)
Scan and Discover Terraform Providers
Runvet
on your Terraform codebase to scan for Terraform providers. The Terraform project must be initialized so that .terraform.lock.hcl
is available in the project directory.
What This Command Does
1
Provider Discovery
Scans Terraform configuration files and lock files to identify all providers
2
Metadata Collection
Gathers information about provider versions, sources, and tiers (official, partner, community)
3
Cloud Synchronization
Uploads the provider inventory to SafeDep Cloud for centralized analysis
4
Project Tracking
Associates findings with specific projects and versions for tracking over time
Query Provider Inventory
Use SafeDep Cloud SQL queries to analyze your Terraform provider inventory. See SafeDep Cloud Quickstart for more details on the query interface.Find Unofficial Terraform Providers
Query for providers that are not officially maintained by HashiCorp:Example Response
Here’s an example response from our test repository:Advanced Queries
Provider Tier Analysis
Get a breakdown of providers by their tier classification:Community Provider Risk Assessment
Find community providers that might need additional security review:Provider Version Consistency
Check for version inconsistencies across projects:Recent Provider Additions
Find recently added providers (useful for change tracking):CI/CD Integration
GitHub Actions
Integrate Terraform provider auditing into your CI/CD pipeline:GitLab CI
Policy Enforcement
Custom Provider Policies
Create policies to enforce provider compliance:Schema Exploration
List all queryable columns for Terraform providers:terraform_providers.tier
- Provider tier (official, partner, community)terraform_providers.source
- Provider source URLterraform_providers.namespace
- Provider namespacepackages.name
- Full provider namepackages.version
- Provider version
Best Practices
Regular Audits
Regular Audits
Schedule regular provider audits:
- Weekly scans for critical infrastructure
- On every Terraform configuration change
- Before major deployments
Provider Approval Process
Provider Approval Process
Establish a formal process for approving new providers:
- Security review for community providers
- Documentation of approved providers
- Regular review of existing approvals
Version Management
Version Management
Track provider versions carefully:
- Pin provider versions in production
- Test new versions in staging environments
- Monitor for security updates
Troubleshooting
No Providers Found
No Providers Found
If no providers are detected:
- Ensure
.terraform.lock.hcl
exists (runterraform init
) - Verify Terraform configuration files are present
- Check that vet supports your Terraform version
Sync Issues
Sync Issues
If synchronization to SafeDep Cloud fails:
- Verify API key and tenant ID are correct
- Check network connectivity to SafeDep Cloud
- Ensure project name doesn’t contain special characters