Ajout des SPF aux DNS.
This commit is contained in:
parent
4b652b69b6
commit
17461ccf7f
2 changed files with 20 additions and 6 deletions
|
@ -42,15 +42,12 @@ DNSs = [
|
|||
MXs = {
|
||||
'redisdead.crans.org': {
|
||||
'prio': 10,
|
||||
'spf': 'v=spf1 ptr ~all',
|
||||
},
|
||||
'freebox.crans.org': {
|
||||
'prio': 25,
|
||||
'spf': 'v=spf1 ptr ~all',
|
||||
},
|
||||
'soyouz.crans.org': {
|
||||
'prio': 15,
|
||||
'spf': 'v=spf1',
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -604,7 +604,24 @@ class dns(gen_config):
|
|||
SRV('stun', 'udp', 5, 0, 3478, 'asterisk'),
|
||||
],
|
||||
}
|
||||
NATPRs = {
|
||||
|
||||
SPFs = {
|
||||
'crans.org': [
|
||||
SPF('@', 'v=spf1 mx ~all'),
|
||||
TXT('@', 'v=spf1 mx ~all'),
|
||||
],
|
||||
}
|
||||
|
||||
NON_CLONABLE_SPFs = {
|
||||
'crans.org': [
|
||||
SPF(_mx, 'v=spf1 mx:crans.org ~all') for _mx in config.dns.MXs
|
||||
] + [
|
||||
TXT(_mx, 'v=spf1 mx:crans.org ~all') for _mx in config.dns.MXs
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
NAPTRs = {
|
||||
'crans.org' : [
|
||||
NAPTR('@', 5, 100, "S", "SIPS+D2T", "", '_sips._tcp.crans.org.', ttl=86400),
|
||||
NAPTR('@', 10, 100, "S", "SIP+D2U", "", '_sip._udp.crans.org.', ttl=86400),
|
||||
|
@ -650,7 +667,7 @@ class dns(gen_config):
|
|||
# On met les mêmes MX pour toutes les zones.
|
||||
zone.extend(self.MXs)
|
||||
# Les RR définis ici sont ajoutés aux zones idoines, de façon à se simplifier la vie.
|
||||
for rr_type in [self.SRVs, self.NATPRs, self.DSs, self.EXTRAS]:
|
||||
for rr_type in [self.SRVs, self.NAPTRs, self.DSs, self.EXTRAS, self.SPFs, self.NON_CLONABLE_SPFs]:
|
||||
if zone.zone_name in rr_type.keys():
|
||||
zone.extend(rr_type[zone.zone_name])
|
||||
for m in machines:
|
||||
|
@ -684,7 +701,7 @@ class dns(gen_config):
|
|||
zones[zone] = ZoneClone(zone, zones[zone_clone], self.gen_soa(ns_list, serial, ttl))
|
||||
# Et on ajoute les enregistrements concernant la zone clône (pas la clônée, ça
|
||||
# a déjà été fait à l'init) à la main.
|
||||
for rr_type in [self.SRVs, self.NATPRs, self.DSs]:
|
||||
for rr_type in [self.SRVs, self.NAPTRs, self.DSs, self.SPFs]:
|
||||
if zones[zone].zone_name in rr_type.keys():
|
||||
zones[zone].extend(rr_type[zones[zone].zone_name])
|
||||
return zones
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue