Skip to content

Commit db3a0f6

Browse files
authored
Not creating two warnings when one is needed (#140)
1 parent aac7b42 commit db3a0f6

File tree

5 files changed

+66
-36
lines changed

5 files changed

+66
-36
lines changed

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3"
2-
31
x-common-configuration:
42
&common-configuration
53
restart: always

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
author = "CERT Polska"
3434

3535
# The full version, including alpha/beta/rc tags
36-
release = "1.3.7"
36+
release = "1.3.8"
3737

3838
latex_engine = "xelatex"
3939

scan/libmailgoose/scan.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,24 @@ def scan_domain(
416416
f"(from the From header: {from_domain})."
417417
)
418418

419-
describe_why_policy_none_is_a_bad_idea = False
420-
421419
if parsed_dmarc_record["tags"]["p"]["value"] == "none":
422420
if "rua" not in parsed_dmarc_record["tags"]:
423421
domain_result.dmarc.errors.append(
424422
"DMARC policy is 'none' and 'rua' is not set, which means that the DMARC setting is not effective."
425423
)
426424
else:
427425
dmarc_warnings.append(
428-
"DMARC policy is 'none', which means that besides reporting no action will be taken. "
426+
"DMARC policy is 'none', which means that besides reporting no action will be taken. \n\n"
427+
"The policy describes what action the recipient server should take when noticing a message "
428+
"that doesn't pass the verification. 'quarantine' policy suggests the recipient server to "
429+
"flag the message as spam and 'reject' policy suggests the recipient server to reject the "
430+
"message. We recommend using the 'quarantine' or 'reject' policy.\n\n"
431+
"When testing the DMARC mechanism, to minimize the risk of correct messages not being delivered, "
432+
"the 'none' policy may be used. Such tests are recommended especially when the domain is used to "
433+
"send a large number of e-mails using various tools and not delivering a correct message is "
434+
"unacceptable. In such cases the reports should be closely monitored, and the target setting should "
435+
"be 'quarantine' or 'reject'."
429436
)
430-
describe_why_policy_none_is_a_bad_idea = True
431437
elif (
432438
parsed_dmarc_record["tags"]["sp"]["value"] == "none"
433439
): # "elif" because we don't want to report the same problem for subdomains if p=none
@@ -437,22 +443,17 @@ def scan_domain(
437443
)
438444
else:
439445
dmarc_warnings.append(
440-
"DMARC subdomain policy is 'none', which means that besides reporting no action will be taken for e-mails coming from subdomains. "
446+
"DMARC subdomain policy is 'none', which means that besides reporting no action will be taken for e-mails coming from subdomains.\n\n"
447+
"The policy describes what action the recipient server should take when noticing a message "
448+
"that doesn't pass the verification. 'quarantine' policy suggests the recipient server to "
449+
"flag the message as spam and 'reject' policy suggests the recipient server to reject the "
450+
"message. We recommend using the 'quarantine' or 'reject' policy.\n\n"
451+
"When testing the DMARC mechanism, to minimize the risk of correct messages not being delivered, "
452+
"the 'none' policy may be used. Such tests are recommended especially when the domain is used to "
453+
"send a large number of e-mails using various tools and not delivering a correct message is "
454+
"unacceptable. In such cases the reports should be closely monitored, and the target setting should "
455+
"be 'quarantine' or 'reject'."
441456
)
442-
describe_why_policy_none_is_a_bad_idea = True
443-
444-
if describe_why_policy_none_is_a_bad_idea:
445-
dmarc_warnings.append(
446-
"The policy describes what action the recipient server should take when noticing a message "
447-
"that doesn't pass the verification. 'quarantine' policy suggests the recipient server to "
448-
"flag the message as spam and 'reject' policy suggests the recipient server to reject the "
449-
"message. We recommend using the 'quarantine' or 'reject' policy.\n\n"
450-
"When testing the DMARC mechanism, to minimize the risk of correct messages not being delivered, "
451-
"the 'none' policy may be used. Such tests are recommended especially when the domain is used to "
452-
"send a large number of e-mails using various tools and not delivering a correct message is "
453-
"unacceptable. In such cases the reports should be closely monitored, and the target setting should "
454-
"be 'quarantine' or 'reject'."
455-
)
456457

457458
domain_result.dmarc.tags = parsed_dmarc_record["tags"]
458459
domain_result.dmarc.warnings = list(

scan/libmailgoose/translate.py

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,7 @@
132132
"DMARC raporto adreso el. pašto domenas neturi MX įrašų. Tai reiškia, kad šis domenas gali nebegauti DMARC raportų.",
133133
),
134134
(
135-
"DMARC policy is 'none', which means that besides reporting no action will be taken.",
136-
"DMARC politika yra 'none', tai reiškia, kad be raportavimo nebus vykdoma jokia papildoma veikla.",
137-
),
138-
(
135+
"DMARC policy is 'none', which means that besides reporting no action will be taken. \n\n"
139136
"The policy describes what action the recipient server should take when noticing "
140137
"a message that doesn't pass the verification. 'quarantine' policy "
141138
"suggests the recipient server to flag the message as spam and 'reject' policy suggests the recipient "
@@ -145,6 +142,7 @@
145142
"send a large number of e-mails using various tools and not delivering a correct message is "
146143
"unacceptable. In such cases the reports should be closely monitored, and the target setting should "
147144
"be 'quarantine' or 'reject'.",
145+
"DMARC politika yra 'none', tai reiškia, kad be raportavimo nebus vykdoma jokia papildoma veikla.\n\n"
148146
"Politika apibūdina, kokį veiksmą turi atlikti gavėjo serveris pastebėjęs pranešimą, kuris nepasiekė patvirtinimo. "
149147
"Politika 'quarantine' siūlo gavėjo serveriui žymėti pranešimą kaip spam ir politika 'reject' siūlo gavėjo serveriui "
150148
"atmesti pranešimą. Rekomenduojame naudoti politiką 'quarantine' arba 'reject'.\n\n"
@@ -155,8 +153,26 @@
155153
"turėtų būti 'quarantine' arba 'reject'.",
156154
),
157155
(
158-
"DMARC subdomain policy is 'none', which means that besides reporting no action will be taken for e-mails coming from subdomains. ",
159-
"DMARC subdomeno poliika yra 'none', tai reiškia, kad DMARC nustatymas nėra veiksmingas subdomenams.",
156+
"DMARC subdomain policy is 'none', which means that besides reporting no action will be taken for e-mails coming from subdomains. \n\n"
157+
"The policy describes what action the recipient server should take when noticing "
158+
"a message that doesn't pass the verification. 'quarantine' policy "
159+
"suggests the recipient server to flag the message as spam and 'reject' policy suggests the recipient "
160+
"server to reject the message. We recommend using the 'quarantine' or 'reject' policy.\n\n"
161+
"When testing the DMARC mechanism, to minimize the risk of correct messages not being delivered, "
162+
"the 'none' policy may be used. Such tests are recommended especially when the domain is used to "
163+
"send a large number of e-mails using various tools and not delivering a correct message is "
164+
"unacceptable. In such cases the reports should be closely monitored, and the target setting should "
165+
"be 'quarantine' or 'reject'.",
166+
"DMARC subdomeno poliika yra 'none', tai reiškia, kad DMARC nustatymas nėra veiksmingas subdomenams.\n\n"
167+
"DMARC politika yra 'none', tai reiškia, kad be raportavimo nebus vykdoma jokia papildoma veikla.\n\n"
168+
"Politika apibūdina, kokį veiksmą turi atlikti gavėjo serveris pastebėjęs pranešimą, kuris nepasiekė patvirtinimo. "
169+
"Politika 'quarantine' siūlo gavėjo serveriui žymėti pranešimą kaip spam ir politika 'reject' siūlo gavėjo serveriui "
170+
"atmesti pranešimą. Rekomenduojame naudoti politiką 'quarantine' arba 'reject'.\n\n"
171+
"Testuojant DMARC mechanizmą, siekiant sumažinti riziką, kad teisingi pranešimai nebus pristatyti, "
172+
"gali būti naudojama 'none' politika. Tokie testai yra rekomenduojami ypač, kai domenas naudojamas "
173+
"siųsti didelį kiekį el. laiškų naudojant įvairias priemones, o neteisingo pranešimo pristatymas "
174+
"yra nepriimtinas. Tokiais atvejais raportai turėtų būti atidžiai stebimi, o nustatyti nustatymai "
175+
"turėtų būti 'quarantine' arba 'reject'.",
160176
),
161177
(
162178
"rua tag (destination for aggregate reports) not found",
@@ -593,11 +609,7 @@
593609
"poprawnie dostarczane.",
594610
),
595611
(
596-
"DMARC policy is 'none', which means that besides reporting no action will be taken. ",
597-
"Polityka DMARC jest ustawiona na 'none', co oznacza, że oprócz raportowania, żadna dodatkowa akcja nie zostanie "
598-
"wykonana.",
599-
),
600-
(
612+
"DMARC policy is 'none', which means that besides reporting no action will be taken. \n\n"
601613
"The policy describes what action the recipient server should take when noticing a message that doesn't "
602614
"pass the verification. 'quarantine' policy suggests the recipient server to flag the message as spam and "
603615
"'reject' policy suggests the recipient server to reject the message. We recommend using the 'quarantine' "
@@ -607,6 +619,8 @@
607619
"send a large number of e-mails using various tools and not delivering a correct message is "
608620
"unacceptable. In such cases the reports should be closely monitored, and the target setting should "
609621
"be 'quarantine' or 'reject'.",
622+
"Polityka DMARC jest ustawiona na 'none', co oznacza, że oprócz raportowania, żadna dodatkowa akcja nie zostanie "
623+
"wykonana.\n\n"
610624
"Polityka DMARC opisuje serwerowi odbiorcy, jaką akcję powinien podjąć, gdy wiadomość nie zostanie poprawnie "
611625
"zweryfikowana. Polityka 'quarantine' oznacza, że taka wiadomość powinna zostać oznaczona jako spam, a polityka 'reject' - że "
612626
"powinna zostać odrzucona przez serwer odbiorcy. Rekomendujemy korzystanie z polityki 'quarantine' lub 'reject'.\n\n"
@@ -617,9 +631,26 @@
617631
"a docelowym ustawieniem powinno być 'quarantine' lub 'reject'.",
618632
),
619633
(
620-
"DMARC subdomain policy is 'none', which means that besides reporting no action will be taken for e-mails coming from subdomains. ",
634+
"DMARC subdomain policy is 'none', which means that besides reporting no action will be taken for e-mails coming from subdomains. \n\n"
635+
"The policy describes what action the recipient server should take when noticing a message that doesn't "
636+
"pass the verification. 'quarantine' policy suggests the recipient server to flag the message as spam and "
637+
"'reject' policy suggests the recipient server to reject the message. We recommend using the 'quarantine' "
638+
"or 'reject' policy.\n\n"
639+
"When testing the DMARC mechanism, to minimize the risk of correct messages not being delivered, "
640+
"the 'none' policy may be used. Such tests are recommended especially when the domain is used to "
641+
"send a large number of e-mails using various tools and not delivering a correct message is "
642+
"unacceptable. In such cases the reports should be closely monitored, and the target setting should "
643+
"be 'quarantine' or 'reject'.",
621644
"Polityka DMARC dla subdomen jest ustawiona na 'none', co oznacza, że oprócz raportowania, żadna dodatkowa akcja nie zostanie "
622-
"wykonana w przypadku e-maili pochodzących z subdomen. ",
645+
"wykonana w przypadku e-maili pochodzących z subdomen. \n\n"
646+
"Polityka DMARC opisuje serwerowi odbiorcy, jaką akcję powinien podjąć, gdy wiadomość nie zostanie poprawnie "
647+
"zweryfikowana. Polityka 'quarantine' oznacza, że taka wiadomość powinna zostać oznaczona jako spam, a polityka 'reject' - że "
648+
"powinna zostać odrzucona przez serwer odbiorcy. Rekomendujemy korzystanie z polityki 'quarantine' lub 'reject'.\n\n"
649+
"W trakcie testów działania mechanizmu DMARC, w celu zmniejszenia ryzyka, że poprawne wiadomości zostaną "
650+
"odrzucone, może być tymczasowo stosowane ustawienie 'none'. Takie testy są szczególnie zalecane, jeśli "
651+
"domena służy do wysyłki dużej liczby wiadomości przy użyciu różnych narzędzi, a potencjalne niedostarczenie "
652+
"poprawnej wiadomości jest niedopuszczalne. W takich sytuacjach raporty powinny być dokładnie monitorowane, "
653+
"a docelowym ustawieniem powinno być 'quarantine' lub 'reject'.",
623654
),
624655
(
625656
"rua tag (destination for aggregate reports) not found",

scan/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name="libmailgoose",
12-
version="1.3.7",
12+
version="1.3.8",
1313
description="libmailgoose - check the settings needed to protect against e-mail spoofing",
1414
author="CERT Polska",
1515
author_email="info@cert.pl",

0 commit comments

Comments
 (0)