Skip to main content
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.
This guide covers how to discover Terraform providers used in a Terraform project, synchronize the inventory (BOM) with SafeDep Cloud, and query for unofficial providers that may pose supply chain risks.

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

Run vet on your Terraform project to discover providers. The project must be initialized so that .terraform.lock.hcl is present in the project directory. --report-sync uploads the provider inventory to SafeDep Cloud, so set your credentials first:
Then run the scan:

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: Providers are surfaced as packages in your synced inventory, joined to the global Terraform provider registry. Anchor the query on an indexed column (here projects.origin_source) and join out to terraform_providers:

Example Response

Advanced Queries

Break providers down by tier across your GitHub projects:
For the full query language, schema, join model, and more worked examples, see the SafeDep Cloud SQL guide.

CI/CD Integration

GitHub Actions

Integrate Terraform provider auditing into your CI/CD pipeline:

GitLab CI

Policy Enforcement

Terraform provider tier (official, partner, community) lives in SafeDep Cloud’s query layer, not in Vet’s local --filter-suite engine, which evaluates package-level signals (vulnerabilities, licenses, OpenSSF Scorecard) and has no notion of provider tiers. To enforce provider policies, query the synced inventory and fail the build on disallowed providers. The Check for Unofficial Providers step in the GitHub Actions example above demonstrates this pattern: it queries terraform_providers.tier and exits non-zero when any non-official provider is present. Adapt that query to encode your approved-provider rules.

Schema Exploration

List all queryable columns for Terraform providers:
Available fields include:
  • terraform_providers.tier - Provider tier (official, partner, community)
  • terraform_providers.source - Provider source URL
  • terraform_providers.namespace - Provider namespace
  • packages.name - Full provider name
  • packages.version - Provider version

Troubleshooting

If no providers are detected:
  • Ensure .terraform.lock.hcl exists (run terraform init)
  • Verify Terraform configuration files are present
  • Check that Vet supports your Terraform version
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

Terraform Provider Registry

Browse official and community Terraform providers

SafeDep Cloud Queries

Learn more about querying your infrastructure inventory

Supply Chain Security

Learn about Terraform in the software supply chain

Vet CLI Documentation

Complete Vet CLI documentation and examples