Skip to content

Commit

Permalink
Add TSIG keys (#181)
Browse files Browse the repository at this point in the history
* proxmox tsig

* cleanup

* prox

* clean

* assign acl

* fix

* clean

* unroll
  • Loading branch information
james-otten authored Jan 26, 2025
1 parent bd79d98 commit ae30fff
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy_dns_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ env:
TF_VAR_influx_db_token: ${{ secrets.TF_VAR_INFLUX_DB_TOKEN }}
TF_VAR_datadog_api_key: ${{ secrets.TF_VAR_DATADOG_API_KEY }}
TF_VAR_dns_cookie_secret: "${{ secrets.TF_VAR_DNS_COOKIE_SECRET }}"
TF_VAR_tsig_key_grandmox: "${{ secrets.TF_VAR_TSIG_KEY_GRANDMOX }}"
TF_VAR_tsig_key_jon: "${{ secrets.TF_VAR_TSIG_KEY_JON }}"
TF_VAR_tsig_key_10_r630_01: "${{ secrets.TF_VAR_TSIG_KEY_10_R630_01 }}"
TF_VAR_tsig_key_713_r640_01: "${{ secrets.TF_VAR_TSIG_KEY_713_R640_01 }}"
TF_VAR_tsig_key_doh: "${{ secrets.TF_VAR_TSIG_KEY_DOH }}"
# Credentials for deployment to AWS
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
39 changes: 39 additions & 0 deletions infra/ansible/roles/knot_authoritative/templates/knot.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,47 @@ template:
storage: /var/lib/knot/zones

key:
- id: grandmox.prox.mesh.nycmesh.net.
algorithm: hmac-sha512
secret: {{ TSIG_KEY_GRANDMOX }}
- id: jon.prox.mesh.nycmesh.net.
algorithm: hmac-sha512
secret: {{ TSIG_KEY_JON }}
- id: nycmesh-10-r630-01.prox.mesh.nycmesh.net.
algorithm: hmac-sha512
secret: {{ TSIG_KEY_10_R630_01 }}
- id: nycmesh-713-r640-01.prox.mesh.nycmesh.net.
algorithm: hmac-sha512
secret: {{ TSIG_KEY_713_R640_01 }}
- id: doh.mesh.nycmesh.net.
algorithm: hmac-sha512
secret: {{ TSIG_KEY_DOH }}

acl:
- id: acl-update-grandmox
action: update
update-type: [TXT]
update-owner-match: equal
update-owner-name: acme-challenge.grandmox.prox.mesh.nycmesh.net.
key: grandmox.prox.mesh.nycmesh.net.
- id: acl-update-jon
action: update
update-type: [TXT]
update-owner-match: equal
update-owner-name: acme-challenge.jon.prox.mesh.nycmesh.net.
key: jon.prox.mesh.nycmesh.net.
- id: acl-update-nycmesh-10-r630-01
action: update
update-type: [TXT]
update-owner-match: equal
update-owner-name: acme-challenge.nycmesh-10-r630-01.prox.mesh.nycmesh.net.
key: nycmesh-10-r630-01.prox.mesh.nycmesh.net.
- id: acl-update-nycmesh-713-r640-01
action: update
update-type: [TXT]
update-owner-match: equal
update-owner-name: acme-challenge.nycmesh-713-r640-01.prox.mesh.nycmesh.net.
key: nycmesh-713-r640-01.prox.mesh.nycmesh.net.
- id: acl-update-doh
action: update
update-type: [TXT]
Expand All @@ -45,6 +81,9 @@ zone:
- domain: doh.mesh.nycmesh.net
file: doh.mesh.nycmesh.net.zone
acl: acl-update-doh
- domain: prox.mesh.nycmesh.net
file: prox.mesh.nycmesh.net
acl: [acl-update-grandmox, acl-update-jon, acl-update-nycmesh-10-r630-01, acl-update-nycmesh-713-r640-01]
- domain: nycmeshconnect.com
file: nycmeshconnect.com.zone
- domain: nycmeshconnect.net
Expand Down
4 changes: 4 additions & 0 deletions infra/terraform/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ module "some_mesh_dns_servers" {
datadog_api_key = var.datadog_api_key
datadog_site = var.datadog_site
dns_cookie_secret = var.dns_cookie_secret
tsig_key_grandmox = var.tsig_key_grandmox
tsig_key_jon = var.tsig_key_jon
tsig_key_10_r630_01 = var.tsig_key_10_r630_01
tsig_key_713_r640_01 = var.tsig_key_713_r640_01
tsig_key_doh = var.tsig_key_doh
enable_doh = var.enable_doh
main_auth_server_ip = var.main_auth_server_ip
Expand Down
4 changes: 4 additions & 0 deletions infra/terraform/mesh_dns_servers/ansible.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ resource "ansible_group" "knot-authoritative" {
telegraf_kresd = ""
DOH_SERVER = ""
DNS_COOKIE_SECRET = var.dns_cookie_secret
TSIG_KEY_GRANDMOX = var.tsig_key_grandmox
TSIG_KEY_JON = var.tsig_key_jon
TSIG_KEY_10_R630_01 = var.tsig_key_10_r630_01
TSIG_KEY_713_R640_01 = var.tsig_key_713_r640_01
TSIG_KEY_DOH = var.tsig_key_doh
}
}
Expand Down
24 changes: 24 additions & 0 deletions infra/terraform/mesh_dns_servers/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,30 @@ variable "dns_cookie_secret" {
sensitive = true
}

variable "tsig_key_grandmox" {
type = string
description = "TSIG key for the grandmox.mesh.nycmesh.net zone"
sensitive = true
}

variable "tsig_key_jon" {
type = string
description = "TSIG key for the jon.mesh.nycmesh.net zone"
sensitive = true
}

variable "tsig_key_10_r630_01" {
type = string
description = "TSIG key for the nycmesh-10-r630-01.mesh.nycmesh.net zone"
sensitive = true
}

variable "tsig_key_713_r640_01" {
type = string
description = "TSIG key for the nycmesh-713-r640-01.mesh.nycmesh.net zone"
sensitive = true
}

variable "tsig_key_doh" {
type = string
description = "TSIG key for the doh.mesh.nycmesh.net zone"
Expand Down
24 changes: 24 additions & 0 deletions infra/terraform/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,30 @@ variable "dns_cookie_secret" {
sensitive = true
}

variable "tsig_key_grandmox" {
type = string
description = "TSIG key for the grandmox.mesh.nycmesh.net zone"
sensitive = true
}

variable "tsig_key_jon" {
type = string
description = "TSIG key for the jon.mesh.nycmesh.net zone"
sensitive = true
}

variable "tsig_key_10_r630_01" {
type = string
description = "TSIG key for the nycmesh-10-r630-01.mesh.nycmesh.net zone"
sensitive = true
}

variable "tsig_key_713_r640_01" {
type = string
description = "TSIG key for the nycmesh-713-r640-01.mesh.nycmesh.net zone"
sensitive = true
}

variable "tsig_key_doh" {
type = string
description = "TSIG key for the doh.mesh.nycmesh.net zone"
Expand Down
3 changes: 3 additions & 0 deletions mesh.zone
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ jmstemp A 199.170.132.45
; doh
doh NS nycmesh-713-dns-auth-3

; Proxmox
prox NS nycmesh-713-dns-auth-3

; David K
emergency-dev A 10.70.90.161

Expand Down
11 changes: 11 additions & 0 deletions prox.mesh.nycmesh.net
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$TTL 3600
@ SOA ( nycmesh-713-dns-auth-3 hostmaster.nycmesh.net. 2024120100 1d 2h 4w 1h )
@ NS nycmesh-713-dns-auth-3

; Authoritative DNS servers
nycmesh-713-dns-auth-3 A 199.170.132.47

grandmox A 10.70.188.196
jon A 10.70.90.52
nycmesh-10-r630-01 A 10.70.103.186
nycmesh-713-r640-01 A 10.70.90.195

0 comments on commit ae30fff

Please sign in to comment.