iac.htora.dev · security templates

Home/Using the templates/How templates are checked

How templates are checked

Every template runs through the same checks on every change, and again once a week.

The weekly run matters more than it sounds. Providers retire arguments and change defaults, so a template that passed in March can fail in June with nobody touching it. The weekly run is how that gets noticed.

Terraform

CheckWhat it catchesCommand
FormattingThe code is formatted the standard way, so diffs stay readable.terraform fmt -check -diff
ValidTerraform can read it and every reference resolves.terraform init -backend=false && terraform validate
LintUnused declarations, untyped variables, missing version constraints, and deprecated syntax.tflint --minimum-failure-severity=warning
Security scanNo public storage, no missing encryption, no firewall rules open to everyone.checkov -d . --framework terraform

Ansible and Argo CD

Ansible

CheckWhat it catchesCommand
Ansible lintSteps that are not safe to run twice, retired module names, missing names on tasks.ansible-lint
SyntaxAnsible can read the playbook and every module referenced exists.ansible-playbook --syntax-check

Argo CD

CheckWhat it catchesCommand
Kubernetes schemaEvery manifest matches the schema for the kind it claims to be.kubeconform -strict -summary
BuildsThe folder produces valid output before Argo CD ever sees it.kustomize build

Three that need nothing installed

These run in seconds without Terraform, Ansible, or a cluster, so they work as a pre-commit hook or in a locked-down environment.

CheckWhat it catchesCommand
parseEvery file parses. Runs without Terraform installed.python tools/parsecheck.py outcomes
refcheckEvery setting used is declared, every setting declared is used, and quick-start templates stay one file.python tools/refcheck.py outcomes
registrycheckThe site and the repo agree, and every template with code carries its explanation: what you need, what it creates, what catches people, and how to undo it.python tools/registrycheck.py registry/templates.yml

How a template earns its label

Ready means every check for its tool passed on the main branch. The label is changed by hand after someone reads the green run, so it cannot flip on its own by accident.

Draft means the code exists and at least one check has not run or has not passed. Planned means there is no code yet.

The registry check also refuses a template that has code and no explanation. A page here always tells you what you need first, what gets created, what catches people, and how to undo it.

When they last ran

264 of 273 folders passed every check for their tool when last run, between 2026-10-02 and 2026-11-12. The results are recorded in registry/checks.json by tools/localgates.py, and each template page shows its own.

ToolVersion
engineOpenTofu v1.12.6
tflintTFLint version 0.64.0
checkov3.3.19

Providers the Terraform templates were validated against:

ProviderVersion
hashicorp/archive2.8.1
hashicorp/aws6.66.0
hashicorp/azurerm5.6.0
hashicorp/google8.4.0
hashicorp/random3.9.1
integrations/github6.13.0
oracle/oci9.8.0

Security scan decisions

The scanner ran 4,166 checks across the Terraform templates: 3,785 passed and 381 were flagged, from 69 distinct rules. Each rule it flags is either fixed or has a written reason below. A new finding with no reason fails the build.

