diff --git a/README.md b/README.md index 49d2689..98fd177 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ This is a tool that can be used both locally and in CI to determine if your repository is compliant with your Organisation's Policy as Code. Policy location and versions are determined by: -- **Terraform:** Scans `x.tfvars.json` files in your repository looking for 3 keys: +- **Terraform:** Scans `policy_checker.json` file in your repository looking for 3 keys: ```json { - "policy_checker_source": "https://github.com/appvia/policy", - "policy_checker_version": "1.0.1", - "policy_checker_config": "infra/generic/config.yaml" + "source": "https://github.com/appvia/policy", + "version": "1.0.1", + "config": "infra/generic/config.yaml" } ``` - **Kubernetes:** *Not yet implemented* @@ -26,4 +26,4 @@ $ docker run --rm -v ${PWD}:/workdir -e RUN_CHECKOV_POLICIES=true ghcr.io/appvia ## Examples - **Policy as Code:** https://github.com/appvia/policy -- **Terraform Module:** https://github.com/appvia/tf-aws-rds-postgres \ No newline at end of file +- **Terraform Module:** https://github.com/appvia/tf-aws-rds-postgres diff --git a/entrypoint.sh b/entrypoint.sh index f003889..1d499e3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,11 +11,11 @@ function jq_fetch () { } if $RUN_CHECKOV_POLICIES ; then - echo "Locating policy-checker variables within *.tfvars.json files.." - TFVARS_CONTENT=`cat *.tfvars.json` - POLICY_SOURCE=$(jq_fetch "${TFVARS_CONTENT}" "policy_checker_source") - POLICY_VERSION=$(jq_fetch "${TFVARS_CONTENT}" "policy_checker_version") - POLICY_CONFIG=$(jq_fetch "${TFVARS_CONTENT}" "policy_checker_config") + echo "Locating policy-checker variables within policy_checker.json file..." + POLICY_CHECKER_VARIABLES=`cat policy_checker.json` + POLICY_SOURCE=$(jq_fetch "${POLICY_CHECKER_VARIABLES}" "source") + POLICY_VERSION=$(jq_fetch "${POLICY_CHECKER_VARIABLES}" "version") + POLICY_CONFIG=$(jq_fetch "${POLICY_CHECKER_VARIABLES}" "config") echo "Policy Package: ${POLICY_SOURCE}:${POLICY_VERSION}" echo "Fetching Policies..."