Remix.run Logo
▲ jacobgold an hour ago

I've always used the WireGuard pre-shared key option on my WireGuard servers. It's what gives me confidence that an open WireGuard port on the public internet is safe.

Whereas a public open SSH port has always seemed (and proved) dangerous, now more than ever.

Thanks Jason!

▲yjftsjthsd-h an hour ago | parent | next [-]

> Whereas a public open SSH port has always seemed (and proved) dangerous, now more than ever.

Wait, did I miss something? When has opensshd proven dangerous to expose?

▲FredFS456 an hour ago | parent | next [-]

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.

▲bmenrigh an hour ago | parent | next [-]

This is an argument for security-through-obscurity.

▲bikvfeee 20 minutes ago | parent | next [-]

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.

▲danlitt 3 minutes ago | parent | next [-]

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.

▲jjmarr 12 minutes ago | parent | prev | next [-]

The NSA itself has a secret suite of cryptographic primitives for this exact reason.

https://en.wikipedia.org/wiki/NSA_Suite_A_Cryptography

▲comboy a minute ago | parent | prev [-]

Explain how one time pad is security by obscurity.

▲arijun 22 minutes ago | parent | prev | next [-]

Is a password security through obscurity, since it’s just some not-well-known (known by one) string?

Security through obscurity mostly refers to the attacker not knowing how the system works, not hiding information.

▲perching_aix a minute ago | parent | next [-]

[delayed]

▲ 8 minutes ago | parent | prev [-]
[deleted]
▲sva_ 7 minutes ago | parent | prev | next [-]

Layered security*

▲LoganDark 11 minutes ago | parent | prev | next [-]

Defense in depth does not use security through obscurity alone, but obscurity can still be a valuable part of a complete strategy. Screw off with your "obscurity makes a system less secure" rhetoric.

▲Zarathustra30 22 minutes ago | parent | prev [-]

Security-through-obscurity is another slice of Swiss cheese, albeit one with a big hole.

▲icedchai an hour ago | parent | prev [-]

I would hardly consider that "dangerous."

▲jacobgold an hour ago | parent | prev | next [-]

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.

▲yjftsjthsd-h 26 minutes ago | parent | next [-]

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.

▲lazide 24 minutes ago | parent | prev [-]

Eh, many crypto stacks are full of holes and exploits

▲lazide 25 minutes ago | parent | prev [-]

It’s been awhile, but there have been exploits. Also constant attempts.

▲bikvfeee 16 minutes ago | parent | prev | next [-]

Are pre shared keys the peer keys? Or something separate?

▲gruez 9 minutes ago | parent [-]

No, because in a config you have two keys:

    [Peer]
    PublicKey = abc...
    PresharedKey = xyz...
▲duttish 20 minutes ago | parent | prev | next [-]

Hm how do you manage the keys? I have guesses but figured I'd just ask.

▲icedchai an hour ago | parent | prev [-]

You must think I'm crazy having run many servers with public SSH ports since 1996. I remember the telnet days...

▲jacobgold 40 minutes ago | parent [-]

Nah, it's not that risky with private keys, timely security updates , and a correct configuration. But you'd be much safer with WireGuard in front.

I've been around long enough to remember upgrading servers from telnet to ssh. Some of those servers were on the public internet with `root` / `rootroot` credentials, which wasn't all that dangerous back then either, which is very funny now.