Compare commits

...

14 commits

Author SHA1 Message Date
097895b63d
add dco.sunet.se zone 2025-04-02 14:27:19 +02:00
95f4855290
add key 2025-03-17 10:54:06 +01:00
8b9c4ec8b3
add sun.ladok.se 2025-03-17 10:50:44 +01:00
cf6ff5f3a3
add new acls 2025-03-13 10:33:53 +01:00
1c945a4ad6
add zone infra.utv.ladok.se, lab.utv.ladok.se 2025-03-12 14:52:35 +01:00
f8e3d05d70
update acl 2025-03-11 09:48:18 +01:00
85d7afb9da
add new tsig key 2025-03-10 12:07:33 +01:00
5b84480f8d
add alternativ 2025-03-10 11:01:10 +01:00
76f403a6ed
load from config, don't hardcode 2025-03-05 16:04:57 +01:00
f448be8bf8
add simple checker 2025-03-05 15:34:55 +01:00
a273ba637d
add subs pattern acl to ladok.se 2025-03-04 08:55:17 +01:00
793989e599
acl CNAME -> TXT 2025-02-28 21:49:15 +01:00
aec4b7297e
add ddns support for ladok 2025-02-27 20:37:10 +01:00
dac959b288
Enable starhip to get SUNET prompt 2025-02-04 12:13:28 +01:00
5 changed files with 98 additions and 6 deletions

View file

@ -1,5 +1,11 @@
---
knot_rest_token_secret: ENC[PKCS7,MIIC8gYJKoZIhvcNAQcDoIIC4zCCAt8CAQAxggJ6MIICdgIBADBeMEYxCzAJBgNVBAYTAlNFMQ4wDAYDVQQKDAVTVU5FVDEOMAwGA1UECwwFRVlBTUwxFzAVBgNVBAMMDjE5Mi4zNi4xNzEuMjE5AhQNByDxtRKM7mjQvskJVp1wrj/QxjANBgkqhkiG9w0BAQEFAASCAgBJrZoCKLB9RrjZtwYb5uFxDcuSngzvXVVZe3BtQdSgSq9PzG5dg9me59s7nhIj2WdWFuAdW+BuQ5pa8D+xxeKoqHhUQNCfgIE70tlhI0s9TrWJogDH+QZHE7TC3z8gUNdBo51C8Aq5FqU/Mql8MxnGMe2vgsT79pyM+2PZ6uqMqw1QiOjpFOgQ0uVb1qdYlOx6WbUuuRjGPxvxTogyX+ujdvVPnDmibgAv9UKYkfArsFLYRRB/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OiTmieAI9sPwRS+rvs2c5kdDnNpowzyBwFMF3pfH2T3s05KKmuFT04W6ajTXYz3mJ1xVuHnrkR2+jPC3I7t7Bf0edWeusDpGnz9x53NoarL99/FzjSb+Gxmtsao/1LSz0IC/Oe6xH1s4u/VxkDOMcHem4rBgr0bR8jixijdiA604MWiyP/1xvOlE3YhO33I8kus96TeS2YjrjXBAQCTOyIRyst/BpL0ISVUEH1i/j0wAw0XnyPR4nAPegd89Y/UJKMRCDBcBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCoUpXn8Nq9hu0sx22HpLOSgDBksY4jO87KhP9Qws/bBeeRuDNSZo1245AYbBVcF9DZmkjcqZKGFFuLYgj/g4fqrIo=]
certbot_acmed_clients:
dns-rest-api.sunet.se:
allowfrom: []

View file

@ -1,15 +1,51 @@
# 0sunet.catalog (catalog generator)
#acl:
# - id: slave_xfr
# address: [ <needs to be IPs> ]
# action: transfer
acl:
- id: txt_ddns_allow
action: update
key: knot-ladok
update-type: [TXT]
update-owner: name
update-owner-name: [ _acme-challenge.*.alternativ.ladok.se. ]
update-owner-match: pattern
- id: ddns_allow_alt_ladok
action: update
key: alt-ladok
update-type: [TXT]
update-owner: name
update-owner-name: [ _acme-challenge.*.alt.ladok.se., _acme-challenge.*.*.alt.ladok.se. ]
update-owner-match: pattern
- id: ddns_allow_sun_ladok
action: update
key: sun-ladok
update-type: [TXT]
update-owner: name
update-owner-name: [ _acme-challenge.*.sun.ladok.se., _acme-challenge.*.*.sun.ladok.se. ]
update-owner-match: pattern
- id: ddns_allow_infra_utv_ladok
action: update
key: infra-utv-ladok
update-type: [TXT]
update-owner: name
update-owner-name: [ _acme-challenge.*.infra.utv.ladok.se. ]
update-owner-match: pattern
- id: ddns_allow_lab_utv_ladok
action: update
key: lab-utv-ladok
update-type: [TXT]
update-owner: name
update-owner-name: [ _acme-challenge.*.lab.utv.ladok.se. ]
update-owner-match: pattern
template:
- id: 0sunet-catz
catalog-role: member
catalog-zone: 0sunet.catalog.
#acl: slave_xfr
notify: [ ns1-sunet-se, sunic-node1, sunic-node2, sunic-node3 ]
storage: "/var/lib/knot/catzones"
file: "%s.zone"
@ -17,12 +53,25 @@ template:
zone:
- domain: 0sunet.catalog.
catalog-role: generate
#acl: slave_xfr
notify: [ ns1-sunet-se, sunic-node1, sunic-node2, sunic-node3 ]
- domain: alternativ.ladok.se.
template: 0sunet-catz
acl: [txt_ddns_allow]
- domain: alt.ladok.se.
template: 0sunet-catz
acl: [ddns_allow_alt_ladok]
- domain: sun.ladok.se.
template: 0sunet-catz
acl: [ddns_allow_sun_ladok]
- domain: infra.utv.ladok.se.
template: 0sunet-catz
acl: [ddns_allow_infra_utv_ladok]
- domain: lab.utv.ladok.se.
template: 0sunet-catz
acl: [ddns_allow_lab_utv_ladok]

View file

@ -0,0 +1,6 @@
# DCO.sunet.se (bj)
zone:
- domain: dco.sunet.se
dnssec-signing: off
notify: [ ns1-sunet-se, sunic-node1, sunic-node2, sunic-node3 ]

View file

@ -0,0 +1,29 @@
#!/usr/bin/env python3
import yaml
import sqlite3
try:
with open('/etc/knot_rest/knot_rest.yaml') as stream:
yamlconf = yaml.safe_load(stream)
except Exception as e:
print(e)
knotrestdb = yamlconf["database"].removeprefix("sqlite:///")
try:
with sqlite3.connect(knotrestdb) as conn:
cur = conn.cursor()
cur.execute('select username, description, logged_in from user')
rows = cur.fetchall()
for row in rows:
username = row[0]
description = row[1]
if description == None:
description = "(no description)"
lastlogin = row[2]
if lastlogin == None:
lastlogin = "**never logged in**"
print(f"{username:<27}{description:<27}{lastlogin:<23}")
except sqlite3.OperationalError as e:
print(e)

View file

@ -22,4 +22,6 @@ class dns {
# match => '^SystemMaxUse=',
# line => 'SystemMaxUse=500M',
#}
include sunet::starship
}