Connect APVISO with Terraform
Trigger APVISO scans after Terraform applies infrastructure changes. Catch security misconfigurations introduced by IaC deployments.
Why connect APVISO with Terraform?
Post-Deployment Security Validation
Automatically trigger APVISO scans after terraform apply to verify that infrastructure changes have not introduced security vulnerabilities.
Infrastructure Change Awareness
APVISO understands what changed in the Terraform plan, allowing it to focus scans on newly provisioned or modified resources.
Pre-Merge IaC Review
Integrate APVISO checks into your Terraform Cloud/Enterprise run pipeline to catch risky configurations before they are applied.
Drift Detection Security
When Terraform detects configuration drift, trigger an APVISO scan to verify whether the drift has introduced security vulnerabilities.
Setup Guide
Install the APVISO Terraform Provider
Add the APVISO provider to your Terraform configuration. The provider uses your APVISO API key to trigger and monitor scans.
Add APVISO Resources to Your Configuration
Define apviso_scan resources that specify target URLs and scan profiles. These resources trigger scans during terraform apply.
Configure Run Tasks (Terraform Cloud)
If using Terraform Cloud or Enterprise, configure APVISO as a post-apply run task that automatically scans targets after infrastructure changes.
Features
- Terraform provider for scan management via IaC
- Post-apply scan triggering for newly deployed infrastructure
- Terraform Cloud/Enterprise run task integration
- Scan results available as Terraform output values
- Plan-aware scanning focused on changed resources
- Integration with Terraform sentinel policies for security gates
- Support for Terraform OSS, Cloud, and Enterprise
How APVISO Will Integrate with Terraform
The planned APVISO Terraform integration will connect infrastructure provisioning with security validation, ensuring that every infrastructure change is automatically tested for vulnerabilities. As organizations adopt Infrastructure as Code, the speed of infrastructure changes accelerates — and so does the risk of introducing security misconfigurations that only dynamic testing can catch.
Post-Apply Security Scanning
The core workflow is straightforward: after terraform apply provisions or modifies infrastructure, APVISO automatically scans the affected targets. For example, if Terraform provisions a new load balancer with a public endpoint, APVISO immediately tests that endpoint for vulnerabilities — TLS configuration, HTTP security headers, exposed management interfaces, and application-level vulnerabilities.
This post-apply scanning catches issues that static IaC analysis cannot detect. Static tools like tfsec and Checkov analyze your Terraform code for known misconfigurations, but they cannot test the actual behavior of the deployed application. APVISO's dynamic testing verifies that the real, running infrastructure is secure — not just that the configuration looks correct.
Terraform Provider for Declarative Scan Management
The APVISO Terraform provider will allow you to manage scans as Terraform resources. Define an apviso_scan resource that specifies a target URL, scan profile, and severity threshold. When you run terraform apply, the scan is triggered. The resource tracks the scan status, and terraform output exposes the scan results — finding counts by severity, scan duration, and a link to the full report.
This declarative approach means your security scanning configuration lives alongside your infrastructure configuration, versioned in the same repository and reviewed in the same pull requests. Changes to scanning policy are visible, auditable, and reproducible.
Terraform Cloud Run Tasks
For organizations using Terraform Cloud or Terraform Enterprise, APVISO will integrate as a run task. Run tasks are triggered at specific points in the Terraform Cloud workflow — during planning, after applying, or both. APVISO's run task triggers a scan after the apply phase completes and reports results back to Terraform Cloud.
The run task result can be configured as advisory (informational) or mandatory (blocks subsequent operations). In a mandatory configuration, if APVISO discovers Critical vulnerabilities in the newly deployed infrastructure, the Terraform Cloud run is marked as failed. This does not roll back the infrastructure change (the apply has already completed), but it prevents dependent workspaces from applying their changes until the security issue is resolved.
Plan-Aware Targeted Scanning
A full penetration test after every terraform apply would be time-consuming and wasteful. The APVISO Terraform integration can read the plan output to determine what changed and scope the scan accordingly:
- If a new public-facing resource was created, scan its endpoints comprehensively
- If an existing security group was modified, focus on testing the affected ports and protocols
- If only internal resources changed (no public exposure), skip the scan or run a reduced-scope check
This plan-aware approach reduces scan time from hours to minutes for incremental infrastructure changes while maintaining comprehensive coverage for significant deployments.
Sentinel Policy Integration
Terraform Cloud's Sentinel policy framework can incorporate APVISO scan results into policy decisions. Write Sentinel policies that enforce security requirements based on APVISO data. For example, a policy might require that all public-facing infrastructure must pass an APVISO scan with no Critical findings before the workspace is considered compliant. Combined with Sentinel's governance capabilities, this creates a powerful security gate at the infrastructure layer.
Drift Detection and Continuous Validation
Infrastructure drift — when the actual state of deployed resources diverges from the Terraform configuration — can introduce security vulnerabilities. When Terraform Cloud detects drift during scheduled checks, APVISO can automatically scan the affected resources to determine whether the drift has security implications. This continuous validation approach ensures that security testing covers not just planned changes but also unplanned modifications to your infrastructure.
Complementing Static IaC Analysis
The APVISO Terraform integration is designed to complement, not replace, static IaC security tools. A comprehensive infrastructure security strategy uses both approaches: static analysis catches misconfigurations in the code before deployment (shift left), while APVISO's dynamic testing verifies the actual security posture of the running infrastructure (validate right). Together, they provide defense in depth for your infrastructure pipeline.
Frequently Asked Questions
When will the Terraform integration be available?▾
The Terraform integration is on our roadmap. Join the waitlist in APVISO Settings > Integrations to be notified when it becomes available.
Does this replace static IaC scanning tools like tfsec?▾
No. Static IaC scanning (tfsec, Checkov) analyzes your Terraform code for misconfigurations before deployment. APVISO performs dynamic penetration testing against the deployed infrastructure. They are complementary — use both for comprehensive coverage.
Can I scan only the resources that changed?▾
Yes. The integration can read the Terraform plan output to determine which resources were created or modified, and focus the APVISO scan on the corresponding targets. This reduces scan time for incremental infrastructure changes.
Will scan failures cause terraform apply to fail?▾
The scan runs post-apply, so it does not block the infrastructure change. However, you can configure Terraform Cloud run tasks to mark the run as failed based on APVISO findings, preventing subsequent dependent runs.
Related Integrations
Related Terms
Terraform integration coming soon
Join the waitlist to be notified when the Terraform integration is available.
Join Waitlist