Repository navigation
Add check commands: tls, dns, headers, email - #2
Merged
Merged
Conversation
Four local network checks with plain-language findings, --json, --timeout and exit codes 0/1/2. They live in internal/check and are kept out of the SSH app; cmd/ssh-site/imports_test.go enforces it.
…n, CSP, redirects, CNAME chains, IDN SPF stops at the first all, counts redirect only when used, checks the mx host limit, ip4/ip6 syntax and macros. DMARC needs v=DMARC1 exactly and explains t=y. DKIM, MTA-STS and TLS-RPT records are validated. CSP covers script-src-elem/-attr and all policies for frame-ancestors; HSTS duplicates and repeated Referrer-Policy headers are handled. Only real redirect statuses are followed and --timeout covers dial and TLS. CNAME-only answers are followed to their end. International names are converted with IDNA and shown in both forms. DKIM not found and missing Referrer-Policy/Permissions-Policy are now info.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
devops-daily check(andddy check), four local network checks with plain-language findings:check tls <host[:port]>: TLS version, cipher, certificate (SANs, issuer, dates, days left, warn at 21 days or less), chain, trust against system roots, host name match, OCSP stapling.check dns <name> [--type ...] [--server IP]: records with TTLs and the CNAME chain, followed to its end (dangling aliases and loops fail). Uses miekg/dns.check headers <url>: each redirect hop (301/302/303/307/308), then pass/warn/missing for the security headers (CSP incl.script-src-elem/-attr, all policies), plus cache headers and Server. No grades.check email <domain>: MX, SPF (evaluated like a receiver: firstall, lookups toward 10, mx host limit, ip4/ip6 syntax, macros), DMARC (v=DMARC1, policy, pct, rua,t=y), DKIM for common selectors plus--selector(malformed keys fail), MTA-STS (id) and TLS-RPT (rua).International names work (
bücher.deis checked asxn--bcher-kva.de, both shown). All take--jsonand--timeout(default 5s). Exit codes: 0 all good, 1 warnings, 2 a problem or error. Each report ends with one Learn more link. No telemetry: only the checked host and the DNS server are contacted. Tests use local httptest TLS servers and a local DNS server, no internet.Not in the SSH app. The checks live in
internal/checkand onlyinternal/cliuses them.cmd/ssh-site/imports_test.gowalks the server's imports and fails if it reachesinternal/checkorinternal/cli(checked by planting an import: the test fails).Example output (real runs):
ddy check tls expired.badssl.com(expired certificate)ddy check tls bücher.de(international name)ddy check dns www.github.com --type A,AAAA,MX --server 1.1.1.1(CNAME chain)ddy check headers devops-daily.com(our site)ddy check headers http://github.com(redirect and headers)ddy check email devops-daily.com --server 1.1.1.1(our domain)ddy check email gmail.com --server 1.1.1.1(SPF, DMARC, MTA-STS)