Skip to content

v0.1.0 (2025-06-03)

Choose a tag to compare

@github-actions github-actions released this 03 Jun 06:54

Changes

  • Support keyworded keys via keywordize? #4
    • Enables keyworded keys for parsed data results. This allows for more
      idiomatic access to Clojure data structures inside policies.
$ cat conjtest.edn
{:keywordize? true}

$ conjtest parse examples/hcl2/terraform.tf --config conjtest.edn
{:resource
 {:aws_alb_listener
  {:my-alb-listener [{:port "80", :protocol "HTTP"}]},
  :aws_db_security_group {:my-group [{}]},
  :aws_s3_bucket
  {:valid
   [{:acl "private",
     :bucket "validBucket",
     :tags {:environment "prod", :owner "devops"}}]},
  :aws_security_group_rule
  {:my-rule [{:cidr_blocks ["0.0.0.0/0"], :type "ingress"}]},
  :azurerm_managed_disk
  {:source [{:encryption_settings [{:enabled false}]}]}}}

$ conjtest test examples/hcl2/terraform.tf -p examples/hcl2/policy.clj --config conjtest.edn
FAIL - examples/hcl2/terraform.tf - deny-fully-open-ingress - ASG rule ':my-rule' defines a fully open ingress
FAIL - examples/hcl2/terraform.tf - deny-http - ALB listener ':my-alb-listener' is using HTTP rather than HTTPS
FAIL - examples/hcl2/terraform.tf - deny-missing-tags - AWS resource: :aws_alb_listener named ':my-alb-listener' is missing required tags: #{:environment :owner}
FAIL - examples/hcl2/terraform.tf - deny-missing-tags - AWS resource: :aws_db_security_group named ':my-group' is missing required tags: #{:environment :owner}
FAIL - examples/hcl2/terraform.tf - deny-missing-tags - AWS resource: :aws_security_group_rule named ':my-rule' is missing required tags: #{:environment :owner}
FAIL - examples/hcl2/terraform.tf - deny-unencrypted-azure-disk - Azure disk ':source' is not encrypted

4 tests, 0 passed, 0 warnings, 4 failures

# See policy definitions at: https://github.com/ilmoraunio/conjtest/blob/main/examples/hcl2/policy.clj