RuleWhy it standsReason
Administrator users have no API keysCKV2_OCI_1Scanner misreads the code
one folder
The break-glass quick start finds the Administrators group with a data lookup, which the scanner cannot follow. The account has no API key, and its capabilities are set so it cannot be given one.
AdministratorAccess attachedCKV_AWS_274By design
two folders
The break-glass user must be able to repair anything, including the sign-in setup and the policies that broke. Its use is alerted within minutes, and the guardrail template's exempt list names it.
App Service plan minimum instancesCKV_AZURE_212Scanner misreads the code
two folders
The check is written for dedicated plans. The responder runs on a Flex Consumption plan, which has no standing instances and scales from zero when an event arrives.
App Service plan zone redundantCKV_AZURE_225Scanner misreads the code
two folders
The check is written for dedicated plans. A Flex Consumption plan has no instances of its own to spread across zones.
BigQuery dataset encrypted with your own keyCKV_GCP_81By design
one folder
The findings history dataset uses Google-managed encryption. Findings describe resources and contain none of their data, and Security Command Center writes the export as its own service agent, which a key of your own would need to be granted.
Classic blob read loggingCKV2_AZURE_21By design
eight folders
Classic storage analytics logging is superseded by diagnostic settings. The Standard state backend, and the Standard container evidence account when given a workspace, send every blob read and write to Log Analytics that way.
Classic queue loggingCKV_AZURE_33Scanner misreads the code
11 folders
These storage accounts contain no queues.
Cloud Storage access logsCKV_GCP_62By design
eight folders
Cloud Storage access logs are a legacy feature. Data Access audit logs record reads and writes, and the audit log template explains how to switch them on.
Cloud Storage versioningCKV_GCP_78By design
six folders
The audit and container evidence buckets' retention policies already refuse overwrites and deletes, so versioning adds nothing there. The evidence function's source bucket contains a zip Terraform rebuilds from code in Git, named by its hash, so an older copy is never needed.
CloudTrail SNS topicCKV_AWS_252By design
three folders
A notification for every log file delivered adds noise that nobody acts on.
CloudTrail encrypted with KMSCKV_AWS_35Quick start keeps it simple
one folder
The quick start uses S3-managed encryption. Standard encrypts the trail with your own KMS key.
CloudTrail sent to CloudWatch LogsCKV2_AWS_10Scanner misreads the code
two folders
The quick start keeps to one bucket. Standard sends the trail to CloudWatch Logs whenever cloudwatch_logs is true, which the scanner cannot see through the count.
CloudWatch log retention of a yearCKV_AWS_338By design
three folders
CloudWatch Logs is the alerting window. The long-term record is the trail's copy in S3: under Object Lock for the audit log, and kept for the retention you choose for object reads.
Compute instance boot volume in-transit encryptionCKV_OCI_4Scanner misreads the code
two folders
The check reads is_pv_encryption_in_transit_enabled inside launch_options, which Oracle's provider documents as deprecated at create and for updates only. The template sets the field the create call uses, at the top level, where the check does not look.
Compute instance monitoring enabledCKV_OCI_6By design
two folders
The forensic workstation runs no Oracle Cloud Agent plugins, which is what monitoring needs. An agent is a way to run commands on the machine containing the evidence, and a port-forwarding session needs none. The network is watched instead, by flow logs and an alarm on refused traffic.
Default security group left openCKV2_AWS_12Quick start keeps it simple
one folder
Nothing in the forensic workstation quick start uses the VPC's default security group. Standard empties it, so nothing can be placed in an open group by accident.
Event Grid topic managed identityCKV_AZURE_191By design
one folder
An identity on the status topic is only used to deliver to destinations that require one. The function sends to it as its own identity, and what you subscribe is your choice.
Event Grid topic public network access offCKV_AZURE_193Needs a virtual network
one folder
The status topic accepts events over its public endpoint from the function's identity only, with key access off. Closing the endpoint needs a private endpoint and a virtual network the function runs in.
Firehose encrypted with a customer-managed keyCKV_AWS_241Quick start keeps it simple
one folder
The quick start encrypts the stream with the AWS-owned key to stay one file. Standard encrypts it with its own key.
GitHub Actions OIDC trust conditionCKV_GCP_125Scanner misreads the code
two folders
Both conditions are exact matches on GitHub's subject claim, which names the repository and the branch or environment. The scanner reads the repository name only when it is typed into the condition itself, so a name held in a local or a variable fails it. The Standard variable also refuses wildcards in the organisation or repository.
IAM permissions management without constraintsCKV_AWS_109Scanner misreads the code
16 folders
In the key policies, a resource of * means this key and nothing else. The evidence responder's role uses * because EC2 describe actions accept no narrower resource, and the responder must act on whichever instance was tagged. It has no delete, stop, or terminate actions.
IAM resource of *CKV_AWS_356Scanner misreads the code
18 folders
In the key policies, a resource of * means this key and nothing else. The evidence responder's role uses * because EC2 describe actions accept no narrower resource, and the responder must act on whichever instance was tagged. It has no delete, stop, or terminate actions.
IAM user outside single sign-onCKV_AWS_273By design
two folders
A break-glass account exists for when single sign-on is down, so it has to be an IAM user outside it. It is refused everything without MFA, and every use raises an alert.
IAM write access without constraintsCKV_AWS_111Scanner misreads the code
18 folders
In the key policies, a resource of * means this key and nothing else. The evidence responder's role uses * because EC2 describe actions accept no narrower resource, and the responder must act on whichever instance was tagged. It has no delete, stop, or terminate actions.
KMS key protected from deletionCKV_GCP_82Quick start keeps it simple
one folder
Standard keys set prevent_destroy. The key quick start leaves it off so it can be removed after trying it.
Key Vault firewallCKV_AZURE_109Quick start keeps it simple
four folders
The key quick start leaves the vault reachable so it works from anywhere. Standard adds a default-deny firewall. The container evidence vault gets one once you name its addresses, so the Terraform runner is not locked out by default.
Key Vault private endpointCKV2_AZURE_32Needs a virtual network
eight folders
A private endpoint needs a virtual network and private DNS these templates cannot assume. Standard closes the vault with a default-deny firewall and named addresses.
Key Vault public network access offCKV_AZURE_189Needs a virtual network
eight folders
Switching it off entirely locks out whoever runs Terraform unless a private endpoint exists. Standard uses a default-deny firewall with named addresses.
Key Vault purge protectionCKV_AZURE_110Quick start keeps it simple
one folder
The key quick start leaves purge protection off so it can be removed completely. Standard turns it on.
Key Vault recoverableCKV_AZURE_42Quick start keeps it simple
one folder
Tied to purge protection: off in the key quick start so it can be removed, on in Standard.
Key backed by an HSMCKV_AZURE_112By design
five folders
The key template's Standard level uses an HSM-backed key. Quick starts, and the storage keys inside other templates, use software keys that Key Vault still protects.
Key expiration dateCKV_AZURE_40By design
seven folders
Each key carries a rotation policy that expires every version after a year and rotates thirty days before. A fixed expiration date on the key itself would fight that rotation.
Lambda code signingCKV_AWS_272Needs a virtual network
four folders
Code signing needs a signing profile and a pipeline that signs each release. It belongs with the Hardened level's pipeline.
Lambda concurrency limitCKV_AWS_115By design
four folders
Reserving concurrency fails in accounts with a low overall limit, which is common in new accounts. Leaving it unreserved means containment competes with other functions, which is worth knowing in a large account.
Lambda dead-letter queueCKV_AWS_116Quick start keeps it simple
three folders
The quick start stays one file. Standard keeps every event the responder failed on in an encrypted queue for 14 days.
Lambda inside a VPCCKV_AWS_117By design
four folders
The responder only calls AWS APIs. Placing it in a VPC would need endpoints or a NAT for each of them and adds a way for containment to fail.
Lambda tracingCKV_AWS_50By design
four folders
Tracing adds cost and permissions. The responder logs every step, and its status messages record what happened in order.
Log group encrypted with KMSCKV_AWS_158Quick start keeps it simple
eight folders
Quick starts keep the default log group encryption to stay one file. Standard encrypts these log groups with your own key: the evidence responder's logs, the Okta event archive, and the Bedrock invocation log.
Network security group ingress rules are statelessCKV_OCI_21By design
three folders
A stateless rule needs a matching return rule and blocks nothing a stateful one allows. These groups accept SSH from one address, statefully.
Object Storage encrypted with your own keyCKV_OCI_9Quick start keeps it simple
six folders
Quick starts use Oracle-managed keys to stay one file. Standard uses your own key from Vault.
Object Storage eventsCKV_OCI_7By design
10 folders
Nothing needs to react to new objects in these buckets.
Object Storage versioningCKV_OCI_8By design
eight folders
Retention rules and versioning cannot both be on for one bucket in Oracle Cloud, and the retention rule is the control this template exists for.
Policy attached to a userCKV_AWS_40By design
two folders
The break-glass user's policies are attached to it directly. A group would add a second way to grant administrator access, by adding someone to that group.
Pub/Sub topics encrypted with a customer-managed keyCKV_GCP_83By design
six folders
Pub/Sub encrypts every message at rest with a Google-managed key. A key of your own adds the power to revoke access: SIEM ingest Standard takes one through kms_key_name, which the scanner cannot see when given as a variable. The other topics carry findings, alerts, and reminders, which describe resources and contain none of their data.
Retention locked with Bucket LockCKV2_GCP_4Quick start keeps it simple
one folder
The quick start leaves the retention policy unlocked so it can be removed tomorrow. Standard has a lock switch.
S3 cross-region replicationCKV_AWS_144By design
18 folders
Replicating to a second region doubles storage cost and needs a second bucket and key. Some organisations need it, so it is left for them to add.
S3 encrypted with KMSCKV_AWS_145Quick start keeps it simple
eight folders
Quick starts use S3-managed encryption to stay one file. Standard encrypts with your own KMS key.
S3 event notificationsCKV2_AWS_62By design
18 folders
Nothing needs to react to new objects in these buckets.
S3 lifecycle configurationCKV2_AWS_61By design
six folders
The state quick start keeps every version, and Standard expires them. The evidence bucket has no expiry on purpose: how long evidence is kept is a legal hold decision, and Object Lock enforces the minimum.
S3 server access loggingCKV_AWS_18By design
18 folders
Server access logs need a second bucket and are delivered on a best-effort basis. CloudTrail data events record object access reliably, and the audit log template is where to switch them on.
S3 versioning on the SIEM failed-events bucketCKV_AWS_21By design
six folders
Firehose writes each refused batch once, under its own unique key, and the batches expire after 30 days. There is never an older copy worth keeping.
SNS topic encryptedCKV_AWS_26By design
six folders
Two cases. The key baseline's topic is deliberately not encrypted with the key it watches, because switching that key off would also silence the alert about it. Quick start topics stay unencrypted to keep them to one file. CloudWatch alarms cannot publish to a topic under the AWS managed key, so encryption needs a key with its own policy, which Standard adds.
Secrets Manager secret encrypted with your own keyCKV_AWS_149Quick start keeps it simple
one folder
The quick start uses the AWS-managed Secrets Manager key to stay one file. Standard gives the secret its own key, usable only through Secrets Manager.
Security group not attachedCKV2_AWS_5By design
two folders
The admin access template creates a security group with no inbound rules for the instances you launch afterwards. Nothing is attached to it at apply time.
Security list restricts SSH from 0.0.0.0/0CKV_OCI_19Scanner misreads the code
three folders
The check counts a security list with no inbound rules as open to SSH. These lists have no inbound rules at all.
Session Manager data encrypted with your own keyCKV_AWS_112Quick start keeps it simple
one folder
Sessions always run over TLS. The quick start leaves out the extra session key to stay one file. Standard encrypts each session with its own key.
Storage SAS expiration policyCKV2_AZURE_41By design
two folders
Nothing here issues shared access signatures. The evidence accounts have shared keys off, so none can be made, and the function reaches its own account as its identity.
Storage account namingCKV_AZURE_43Scanner misreads the code
one folder
The name is built from a variable, lowercased and trimmed to 24 characters, which the scanner cannot evaluate.
Storage account shared key access offCKV2_AZURE_40By design
five folders
The flow log accounts receive flow logs from Network Watcher. Microsoft's flow log pages do not say flow logs are written with shared key access off, so it stays on until that is tested. The evidence capture function's own account keeps keys on for the quick start, which connects with one, and for the Functions runtime at Standard; the evidence account itself has them off.
Storage encrypted with your own keyCKV2_AZURE_1Quick start keeps it simple
eight folders
Quick starts use Microsoft-managed keys to stay one file. Standard uses your own key from Key Vault for anything that contains evidence or logs. The evidence capture function's own account contains its code package and runtime state, and stays under Microsoft-managed keys.
Storage firewall denies by defaultCKV_AZURE_35By design
one folder
The container evidence account denies every other network once allowed_ip_ranges is set. It stays reachable until then, because a responder outside a fixed list, such as in Cloud Shell, could otherwise not store evidence during an incident. Sign-in is Entra ID only, and responders can add blobs but not read or delete them.
Storage private endpointCKV2_AZURE_33Needs a virtual network
11 folders
A private endpoint needs a virtual network and private DNS these templates cannot assume. Standard closes the account with a default-deny firewall and named addresses.
Storage public network access offCKV_AZURE_59Needs a virtual network
11 folders
Blob public access is already off, and Standard accounts deny the network by default, except the container evidence account, which does once you name its addresses. Switching public network access off entirely needs a private endpoint.
Storage replicationCKV_AZURE_206Quick start keeps it simple
seven folders
The state and container evidence quick starts use locally redundant storage to keep a trial cheap. Standard uses geo-redundant storage.
Storage soft deleteCKV2_AZURE_38Quick start keeps it simple
five folders
The audit and container evidence quick starts lack it. There the immutability policy is what protects the logs and the evidence, and no blob can be deleted while it applies. The evidence capture function's own account has a code package Terraform rewrites on each change, and nothing worth restoring.
Subnet has a network security groupCKV2_AZURE_31Quick start keeps it simple
one folder
The brokered shell quick start leaves AzureBastionSubnet on Azure's defaults to stay short. Standard gives it the rules Microsoft documents for Bastion.
VCN has an inbound security listCKV_OCI_16By design
three folders
The brokered shell and forensic workstation subnets have no inbound rules on purpose. SSH arrives through a network security group that accepts the bastion's own address only.
VM disk encrypted with a customer-supplied keyCKV_GCP_38By design
one folder
A customer-supplied key is raw key material sent with every disk operation, and losing it loses the disk. The forensic workstation's disk uses Google-managed encryption; a Cloud KMS key gives the same control over access without handling raw keys.
VPC flow logsCKV2_AWS_11Quick start keeps it simple
one folder
The forensic workstation quick start leaves flow logs out to stay one file. Standard records every flow and alerts on each refused connection.

What the checks cannot tell you

They show the code is well formed, uses settings that exist, and creates nothing obviously unsafe. They say nothing about your account, your permissions, or your policies. The check at the end of each template page is there for that.

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.