Add policy context to your infrastructure changes. Run Conftest/OPA policies and submit violations as organized policy signals to enhance Overmind's risk analysis - all in parallel with your terraform analysis.
Watch a demo | Documentation | Sign up | Follow us
Add policy checks to your Overmind workflow in under 2 minutes. This action runs your Conftest/OPA policies and submits violations as organized "Policies" signals, giving you immediate feedback on compliance issues while terraform analysis runs in parallel.
- uses: overmindtech/policy-signals-action@v1
with:
policies-path: './policies'
overmind-api-key: ${{ secrets.OVM_API_KEY }}
This GitHub Action enhances your Overmind change analysis by:
- Running policy checks immediately when a PR is created/updated
- Submitting violations as organized policy signals to Overmind (in parallel with terraform analysis)
- Providing instant feedback on compliance issues (typically within 30 seconds)
- Enriching the PR comment with policy context alongside blast radius analysis
Overmind aggregates Custom Signals by title, not just PR URL and handles the generation of the Signal summary.
- An Overmind account (sign up free)
- Overmind API key stored as
OVM_API_KEY
in your GitHub secrets - Terraform repository with policy files (Rego format)
- A GitHub Pull Request (Custom Signals are linked to PRs, not standalone)
- Add the action to your workflow (
.github/workflows/terraform.yml
):
name: Terraform Analysis with Policies
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
# Your existing terraform job continues unchanged
terraform:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: overmindtech/actions/install-cli@main
- uses: overmindtech/actions/submit-plan@main
with:
ovm-api-key: ${{ secrets.OVM_API_KEY }}
plan-json: ./tfplan.json
# NEW: Add policy checks in parallel
policy-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: overmindtech/policy-signals-action@v1
with:
policies-path: './policies'
overmind-api-key: ${{ secrets.OVM_API_KEY }}
- Create your first policy (
policies/s3-tags.rego
):
package terraform.s3
deny[msg] {
resource := input.resource_changes[_]
resource.type == "aws_s3_bucket"
not resource.change.after.tags.Owner
msg := sprintf("S3 bucket %s missing required 'Owner' tag", [resource.address])
}
deny[msg] {
resource := input.resource_changes[_]
resource.type == "aws_s3_bucket"
not resource.change.after.tags.Environment
msg := sprintf("S3 bucket %s missing required 'Environment' tag", [resource.address])
}
- Push changes and watch the magic happen! Policy violations will appear in your PR comment within seconds.
Input | Description | Required | Default |
---|---|---|---|
policies-path |
Path to your Conftest/OPA policy files | Yes | - |
overmind-api-key |
Your Overmind API key | Yes | - |
terraform-plan-json |
Path to terraform plan JSON (if available) | No | Auto-detected |
signal-severity |
Default severity for policy violations (-5 to +5) | No | -3 |
signal-category |
Category for organizing policy signals in Overmind | No | Policies |
ticket-link |
Custom URL to link signals to (e.g., Terraform Cloud run) | No | GitHub PR URL |
fail-on-violations |
Fail the action if violations are found | No | false |
conftest-version |
Version of Conftest to install | No | 0.46.0 |
overmind-cli-version |
Version of Overmind CLI to install | No | 1.9.4 |
- uses: overmindtech/policy-signals-action@v1
with:
policies-path: './policies'
overmind-api-key: ${{ secrets.OVM_API_KEY }}
terraform-plan-json: './tfplan.json'
signal-severity: -4 # Higher risk score for violations
signal-category: 'Security Policies' # Custom category
ticket-link: 'https://app.terraform.io/app/org/workspace/runs/run-xyz' # Terraform Cloud run
fail-on-violations: true # Block PR on policy violations
The ticket-link
input is particularly useful for Terraform Cloud workflows:
- uses: overmindtech/policy-signals-action@v1
with:
policies-path: './policies'
overmind-api-key: ${{ secrets.OVM_API_KEY }}
ticket-link: ${{ env.TF_CLOUD_RUN_URL }} # Links signals to TFC run instead of GitHub PR
package terraform.security
deny[msg] {
resource := input.resource_changes[_]
resource.type == "aws_security_group_rule"
resource.change.after.cidr_blocks[_] == "0.0.0.0/0"
resource.change.after.from_port == 22
msg := sprintf("Security group %s allows SSH from anywhere", [resource.address])
}
package terraform.cost
allowed_instance_types := [
"t3.micro", "t3.small", "t3.medium"
]
deny[msg] {
resource := input.resource_changes[_]
resource.type == "aws_instance"
not resource.change.after.instance_type in allowed_instance_types
msg := sprintf("Instance %s uses non-approved type: %s",
[resource.address, resource.change.after.instance_type])
}
package terraform.compliance
deny[msg] {
resource := input.resource_changes[_]
resource.type == "aws_db_instance"
not resource.change.after.storage_encrypted
msg := sprintf("RDS instance %s has unencrypted storage", [resource.address])
}
graph LR
PR[Pull Request] --> GHA[GitHub Actions]
GHA --> P1[Policy Checks<br/>30 seconds]
GHA --> P2[Terraform Analysis<br/>3 minutes]
P1 --> CS[Custom Signals]
P2 --> BR[Blast Radius]
CS --> OV[Overmind Platform]
BR --> OV
OV --> Comment[Enhanced PR Comment]
- PR triggers workflow - Both terraform analysis and policy checks start
- Policies run immediately - Conftest evaluates your terraform plan
- Violations become signals - Each violation is submitted as a Custom Signal linked to the PR URL
- Overmind aggregates - All signals for that PR are collected together
- Progressive updates - PR comment updates as signals arrive
- Complete context - Final comment includes both policy and blast radius info
Note: Custom Signals are always linked to a Pull Request URL. This allows Overmind to aggregate all signals (policy violations, terraform risks, etc.) in one place.
We welcome contributions! Please see our Contributing Guide for details.
We provide two testing approaches for different stages of development:
Test your policies work correctly without submitting to Overmind:
# Test policies catch violations in your terraform plan
./test/test-policies.sh ./policies ./tfplan.json
# This will show you what violations would be caught
# but won't submit anything to Overmind
To test the complete flow with actual signal submission:
# Set your environment variables
export OVERMIND_API_KEY="your_actual_api_key"
export TICKET_LINK="https://github.com/org/repo/pull/123"
# Run the real submission test
./test/test_real_submission.sh
Important: Custom Signals are always linked to a PR URL. You cannot test signal submission without a real, existing GitHub Pull Request.
# Clone the repository
git clone https://github.com/overmindtech/policy-signals-action
cd policy-signals-action
# Run tests
npm test
# Test locally with act
act -j policy-checks --secret-file .env
This project is licensed under the MIT License - see the LICENSE file for details.
Custom Signals are linked to Pull Request URLs, not specific Change IDs. When you submit a signal with a PR URL, Overmind automatically associates it with any changes for that PR, or holds it until a change is created.
You can test that your policies detect violations locally using Conftest, but to test the full signal submission flow, you need a real GitHub PR. Custom Signals must be linked to an actual PR URL.
That's the beauty of parallel execution! Signals are aggregated by PR URL, so they'll appear as soon as they're submitted. The PR comment will progressively update as both policy signals and terraform analysis complete.
Yes! All signals submitted with the same PR URL are automatically aggregated by Overmind, whether they come from policy checks, terraform analysis, or any other source.
No Custom Signals are submitted! This is the ideal behavior:
- ✅ Clean runs are silent - You only hear from the policy system when there are issues
- ✅ No noise in PRs - Policy signals only appear when violations need attention
- ✅ Better performance - No unnecessary API calls when everything is compliant
- ✅ Clean Overmind dashboard - Only actual issues create signals
The action logs will show ✓ No policy violations found
and complete successfully. Your PR will only show the standard terraform analysis without any policy-related Custom Signals.
This action does not collect, store, or process any personal data. The only data transmitted is policy violation information to your configured Overmind instance. For more information, see Overmind's Privacy Policy.
By using this action, you agree to the GitHub Terms of Service and Overmind's Terms of Service.
- Support: Join our Discord community
- Security Issues: Email [email protected]
- General Inquiries: Contact us at [email protected]
Made with care by Overmind