{"id":18424183,"url":"https://github.com/bradmccoydev/tfval","last_synced_at":"2025-04-07T15:33:13.468Z","repository":{"id":39432441,"uuid":"419918230","full_name":"bradmccoydev/tfval","owner":"bradmccoydev","description":"Validates Terraform Plans using TFSEC and OPA","archived":false,"fork":false,"pushed_at":"2023-03-31T06:25:48.000Z","size":204,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T20:45:21.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bradmccoydev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"bradmccoydev"}},"created_at":"2021-10-22T00:33:26.000Z","updated_at":"2023-06-14T11:21:53.000Z","dependencies_parsed_at":"2024-06-11T17:07:50.161Z","dependency_job_id":null,"html_url":"https://github.com/bradmccoydev/tfval","commit_stats":null,"previous_names":["bradmccoydev/terraform-plan-validator"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradmccoydev%2Ftfval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradmccoydev%2Ftfval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradmccoydev%2Ftfval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradmccoydev%2Ftfval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradmccoydev","download_url":"https://codeload.github.com/bradmccoydev/tfval/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247680022,"owners_count":20978177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T04:41:37.580Z","updated_at":"2025-04-07T15:33:08.450Z","avatar_url":"https://github.com/bradmccoydev.png","language":"Go","funding_links":["https://github.com/sponsors/bradmccoydev"],"categories":[],"sub_categories":[],"readme":"![passing](https://github.com/bradmccoydev/tfval/actions/workflows/ci.yml/badge.svg) ![GitHub](https://img.shields.io/github/license/bradmccoydev/tfval) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/bradmccoydev/tfval)\n\n# TFVAL\nThis tool validates Terraform Plans it has been developed in golang as a wrapper around TFSEC and OPA to provide guardrails when deploying in CI/CD pipelines. You can find the latest release at the release page\n\n### Command Description\n\n| Command | Parameters |\n| --- | --- |\n| check | Check if the plan passes OPA and TFSEC Policy |\n| checkopa | Check if the plan passes OPA Policy |\n| opascore | Gets the OPA score report |\n| tfsec | Outputs TfSec vulnerability report |\n| sendreport | Sends Terraform validation Report to slack |\n| cost | Matches Infracost and Budget |\n\n### Commands Parameters\n\n| Command | Parameters |\n| --- | --- |\n| tfsec | --tfsecReport \"delete-rg-test.json\" --tfsecMaxSeverity \"CRITICAL\" |\n| check | --repo \"https://github.com/basiqio/terraform-template\" --commitSha \"1234\" --developer \"bradmccoydev\" --planFileName \"policies/delete-rg-test.json\" --tfsecReportLocation \"pkg/tfsec/mock.json\" --tfsecMaxSeverity \"CRITICAL\" --infracostMonthlyBudget \"2000\" --infracostReportLocation \"pkg/infracost/mock.json\" --opaConfig \"[{\\\"location\\\":\\\"policies/opa-azure-policy.rego\\\",\\\"query\\\":\\\"data.terraform.analysis.deny[x]\\\"}]\" |\n| checkopa | --planFileName \"policies/delete-rg-test.json\" --opaConfig \"[{\\\"location\\\":\\\"policies/opa-azure-policy.rego\\\",\\\"query\\\":\\\"data.terraform.analysis.authz\\\"}]\" |\n| opascore | --planFileName \"delete-rg-test.json\" --policyLocation \"opa-aws-policy.rego\" |\n| sendreport | --fileName \"delete-rg-test.json\" --slackWebhook \"*\" --prNumber \"1\" --repoFullUrl \"x\" --tfsecMaxSeverity \"MEDIUM\"  |\n| cost | --infracostMonthlyBudget \"2000\" --infracostReportLocation \"pkg/infracost/mock.json\"|\n\n - /usr/bin/tfsec-analysis-terraform tfsec \"$BITBUCKET_PR_ID\" \"$BITBUCKET_GIT_HTTP_ORIGIN\" \"tfsec-report.json\" \"$SLACK_WEBHOOK\"\n \n### Docker\n```bash\ndocker pull bradmccoydev/tfval:latest\ndocker run -p 80:80 bradmccoydev/tfval:latest check --planFileName \"delete-rg-test.json\" --policyLocation \"opa-aws-policy.rego\" --tfsecMaxSeverity \"CRITICAL\" --opaRegoQuery \"data.terraform.analysis.authz\"\n```\n\n### Maintainers:\n* Brad McCoy ([@bradmccoydev](https://github.com/bradmccoydev)), Basiq\n* Ben Poh ([@benhpoh](https://github.com/benhpoh)), Moula\n\n## Thanks to all the contributors ❤️\n\u003ca href = \"https://github.com/bradmccoydev/tfval/graphs/contributors\"\u003e\n  \u003cimg src = \"https://contrib.rocks/image?repo=bradmccoydev/tfval\"/\u003e\n\u003c/a\u003e\n\n### License\n\nTerraform Plan Validator is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/bradmccoydev/tfval/blob/main/LICENSE)\n\nopa eval --fail-defined --format raw --input policies/delete-rg-test.json --data policies/opa-azure-policy.rego 'data.terraform.analysis.authz'\n\nopa eval --fail-defined --format raw --input policies/delete-rg-test.json --data policies/tags-policy.rego 'data.terraform.common.deny[x]'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradmccoydev%2Ftfval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradmccoydev%2Ftfval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradmccoydev%2Ftfval/lists"}