Elektrine lite

← Feed

@Jerry@hear-me.social

Post #1884808

2024-12-15 13:34 UTC

Important reminder, if you own a domain name and don't use it for sending email. There is nothing to stop scammers from sending email claiming to be coming from your domain. And the older it gets, the more valuable it is for spoofing. It could eventually damage your domain's reputation and maybe get it blacklisted, unless you take the steps to notify email servers that any email received claiming to come from your domain should be trashed. Just add these two TXT records to the DNS for your domain: TXT v=spf1 -all TXT v=DMARC1; p=reject; The first says there is not a single SMTP server on earth authorized to send email on behalf of your domain. The second says that any email that says otherwise should be trashed. If you do use your domain for sending email, be sure to add 3 records: SPF record to indicate which SMTP server(s) are allowed to send your email. DKIM records to add a digital signature to emails, allowing the receiving server to verify the sender and ensure message integrity. DMARC record that tells the receiving email server how to handle email that fails either check. You cannot stop scammers from sending email claiming to be from your domain, any more than you can prevent people from using your home address as a return address on a mailed letter. But, you can protect both your domain and intended scam victims by adding appropriate DNS records. UPDATE: The spf and the dmarc records need to be appropriately named. The spf record should be named "@", and the dmarc record name should be "_dmarc". Here's what I have for one domain. One difference that I have is that I'm requesting that email providers email me a weekly aggregated report when they encounter a spoof. gmail and Microsoft send them, but most providers won't, but since most email goes to Gmail, it's enlightening when they come. #cybersecurity #email #DomainSpoofing #EmailSecurity #phishing

