It's impossible to detect an open wireguard port as no response is generated unless you have the correct key. SSH on the other hand is easily scanned for.
To be clear, this is not about the pre-shared key. What you need is a hash of the server's public key for the initial handshake. The PSK is only used after that.
i don’t think so. i whitelist my vpn IP for ssh into a few machines and when i forget to turn my VPN on and try to access it, i get “permission denied (public key)”. whereas if i close port 22 entirely i get “network not reachable”.
You’re both right. If sshd is enforcing the whitelist you should see what you see. If instead you’ve got some kind of firewall mediating the traffic, then you should be invisible to anyone outside the whitelist.
I've had success allow listing the whole IPv6 ASN block my ISP owns. It cuts down on all the drive by attempts and if someone on my ISP's network was trying to break in they'll still need to defeat SSH before I notice the stream of failed login attempts and report them.
I have the naive hope that as a paying customer of my ISP they'll take my abuse report involving a fellow customer seriously.
Yup. Since figuring out how to get it to advertise a route to my home private up range (from my home server which is always connected) I just leave Tailscale on most of the time I’m not at home and I’m always able to connect to anything at home. I don’t even have to make that my exit node, which is great because my DOCSIS uplink speed is crap.
The phrase "security thru obscurity" is something that people parrot because they heard it somewhere and it makes them feel smart. In reality, all cybersecurity is security thru obscurity. There's nothing else but obscurity. The entire field of encryption is literally obscuring.
A thinking person understands that security, like obscurity, is just a matter of degree, and the only lever you have is increasing the cost for the attacker by increasing obscurity. Security isn't binary, it's a matter of degree in the form of cost.
Obscure as in "I'm using a port nobody can guess" and obscure as in "I multiplied two large primes together that nobody can guess" are very different. Crypto is definitely obscuring, but it is muddying the waters too much to conflate them.
Just to nipick, that's 2 bytes, so 16 bits of secrecy (a bit less if you choose to avoid other well-known port numbers).
EDIT: And on a practical level, the port number is sent as plaintext in the packet header, and generally much easier to snoop on than a secret sent in the data.
Not really, because the port is observable over the wire. It’s no bits of secrecy once comms have been watched. That’s the difference between real security and security through obscurity.
Though there is a point to be made to also make obscurity a layer of your defence strat (albeit not effective for all threat models, and brittle).
After all, most organisations dont put out their whole network design, serverpark documentation and infra architecture out in the open. It usually goes by many names, like 'company secret', 'internal knowledge', 'NDA', but in the end its all just obscurity.
For me it just another layer of the onion. I don't really consider it security, though I do qualify it as some sort of defence.
There's a reason militaries don't paint their tanks bright pink...
No one expects camo paint to stop a projectile, that's what the armor is for. But in an ideal scenario you don't get hit by the projectile in the first place, and that's what the camo is for.
Militaries have in the past used bright colours, for good reasons. Muted camo colours being good is a contingent fact dependent on a particular range of technological development, not an absolute law.
> In reality, all cybersecurity is security thru obscurity.
No, that's not what that word means. "Obscurity" means low/no entropy. If you're leaning on a "secret" int between 0 and 65,536 then it's going to break. If your secret is a random int between 0 and 2^2048 then that's not "obscurity", that's an actual secret.
> the practice of concealing the details or mechanisms of a system to enhance its security
By that Wikipedia definition, Wireguard is more obfuscated than SSH because it won't reveal that it exists to unauthorized users. This enhances its security.
Your example creates a binary that begs the question: how much entropy does it take to advance from obscurity to secret? "Defense in depth" implies many layers of imperfect obfuscation/secrets.
Security through obscurity means "as long as nobody knows our process we're safe"
Which is true in cryptography, knowing that primes are used does not suddenly make it surmountable.
If your security is that the ssh port is x, REGARDLESS of how many bits there are, it's security through obscurity. Someone reading the process would immediately know.
If your process is randomly picking a port, then that's not. You'd have to figure out how to communicate that port to your users though.
> In reality, all cybersecurity is security thru obscurity.
I'm usually not here to debate semantics, but good god, trusting in cryptographically secure algorithms is a much stronger promise of security than something like, say, port-knocking.
Just because the math behind these algorithms are being put under a lot more pressure than we could imagine a decade ago doesn't mean we should throw the baby out with the bathwater. If anything, it's a good thing to validate that our assumptions are true, and correct the assumptions we had incorrect.
>I'm usually not here to debate semantics, but good god, trusting in cryptographically secure algorithms is a much stronger promise of security than something like, say, port-knocking.
That’s his point though. That some forms of obscurity are much stronger and aren’t bad.
> There's nothing else but obscurity. The entire field of encryption is literally obscuring.
They're conflating cryptographically secure math with all manners of obscurity through security as being the same. Do you not see how dangerous and silly that claim is?
> A thinking person understands that security, like obscurity, is just a matter of degree, and the only lever you have is increasing the cost for the attacker by increasing obscurity. Security isn't binary, it's a matter of degree in the form of cost.
This doesn't make sense, and honestly sounds like AI-generated ragebait.
Yes! Thank you for saying this. It bugs me when people don't understand this. Of course, cryptographic obscurity has some measurement of obscurity associated with it, which is why it is valuable.
The phrase is imprecise in its meaning. No dictionary definition of obscure would make it apparent. But the point is that some information has to be held back, even if it is only the key. That's what is obscure.
This is an absurd reduction and nobody serious things ACLs on source IPs are on the same spectrum as encryption. These things are qualitatively different.
Port knocking or source IP filtering is trivially defeated by an attacker that can observe any traffic in the chain of a legitimate traffic exchange. The entire class of things people call “security through traffic obscurity” are these trivial things that only help against bulk automation.
These are extra things you sprinkle on to buy you more time from 0-day bot farms (not 0-day dedicated attackers who have watched your traffic), but they are not a replacement for real security that gives you well bounded guarantees through cryptography.
The people who think “it’s all security bro” are the ones who end up losing their crypto money when their ISP gets BGP hijacked by a dedicated attacker. “The IP was hardcoded, how could they possibly take over!?!?”
Yes, it is. And code is data.
"Security through obscurity" is all that exists.
Cryptography is, in good part, about the practice of using mathematics for the assurance of sufficiently sophisticated obscurity.
The trope of "security through obscurity bad" does not survive scrutiny, because it was never meant to. It's a "practical sense" shorthand, not something to actually deeply consider like this. It falls apart immediately when you do.
Most obscurity is not sophisticated. The things the users are doing aren't much different than a kid hiding behind a sofa and they think their dad doesn't know where they are any longer.
I really do wonder how the cookie will crumble with hardness assumptions in this regard.
The currently trending story may be that it is only a matter of time before the frontier AI labs crack all crypto and then we're hosed, but it's also possible they find hardness proofs and better constructions instead.
Though maybe their focus is not pointing that way right now / counterarguments may continue to be more discoverable.
Nothing wrong with security through obscurity, even in its most naive form of changing your port ranges and stuff like that. It's only a problem when some obscurity is the only method of securing.
Obscurity adds layers of security, and security is all about layering and increasing the difficulty, not about some perfect binary solution secure vs not secure.
Defense-in-depth does not use security-through-obscurity alone, but obscurity can still be a valuable part of a complete strategy. You should know better than "obscurity makes a system less secure"
There have been a variety of issues with different SSH daemon implementations and configurations. You can also just make a dangerous mistake with your own configuration, or a cloud provider can easily have a bad default cloud-init sshd config that overrides your safe config, etc.
One good example:
regreSSHion, CVE-2024-6387, is an unauthenticated remote code execution in OpenSSH’s server (sshd) that grants full root access. It affects the default configuration and does not require user interaction. It poses a significant exploit risk.https://www.qualys.com/regresshion-cve-2024-6387
With WireGuard, using a pre-shared key, attackers are interacting with virtually no code unless they have a valid encrypted packet, and then they still need the peer key to connnect.
With an SSH server, there's a lot of code being executed by any remote attacker pre-authentication. Any exploit in this code can grant access. This is just inherently more risky.
I'm weakly inclined to view wireguard as even safer than openssh, but that's not the same as saying that the latter is proven unsafe. As that link notes, that was "the first OpenSSH vulnerability in nearly two decades", and while it was bad, it doesn't appear that anyone demonstrated exploitation against a 64-bit host, and openssh's response ( https://lists.mindrot.org/pipermail/openssh-unix-announce/20... ) was to promptly separate components precisely to reduce the amount of code that an unauthenticated attacker can even possibly reach. Wireguard has less code and is deliberately harder to hold wrong, but what code it has is running in ring zero, which a person could also describe as "just inherently more risky".
Again, not wanting to act like wireguard is bad or openssh is perfect. I just think your comment is a bit far the other way.
> As that link notes, that was "the first OpenSSH vulnerability in nearly two decades"...
The quote is "OpenSSH vulnerability in nearly two decades—an unauthenticated RCE that grants full root access" which is qualified because there have been other significant OpenSSH security vulnerabilities over the years.
You're also ignoring the sshd misconfiguration issue which is a serious problem. OpenSSH supports password authentication among other potential footguns.
> Wireguard has less code and is deliberately harder to hold wrong, but what code it has is running in ring zero, which a person could also describe as "just inherently more risky".
That "regreSSHion" exploit above was a remote root exploit. There's no practical difference between root access and a "ring zero" kernel exploit in most cases.
WireGuard is over a decade old at this point, so the record speaks for itself.
There's definitely more room for user error with SSH. At one point I thought I was hardening my /etc/ssh/sshd_config by adding things to the end to override the defaults. Turns out that config file is "first rule wins", so my changes had no effect.
Wait, did I miss something? When has opensshd proven dangerous to expose?