| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- # GENERATED from terraform.tfvars.example by scripts/gen_example_tests.py. Do not
- # edit by hand: change the example file and run
- # `python -I scripts/gen_example_tests.py`. CI fails when this file is stale.
- # It plans the stack with the example values, so the example stays valid.
- mock_provider "digitalocean" {
- mock_data "digitalocean_ssh_key" {
- defaults = {
- fingerprint = "aa:bb:cc:dd:ee:ff"
- }
- }
- }
- mock_provider "twingate" {}
- variables {
- # Example values for stacks/10-access. Copy this file to terraform.tfvars
- # (which git ignores) for a local plan. Never put a token, key or password in a
- # value file: those live in Doppler. Every value here is a placeholder, not a
- # real one. In the live stack the first five arrive as TF_VAR_* from the
- # foundation stack's outputs and the Spacelift environment, and the rest from
- # Doppler through the Spacelift hook.
- #
- # Droplet sizes are not set here. They live in cost.json, so the cost gate stays
- # the one place that prices them (see docs/cost.md).
- # DigitalOcean region slug, from the foundation stack's region output.
- region = "tor1"
- # Id of the VPC the connectors join, from the foundation stack's vpc_id output.
- vpc_id = "vpc-example-0000"
- # Id of the DigitalOcean project, from the foundation stack's project_id output.
- project_id = "project-example-0000"
- # Baseline firewall tag, from the foundation stack's baseline_tag output. It must
- # start with "cah-baseline-" so the baseline firewall covers the connectors.
- baseline_tag = "cah-baseline-tor1"
- # Bare Twingate network subdomain (only the part before the Twingate domain). Private: it
- # identifies your tenant, so the real one comes from Doppler.
- twingate_network = "example-tenant"
- # Public SSH key for the cah-admin user: "<algorithm> <key>" with an optional
- # one-word comment. The comment is dropped before the key reaches the droplet.
- # This placeholder is deliberately not a real key. The real one comes from Doppler.
- admin_ssh_public_key = "ssh-ed25519 AAAAEXAMPLEONLYNOTAREALKEY example-key"
- # Name of an SSH key already registered on the DigitalOcean account (it is looked
- # up, never registered). The real name comes from Doppler.
- admin_ssh_key_name = "example-admin-key"
- # Twingate user ids placed in the admin group (at least one). The real ids come
- # from Doppler.
- admin_user_ids = ["example-user-id"]
- # When each connector may reboot, HH:MM in America/New_York (the droplet's local
- # time). Keys a and b. The two times must be at least 60 minutes apart around the
- # clock (across midnight too), so the connectors never reboot together and the
- # weekly update, 30 minutes after each reboot, stays clear of the other reboot.
- # These are the times the live connectors use.
- reboot_times = { a = "04:00", b = "05:00" }
- # IANA time zone of the droplets (UTC or Area/Location). reboot_times above and
- # the weekly connector update are read in this zone. The default is the zone the
- # live connectors use. Changing it changes the rendered cloud-init (user_data),
- # which is force-new: both droplets are REPLACED, so read the plan first.
- timezone = "America/New_York"
- # Used in the NAMES and TAGS of cloud and Twingate objects (access-<key>,
- # cah-connector-<key>, droplet names). Empty means region, so every name is the
- # same as before this setting existed. IMMUTABLE for the life of a stack:
- # changing it changes names, causes widespread plan changes and may replace resources, including through tags or user_data including the connectors.
- # Set it only on a NEW stack, and use the same value as the foundation stack.
- resource_key = ""
- # Twingate connector telemetry (both connectors). The default, {}, changes nothing.
- # Setting any of log_level, connection_logs, metrics_port or labels adds lines to
- # /etc/twingate/connector.conf, which changes user_data: the plan then shows BOTH
- # droplets REPLACED. Roll out one connector at a time with
- # connector_telemetry_instances (["a"] first, then ["a", "b"]) and an
- # SSH-through-Twingate check between (docs/wiki/Trace-One-Change-End-to-End.md,
- # variant C). It opens no firewall port by itself (see metrics_source_tag). Uncomment to try it; the values are
- # placeholders.
- # connector_telemetry = {
- # status_updates_enabled = true # provider setting, not sent while unset, never replaces anything
- # log_level = 5 # 3, 4, 5 or 7 (Twingate's default is 3)
- # connection_logs = true # TWINGATE_LOG_ANALYTICS=v3 (user emails and client IPs in the journal)
- # metrics_port = 9999 # TWINGATE_METRICS_PORT, 1024 to 65535, not 9100
- # labels = { DEPLOYED_BY = "opentofu" } # shown in the Admin Console: no secrets
- # }
- connector_telemetry = {}
- # Which connectors get connector_telemetry (a, b or both). Default both.
- connector_telemetry_instances = ["a", "b"]
- # What the connectors NOT listed above keep (their current telemetry). {} for the
- # first activation. For a later change, put the old value here and list ["a"]
- # first, so b keeps its config while a changes.
- connector_telemetry_previous = {}
- # Lock the droplet metadata endpoint (the link-local cloud address, which serves each
- # connector's user-data and so its Twingate tokens) to root and to the do-agent
- # user that DigitalOcean's monitoring agent runs as. Default false changes
- # nothing. true REPLACES the droplet of every connector in
- # metadata_lock_instances (user_data changes). Roll out one at a time:
- # metadata_lock = true with ["a"], apply, check SSH through Twingate, then
- # ["a", "b"]. Not yet tested on a real droplet.
- metadata_lock = false
- # Which connectors get metadata_lock (a, b or both). Default both.
- metadata_lock_instances = ["a", "b"]
- # A default-drop host firewall (nftables) on each connector, a second layer
- # behind the cloud firewall. Only SSH from host_firewall_ssh_sources (and the
- # connector metrics port when connector_telemetry sets one) is let in. Default
- # false changes nothing. true REPLACES the droplet of every connector in
- # host_firewall_instances (user_data changes). A wrong ruleset can lock you
- # out of SSH: roll out one at a time, host_firewall = true with ["a"], apply,
- # check SSH through Twingate, then ["a", "b"]. Not yet tested on a real droplet.
- host_firewall = false
- # Which connectors get host_firewall (a, b or both). Default both.
- host_firewall_instances = ["a", "b"]
- # IPv4 CIDRs allowed to reach SSH through the host firewall. Default the three
- # private blocks; narrow to your VPC range if you know it.
- host_firewall_ssh_sources = ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
- # Opt-in node exporter (prometheus-node-exporter from the distro archive), bound
- # to each connector's private address only. The default, {}, changes nothing.
- # enabled = true REPLACES the droplet of every connector in node_exporter_instances
- # (user_data changes): roll out one at a time, check SSH through Twingate and the
- # memory headroom of the 1 GB droplet between. It opens no firewall port by
- # itself: set metrics_source_tag as well. NOT applied and NOT tested on a real
- # machine yet. Uncomment to try it; the values are placeholders.
- # node_exporter = { enabled = true, port = 9100 }
- node_exporter = {}
- # Which connectors get node_exporter (a, b or both). Default both.
- node_exporter_instances = ["a", "b"]
- # The DigitalOcean tag of the droplets that may scrape the metrics ports (the node
- # exporter port and connector_telemetry.metrics_port). Empty, the default, adds no
- # firewall rule. When set, the connector firewall admits each enabled metrics port
- # from THIS TAG ONLY (never an address, never a public source). The tag must
- # already exist; this stack does not create it. Example: "cah-telemetry-tor1".
- metrics_source_tag = ""
- # Opt-in log shipping: the Wazuh agent (from Wazuh's apt repository) and auditd on
- # each connector, enrolled at first boot with a secret pulled from Doppler. The
- # default, {}, changes nothing. enabled = true REPLACES the droplet of every
- # connector in log_shipping_instances (user_data changes): roll out one at a time,
- # check SSH through Twingate and the memory headroom of the 1 GB droplet between
- # (UNMEASURED). manager_address is the Wazuh manager as reached through Twingate
- # (private: the real one comes from Doppler or the Spacelift environment, never
- # from a committed file). apt_key_fingerprint has no default on purpose: read the
- # 40 uppercase hex digits from Wazuh's documentation and compare them yourself.
- # agent_name_prefix names each agent <prefix>-connector-<a or b>; use the same
- # value as site_name. agent_group must already exist on the manager. The Twingate
- # headless client the agent needs to reach the manager is NOT part of this
- # change. NOT applied and NOT tested on a real machine yet. Uncomment to try it;
- # the values are placeholders (replace the fingerprint placeholder with the real digits).
- # log_shipping = {
- # enabled = true
- # manager_address = "siem.example.com"
- # manager_port = 1514 # must match the wazuh-agent logging_servers port in stack 20
- # enroll_port = 1515 # must match the wazuh-enroll logging_servers port in stack 20
- # agent_name_prefix = "site-tor1"
- # agent_group = "site-tor1"
- # apt_key_fingerprint = "<40 uppercase hex characters>"
- # agent_version = "4.9.2-1" # match the manager; an agent newer than the manager is unsupported
- # }
- log_shipping = {}
- # Which connectors get log_shipping (a, b or both). Default both.
- log_shipping_instances = ["a", "b"]
- # The short-lived, read-only Doppler token for the config cah-<resource_key>-hostboot.
- # NEVER put the real token here: a value file is a plain file. Set it as the
- # sensitive Spacelift stack environment variable TF_VAR_log_shipping_bootstrap_token
- # when you enable log_shipping, and revoke it after the first boot. Empty, the
- # default, is the live state.
- log_shipping_bootstrap_token = ""
- # A label for telemetry only (empty means "site-<region>"). It appears in no
- # resource name, tag or output, and changing it replaces nothing.
- site_name = "site-tor1"
- }
- run "the_example_values_are_valid" {
- command = plan
- }
|