1
0
mirror of https://github.com/jschauma/spf.git synced 2024-05-09 09:54:51 +00:00

40 Commits

Author SHA1 Message Date
4a68820aaf Pin Debian version
Add missing socket6 library
2024-03-13 12:19:39 -07:00
e00198f9f0 pretty-print large numbers with thousands-separator 2024-03-11 23:00:47 -04:00
f369cdd4cf regen 2024-02-07 09:59:47 -05:00
ba9cd7a61a sync with new usage 2024-02-07 09:58:16 -05:00
273c5b34ac remove rendered man page when running 'make clean' 2024-02-07 09:57:03 -05:00
31503867dc '-f perl' was meant, not '-b perl' 2024-02-07 09:52:36 -05:00
f2c9ce42a3 put /usr/local shebang back - this is what the Makefile keys on to update the path 2024-02-07 09:52:04 -05:00
7780ab3cbc Merge pull request #5 from randolf/patch-1
Merge added features from @randolf to display big numbers without scientific notation, add '-f <format>' option (to obsolete '-j').
2024-02-07 14:50:56 +00:00
8615800ddc Update TODO 2024-02-06 23:41:12 -08:00
0800192fa2 Update README.md
Updated sample output for sample SPF analysis of github.com to reflect changes to updated code, plus various other changes.  (I don't know where else to add these, so I saved them here again for easier copying to the right template files later.)
2024-02-06 23:20:46 -08:00
37e36496a7 Update spf.1.txt
Updated command line options (I assume this is documentation for the Unix/Linux "man" pages?) and added the names of all contributors to the history section.
2024-02-06 23:10:47 -08:00
b8135dc07e Update spf.1.txt
Updated command line options (I assume this is documentation for the Unix/Linux "man" pages?) and added the names of all contributors to the history section.
2024-02-06 23:07:27 -08:00
cf36159cf9 Update CHANGES 2024-02-06 23:00:19 -08:00
2e7221f308 Update spf.1 2024-02-06 22:57:38 -08:00
05a59ee9fc Update spf.pl
Additional changes based on suggestions by @jschauma after code review
2024-02-06 22:52:10 -08:00
7b289b6791 Update spf.1
It seems this doesn't contain all the information for generating README.md, and it's also a new format for me -- I hope my edits are correct (please compare with the README.md I supplied, particularly that the "-f format" option be enclosed in square brackets after generating the new README.md file).
2024-02-04 14:43:19 -08:00
907cbec2b8 Update README.md 2024-02-04 06:54:32 -08:00
730c6ec7f6 Update spf.pl 2024-02-04 06:52:01 -08:00
b13d00fb21 Update README.md 2024-02-04 06:51:17 -08:00
1f94489d2b Update CHANGES 2024-02-04 06:43:17 -08:00
0db43d7e32 Added new features to spf.pl 2024-02-04 06:32:03 -08:00
200b7db5a8 allow the user to specify resolvers by name
This addresses https://github.com/jschauma/spf/issues/4 and allows
'spf -r 2620:fe::fe' as well as 'spf -r dns.quad9.net'.

This of course means that we need to use the local default resolver
to resolve the given name before we then use the IP addresses of
the given resolver.
2023-05-04 17:46:47 -04:00
8e4c1ec9e4 don't count MX result lookups against the DNS lookup limit
Counterintuitively, the lookups performed to turn the MX lookup results
into IP addresses are _not_ counted towards the total DNS lookup
limit.

See https://mailarchive.ietf.org/arch/msg/spfbis/AFvCBHV_QkaifWJpVaA6FCg_VT8/
for a discussion.
2023-01-16 12:27:21 -05:00
70efecde81 switch to using $rr->txtdata to accommodate older versions of Net::DNS
On certain older versions of Net::DNS, larger DNS records are returned using

( "data"
  "data )

_with_ the parenthesis; using $rr->rdstring would then lead to a string
that won't match our regex.  Instead, use $rr->txtdata after ensuring
we are dealing with a TXT record.

Reported by Amier Saleh
2022-09-27 16:09:38 -04:00
5093798868 add sample output 2022-09-19 08:55:32 -04:00
4483ea9d04 expand install instructions 2022-09-06 23:57:35 -04:00
0edffae0a3 Merge branch 'main' of github.com:jschauma/spf 2022-09-06 23:50:46 -04:00
2fe865ceb0 more accurately count IPs from CIDRs and other expansions
Previously, we simply counted all IPs plus the sizes of all CIDRs
we encountered.  However, it's possible for some of the IPs to
be within a CIDR, or for there to be overlapping CIDRs.

With this commit, we now laboriously keep track of all CIDRs,
add individual IPs as /32 or /128 CIDRs, and then dedupe the
CIDRs before counting the total IPs.

Yes, this is a whole lot of change for something that rarely
happens.
2022-09-06 23:47:57 -04:00
63ecf7b547 add usage statement
cidrs are stored in a variable called cidrs, not ips
2022-09-02 17:17:43 -04:00
f3e3aa9ec0 add '-p' option to pass a policy to expand 2022-09-02 17:09:25 -04:00
45bc607b2d Merge pull request #3 from p4tpr0/main
Simple dependencies handling for FreeBSD
2022-09-01 09:38:47 -04:00
dd79b80311 simple dependencies handling for FreeBSD 2022-09-01 07:59:08 +02:00
8b76315615 provides dependancies instruction for FreeBSD 2022-09-01 07:56:22 +02:00
4812afe6ae match "a:domain/v4cidr//v6dir" correctly
RFC7208 does indeed appear to mandate a double slash, and miscellaneous
online validators expect it, suggesting that whether this was the intention
or not, we want to match only the following:

a
a:domain
a:domain/v4cidr
a:domain/v4cidr//v6cidr
a:domain//v6cidr
a/v4cidr
a/v4cidr//v6cidr
a//v6cidr

(and likewise for mx).
2022-08-31 17:24:04 -04:00
7de372c65c Merge branch 'main' of github.com:jschauma/spf 2022-08-31 15:22:57 -04:00
ffffdb144b add Dockerfile from @Techbrunch
Verbatim from https://github.com/jschauma/spf/issues/2
2022-08-31 15:22:25 -04:00
b308035313 add a TODO 2022-08-31 15:20:25 -04:00
e38aecbad5 Merge pull request #1 from roycewilliams/main
add apt install howto
2022-08-30 21:29:57 -04:00
866dff0937 add apt install howto 2022-08-30 17:14:55 -08:00
6f8fcff364 Initial import of the 'spf' utility.
See https://www.netmeister.org/blog/spf.html for a longer discussion.

NAME
     spf - report on the given domain's use of SPF

SYNOPSIS
     spf [-Vhjv] [-r address] domain

DESCRIPTION
     The spf tool allows you to inspect the Sender Policy Framework DNS records
     for the given domain.

OPTIONS
     The following options are supported by spf:

     -V		 Print version information and exit.

     -h		 Display help and exit.

     -j		 Generate output in json format.

     -r address	 Explicitly query this resolver.

     -v		 Be verbose.  Can be specified multiple times.

DETAILS
     The Sender Policy Framework (SPF) defined in RFC7208 specifies the format
     for the SPF DNS entries a domain may choose to apply.  These entries can
     range from the straight forward to the complex, harboring certain surprises
     or unintenionally obscuring important information, such as when one domain
     includes the SPF records of another domain.

     spf can be used to report on the comprehensive ruleset derived from the DNS
     record.  It does that by counting CIDRs, resolving e.g., MX records, and
     recursively looking up SPF records of any included domains.

EXAMPLES
     The following examples illustrate common usage of this tool.

     To report on the SPF records for the domain netmeister.org:

	   spf netmeister.org

     To query Quad9's public resolver for the same SPF records and report the
     results in json format:

	   spf -r 2620:fe::fe -j netmeister.org

EXIT STATUS
     The spf utility exits 0 on success, and >0 if an error occurs.

SEE ALSO
     dig(1)

HISTORY
     spf was originally written by Jan Schaumann <jschauma@netmeister.org> in
     July 2022.

BUGS
     Please file bugs and feature requests by emailing the author.
2022-08-30 18:25:43 -04:00