Replies (29)

  • @Aganim@lemmy.world 2024-12-15 13:46

    DMARC record that tells the receiving email server how to handle email that fails either check. Could be that I misunderstood you, but: It tells what to do if no mechanism (DKIM or SPF) results in a pass. DMARC actually only requires one mechanism to pass. So an email with a DKIM fail, but an SPF pass is considered OK. And vice-versa. Edit: good advice by the way regarding protecting your domain reputation, I’ll check our non-email domains at work first thing tomorrow.

    Open ##1896124

  • This is overall best practices and overall correct (as in: you should probably do this, and it will never hurt), but realistically any domain that doesn’t at least have an SPF record will be already treated as unable to send mail at all by any properly configured receiving server, especially ones that would report you to a blocklist. This isn’t bad advice regardless, just a bit redundant.

    Open ##1896128

  • @pasmac@atmasto.com 2024-12-15 14:50

    @Jerry arghh forgot to up date the IP address …. 🤬 Good tip

    Open ##1896129

  • @Jerry No-email [inbound] domains should also set a "null MX", per RFC7505: https://www.rfc-editor.org/rfc/rfc7505.html MX 0 "."

    Open ##1896131

  • @dotslashme@infosec.pub 2024-12-15 15:44

    Very good tip! Thank you.

    Open ##1896139

  • @simrob@social.wub.site 2024-12-15 15:46

    @Jerry thanks for sharing this. It was boosted into my neck of the woods and I don’t actually know who you are - is there a semi-authoritative place this advice is documented that I can 1) double check, because that seems like a good idea at least in principle with security related stuff like this and 2) pass on to others?

    Open ##1896140

  • @cosmicspittle@ecoevo.social 2024-12-15 15:47

    @Jerry Thank you for this

    Open ##1896146

  • @pteryx@dice.camp 2024-12-15 16:01

    @Jerry Last I knew, my roommate who ran a homebrew server was frustrated that they *can't* run an email server because outgoing email was assumed to be spam anyway. It would be nice if there were an actual way out of this!

    Open ##1896147

  • @krelvar@lemmy.world 2024-12-15 16:09

    There is nothing admin-wise I hate more than dealing with email security. Fucking google is horrible. At least when Microsoft randomly decides the half dozen family members on my personal domain are bulk email spammers, there’s a form to reach out. Google is a piece of shit in this way just like in so many other ways.

    Open ##1896158

  • @Jerry thanks for the advice! Shouldn't the dmarc record be added, differently to SPF, to the subdomain of "_dmarc"?

    Open ##1896159

  • @amyipdev@transfem.social 2024-12-15 16:38

    @Jerry@hear-me.social I've never been able to get SPF or DKIM to work properly, honestly. The DKIM information just never sends (using Postfix) and SPF checks don't pass anymore, no clue why. I just gave up at some point.

    Open ##1896161

  • @bogdanbiv@mastodon.social 2024-12-15 16:42

    @Jerry I needed to hear this

    Open ##1896170

  • @me@mastodon.cysioland.pl 2024-12-15 16:56

    @Jerry sometimes I'm getting tons of mail.ru DMARC reports saying that someone has tried to send shittones of mail from my domain but SPF+DKIM stopped them

    Open ##1896171

  • @fennix@infosec.space 2024-12-15 18:01

    @kkarhan @Jerry have domains that predate SPF, requirements unclear. :p

    Open ##1896172

  • @fennix@infosec.space 2024-12-15 19:12

    @kkarhan @Jerry I'm aware, was mostly sarcasm about how no security was baked in in the first place. These solutions are all hacked onto systems that themselves are unreliable and require additional security features to begin to trust. Turtles all the way down, if you will.

    Open ##1896173

  • @Jerry helpful

    Open ##1896174

  • @Xitnelat@wue.social 2024-12-15 18:41

    There's an article at gov.uk also covering DKIM and null-records: https://www.gov.uk/guidance/protect-domains-that-dont-send-email @Jerry

    Open ##1896175

  • @Char@noc.social 2024-12-15 18:58

    @Jerry #email If it helps anyone as an example of a domain w/o email, I have a domain 'hack-char.dev' that has those records configured. Never knew about the null mx, and will put one in today. As a side note, I've seen someone try to spoof a different domain of mine and for some reason gmail sends a bounce to my domain, without rua set. I was wondering if it was an attempt to get a phish through in a bounce, but I don't see how that would be successful.

    Open ##1896177

  • @RobynNuthall@mastodon.nz 2024-12-15 19:05

    @Jerry Thank you!!!

    Open ##1896178

  • @sgsax@mastodon.social 2024-12-15 19:16

    @Jerry Saving this for later. I do run email from my personal domain, but adding spf for a little extra insurance is a good idea.

    Open ##1896179

  • @Jerry The M3AAWG provides best practices for parked domains, including the recommendation to implement a wildcard DKIM record. *._domainkey.example.com TXT “v=DKIM1; p=” https://www.m3aawg.org/sites/default/files/m3aawg_parked_domains_bp-2015-12.pdf

    Open ##1896180

  • @Jerry Thanks for posting this. I never think about this, but I do have several domains and I need to make sure I have the proper DNS records for the new email security stuff. (I date from the days when all you had to worry about were MX records, but I realize we've moved on from that.)

    Open ##1896181

  • @leoncowle@hachyderm.io 2024-12-15 20:36

    @Jerry Great post, as a reminder! I work on this at work, but haven't paid the same attention to my own personal domains. And just a slight FYI, the SPF TXT record does indeed need to be on the apex/root domain, which, yes, some DNS providers use “@“ as a placeholder for, but that's not what “it is called”. Others, like AWS Route53, don't use that nomenclature. R53 writes out the apex/base domain, e.g. “example.com”, to indicate the apex/root domain.

    Open ##1896182

  • @esplovago@mastodon.uno 2024-12-15 21:09

    @Jerry great advice. One question: does this config protect also subdomains?

    Open ##1896184

  • @ferricoxide@evil.social 2024-12-15 21:14

    @Jerry@hear-me.social My domain is older than Google and has had SPF, DKIM and DMARC since each was just exiting proposal stages, yet Google and O365 each see fit to block mail from my MTA (yet I regularly receive spam from each): the 900lb gorillas don't actually care about spam; more that they want everyone to stop self-hosting.

    Open ##1896186

  • @jzakotnik@mastodon.social 2024-12-15 21:49

    @Jerry wow thanks, this is useful

    Open ##1896187

  • @momo@mk.absturztau.be 2024-12-15 22:17

    @Jerry@hear-me.social There’s also a null MX record for the sake of completeness https://serverfault.com/questions/714052/why-is-rfc-7505-null-mx-necessary

    Open ##1896188

  • @b3lt3r@mastodon.b3lt3r.com 2024-12-15 22:28

    @Jerry@hear-me.social would adding those txt records cause any issue to a wildcard redirect I use for myself? I have xxxxx.com and an auto redirect by my dns provider so that anything sent to name@xxxxx.com is forwarded to name@gmail.com so when I give out the address I can see if it's been shared. I like the idea of protecting against unauthorized use but wouldn't want to lose my throwaway capability. I find email servers to be akin to dark arts so am at a loss here tbh.

    Open ##3137286

  • @mirabilos@toot.mirbsd.org 2024-12-15 22:48

    @Jerry@hear-me.social is @ even legal in DNS? (It is not in hostnames, but so is _, so…)

    Open ##3137289