# Generated by tools/hardened.py from ../t1. Edit t1 or the script; this file is regenerated. variable "subscription_id" { description = "Subscription whose activity log is watched, as a GUID. The workspace, alerts, and key policy go in it too." type = string validation { condition = can(regex("^[0-9a-fA-F-]{36}$", var.subscription_id)) error_message = "Give the subscription ID as a GUID." } } variable "resource_group_name" { description = "An existing resource group for the workspace, alerts, and saved queries. Keep it apart from workloads: Standard locks it, so nothing in it can be deleted." type = string } variable "ai_account_ids" { description = "Azure OpenAI or AI Services accounts in subscription_id whose calls are recorded, by full resource ID. Each gets its own diagnostic setting and token alert." type = list(string) validation { condition = length(var.ai_account_ids) > 0 error_message = "Name at least one account, or there are no calls to record." } validation { condition = alltrue([for id in var.ai_account_ids : can(regex("(?i)^/subscriptions/[^/]+/resourceGroups/[^/]+/providers/Microsoft.CognitiveServices/accounts/[^/]+$", id))]) error_message = "Give each account's full resource ID, /subscriptions/.../providers/Microsoft.CognitiveServices/accounts/." } validation { condition = length(distinct([for id in var.ai_account_ids : lower(element(split("/", id), 8))])) == length(var.ai_account_ids) error_message = "Each account needs a different name, because its token alert is named after it." } } variable "alert_emails" { description = "Addresses that receive the alerts. Prefer an on-call address over a person." type = list(string) validation { condition = length(var.alert_emails) > 0 error_message = "Name at least one address, or the alerts have nowhere to go." } validation { condition = length(distinct([for e in var.alert_emails : lower(e)])) == length(var.alert_emails) error_message = "Name each address once." } } variable "expected_callers" { description = "Callers that fetch keys, change filters, deployments, or accounts, and change logging as part of their job, such as the deployment pipeline. Give a person's UPN, and for an app or managed identity both its application ID and its object ID, because the activity log shows either. Their changes do not alert. Every entry is a blind spot, so keep it short." type = list(string) default = [] } variable "retention_days" { description = "How long the workspace keeps the call records and the activity log. 90 days of the activity log are included in its free ingestion; call records and longer retention are billed." type = number default = 365 validation { condition = var.retention_days >= 90 && var.retention_days <= 730 error_message = "Keep at least 90 days, and Azure allows up to 730." } } variable "tokens_per_hour" { description = "Tokens, prompt plus completion, one account may process in an hour before the alert fires. Stolen access shows up as spend. Set it from a week of normal use; the default is a starting point." type = number default = 1000000 validation { condition = var.tokens_per_hour > 0 error_message = "The threshold must be above zero." } } variable "key_access_policy_effect" { description = "What the built-in key access policy does with AI accounts that accept keys. Audit reports them, Deny also refuses a new or changed account that leaves keys on, and Disabled turns the check off. Hardened refuses Disabled." type = string default = "Audit" validation { condition = contains(["Audit", "Deny", "Disabled"], var.key_access_policy_effect) error_message = "Use Audit, Deny, or Disabled." } } 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 = {} }