Skip to content

Commit

Permalink
internetstandards#881 add new mail auth subcategory for TLS-RPT
Browse files Browse the repository at this point in the history
  • Loading branch information
uwekamper committed Feb 10, 2024
1 parent a4678d0 commit ef6031c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions checks/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def __init__(self, name="mail-auth"):
MailAuthDkim,
MailAuthSpf,
MailAuthSpfPolicy,
MailAuthTlsRptExists,
]
super().__init__(name, subtests)

Expand Down Expand Up @@ -2246,6 +2247,36 @@ def result_bad_redirect(self, tech_data):
self.tech_data = tech_data


class MailAuthTlsRptExists(Subtest):
def __init__(self):
super().__init__(
name="spf",
label="detail mail auth tlsrpt label",
explanation="detail mail auth tlsrpt exp",
tech_string="detail mail auth tlsrpt tech table",
worst_status=scoring.MAIL_AUTH_SPF_WORST_STATUS,
full_score=scoring.MAIL_AUTH_SPF_PASS,
model_score_field="spf_score",
)
# Fix for one line, one value data.
self.tech_data = [[self.tech_data]]

def result_good(self, tech_data):
self._status(STATUS_SUCCESS)
self.verdict = "detail mail auth spf verdict good"
self.tech_data = [[tech_data]]

def result_bad(self, tech_data):
self._status(STATUS_FAIL)
self.verdict = "detail mail auth spf verdict bad"
if tech_data:
# More than one spf record. Show the records.
self.tech_data = [[tech_data]]
else:
self.tech_data = ""
self.tech_type = ""


# --- APPSECPRIV
class WebAppsecprivHttpXFrame(Subtest):
def __init__(self):
Expand Down

0 comments on commit ef6031c

Please sign in to comment.