# Generated by tools/hardened.py from ../t1. Edit t1 or the script; this file is regenerated. variable "subscription_id" { description = "Subscription containing the identity and the resources it deploys to." type = string } variable "resource_group_name" { description = "Resource group the identity lives in. Role assignments below may point at any resource group in the subscription, or anything inside one." type = string } variable "repository" { description = "The GitHub repository allowed to sign in, as org/repo. Used in names and descriptions." type = string validation { condition = can(regex("^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$", var.repository)) error_message = "Give one repository as org/repo, with no wildcard." } } variable "allowed_subjects" { description = "GitHub token subjects allowed to sign in, matched exactly. repo:org/repo:ref:refs/heads/main is one branch; repo:org/repo:environment:production is one deployment environment, which can require a reviewer in GitHub. A repository created after 15 July 2026 carries IDs: repo:org@123456/repo@456789:ref:refs/heads/main. Read the value from a real token; the verify output shows how. At most 20." type = list(string) validation { condition = length(var.allowed_subjects) > 0 && length(var.allowed_subjects) <= 20 && alltrue([for s in var.allowed_subjects : can(regex("^repo:[^*?]+/[^*?:]+:(ref:refs/(heads|tags)/[^*?]+|environment:[^*?]+|pull_request)$", s))]) error_message = "Name 1 to 20 subjects, each repo:org/repo: followed by ref:refs/heads/, ref:refs/tags/, environment:, or pull_request, with no wildcard." } } variable "role_assignments" { description = "Roles the identity needs, each at the narrowest scope that works, and nothing more. Owner, Contributor, User Access Administrator, and Role Based Access Control Administrator are refused: a pipeline that can hand out access is a pipeline worth stealing." type = list(object({ role = string scope = string })) default = [] validation { condition = alltrue([for a in var.role_assignments : !contains(["Owner", "Contributor", "User Access Administrator", "Role Based Access Control Administrator"], a.role)]) error_message = "Owner, Contributor, User Access Administrator, and Role Based Access Control Administrator are not allowed. Name the narrow roles the pipeline needs." } } variable "aks_cluster_name" { description = "An AKS cluster whose Kubernetes service account may act as this identity through workload identity. The cluster must have its OIDC issuer and workload identity enabled. Leave empty to skip." type = string default = "" } variable "aks_resource_group_name" { description = "That cluster's resource group. Empty means the identity's." type = string default = "" } variable "aks_namespace" { description = "The Kubernetes namespace of the service account." type = string default = "default" validation { condition = can(regex("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", var.aks_namespace)) error_message = "A namespace is lowercase letters, digits, and hyphens, up to 63 characters." } } variable "aks_service_account" { description = "That Kubernetes service account's name." type = string default = "app" validation { condition = can(regex("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", var.aks_service_account)) error_message = "A service account name is lowercase letters, digits, and hyphens, up to 63 characters, so it fits a credential name too." } } variable "sign_in_log_workspace_id" { description = "A Log Analytics workspace to receive the tenant's service principal and managed identity sign-in logs, which record every token exchange with the credential that made it. Without it they last 7 days on Entra ID Free and 30 on P1 and P2. Tenant-wide: it needs Security Administrator, and it owns the tenant's one 'workload-identity' diagnostic setting. Leave empty to skip." type = string default = "" } variable "owner" { description = "Tag contract: accountable team." type = string default = "security-engineering" } variable "environment" { description = "Tag contract: environment." type = string default = "prod" } variable "extra_tags" { description = "Additional tags merged over the contract." type = map(string) default = {} }