Documentation
¶
Overview ¶
Package tlsrptdb stores reports from "SMTP TLS Reporting" in its database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddReport ¶
func AddReport(ctx context.Context, verifiedFromDomain dns.Domain, mailFrom string, r *tlsrpt.Report) error
AddReport adds a TLS report to the database.
The report should have come in over SMTP, with a DKIM-validated verifiedFromDomain. Using HTTPS for reports is not recommended as there is no authentication on the reports origin.
The report is currently required to only cover a single domain in its policy domain. Only reports for known domains are added to the database.
Prometheus metrics are updated only for configured domains.
Types ¶
type TLSReportRecord ¶
type TLSReportRecord struct { ID int64 `bstore:"typename Record"` Domain string `bstore:"index"` // Domain to which the TLS report applies. FromDomain string MailFrom string Report tlsrpt.Report }
TLSReportRecord is a TLS report as a database record, including information about the sender.
todo: should be named just Record, but it would cause a sherpa type name conflict.
func RecordID ¶
func RecordID(ctx context.Context, id int64) (TLSReportRecord, error)
RecordID returns the report for the ID.
func Records ¶
func Records(ctx context.Context) ([]TLSReportRecord, error)
Records returns all TLS reports in the database.
func RecordsPeriodDomain ¶
func RecordsPeriodDomain(ctx context.Context, start, end time.Time, domain string) ([]TLSReportRecord, error)
RecordsPeriodDomain returns the reports overlapping start and end, for the given domain. If domain is empty, all records match for domain.