News for hackers. Stuff that matters.
Re:FreeBSD SSH Hardening by tiffanyh on Wednesday September 15, 2021 @09:59AM (#28539101)
Is Spiped similar in-concept to a VPN?
Re:FreeBSD SSH Hardening by cperciva on Wednesday September 15, 2021 @10:13AM (#28539276)
Sort of. Not really. spiped operates at the level of individual stream connections, so you can e.g. make one end a local socket in a filesystem and use UNIX permissions to control access to it.

In fact that's exactly why I wrote it -- so I could have a set of daemons designed to communicate via local sockets and transparently (aside from performance) have them running on different systems.

Re:FreeBSD SSH Hardening by sillysaurusx on Wednesday September 15, 2021 @02:28PM (#28542562)
Is it possible to use tarsnap's deduplication code on my own server? We're setting up an ML dataset distribution box, and I was hoping to avoid storing e.g. imagenet as a tarball + untar'd (so that nginx can serve each photo individually) + imagenet in TFDS format.

https://github.com/xolox/dedupfs was the closest I found, but it has a lot of downsides.

Has anyone made an interface to tarsnap's tarball dedup code? A python wrapper around the block dedup code would be ideal, but I doubt it exists.

(Sorry for the random question -- I was just hoping for a standalone library along the lines of tarsnap's "filesystem block database" APIs. I thought about emailing this to you instead, but I'm crossing my fingers that some random HN'er might know. I'm sort of surprised that filesystems don't make it effortless. In fact, I delayed posting this for an hour to go research whether ZFS is the actual solution -- apparently "no, not unless you have specific brands of SSDs: https://www.truenas.com/community/resources/my-experiments-i..." which rules out my non-SSD 64TB Hetzner server. But like, dropbox solved this problem a decade ago -- isn't there something similar by now?)

EDIT: How timely -- Wyng (https://news.ycombinator.com/item?id=28537761) was just submitted a few hours ago. It seems to support "Data deduplication," though I wonder if it's block-level or file-level dedup. Tarsnap's block dedup is basically flawless, so I'm keen to find something that closely matches it.

Re:FreeBSD SSH Hardening by gperciva on Wednesday September 15, 2021 @03:00PM (#28542958)
> Has anyone made an interface to tarsnap's tarball dedup code?

Tarsnap's deduplication code is not available under an open-source license.

Re:FreeBSD SSH Hardening by sillysaurusx on Wednesday September 15, 2021 @03:15PM (#28543137)
True, but a couple years ago I ported most of the Tarsnap dedup algorithms to Python. It wasn't too hard, just time consuming. I was hoping someone else did that in a thorough way, but I guess the intersection of "I love tarsnap's design!" and "I have the time to port it from C!" might not be too large.
Re:FreeBSD SSH Hardening by akerl_ on Wednesday September 15, 2021 @10:11PM (#28547122)
This may be a foolish question, but if the dedup code isn’t open source, how did you port it to Python?
Re:FreeBSD SSH Hardening by sillysaurusx on Wednesday September 15, 2021 @10:43PM (#28547334)
Not foolish! The Tarsnap client code is open source, but the license file prohibits anyone from using the code: https://github.com/Tarsnap/tarsnap/blob/master/COPYING

> Redistribution and use in source and binary forms, without modification, is permitted for the sole purpose of using the "tarsnap" backup service provided by Tarsnap Backup Inc.

The codebase is a jewel. I love the design, the way it's organized, the coding style, the algorithms, everything.

My process was to skim Colin's thesis: http://www.daemonology.net/papers/thesis.pdf

Along with the rsync thesis: https://www.samba.org/~tridge/phd_thesis.pdf

Then I started making a mental map of tarsnap: How does it build its deduplication index? How does it decide where block boundaries start within a file? Etc.

Eventually I started coding the algorithms in Python, mostly as a way of understanding the code. It's not actually as hard as it sounds, but you have to be rigorous. (It's a C -> Python conversion, after all, so there's not much room for error.)

My process was basically: Copy the C code into a Python file; comment out the code; for each line, write the corresponding Python; try to get something running as quickly as possible.

It worked pretty well, but I eventually lost interest.

Over the years, I've wanted a deduplication library, and 2021 is no exception. Someday I'll just roll up my sleeves and finish porting it.

Re:FreeBSD SSH Hardening by hrez on Wednesday September 15, 2021 @07:14PM (#28545672)
You can look into btrfs and duperemove for offline dedupe.
Re:FreeBSD SSH Hardening by sillysaurusx on Wednesday September 15, 2021 @09:16PM (#28546717)
Thanks!
Re:FreeBSD SSH Hardening by tiffanyh on Wednesday September 15, 2021 @10:18AM (#28539337)
Thanks Colin! Love all the things you create :)
Re:FreeBSD SSH Hardening by acatton on Wednesday September 15, 2021 @11:46AM (#28540572)
Not really. spiped is more an equivalent to mutual SSL (aka "Client certs SSL"). It basically just encrypts and mutually auths individual connections.

It works at the TCP level, not the IP level.

Re:FreeBSD SSH Hardening by cpach on Wednesday September 15, 2021 @10:04AM (#28539168)
Yes. When spiped was released (2011) there were no really good VPN solutions out there.

Now there is WireGuard, but it wasn’t launched until 2016.

Re:FreeBSD SSH Hardening by amarshall on Wednesday September 15, 2021 @10:57AM (#28539961)
OpenVPN may have its issues (complicated setup vs. e.g. Wireguard, but not vs. e.g. IPsec), but I wouldn’t call it “not good” and it predates spiped by a decade.
Re:FreeBSD SSH Hardening by cpach on Wednesday September 15, 2021 @11:02AM (#28540013)
Ok. I don’t agree there. What I’ve heard from security experts is that WireGuard is vastly superior to OpenVPN.

Addendum: OpenVPN was released in 2001 and there where lots of cryptography-related systems from that era that certainly didn’t age well – IMO OpenVPN is one of those examples.

Re:FreeBSD SSH Hardening by LukeShu on Wednesday September 15, 2021 @04:34PM (#28544012)
OpenVPN's encryption is just TLS. It uses OpenSSL for this, not rolling their own implementation. Yes, there are parts of SSL/TLS that haven't aged well, but... it's good enough for the world's web traffic.
Re:FreeBSD SSH Hardening by amarshall on Wednesday September 15, 2021 @05:54PM (#28544854)
> security experts is that WireGuard is vastly superior to OpenVPN

Superior doesn’t imply the other is “not good”.

> lots of cryptography-related systems from that era that certainly didn’t age well

This doesn’t really mean anything.

> IMO OpenVPN is one of those example

That’s your opinion, but so far you’ve given no evidence.

As the other commenter said: OpenVPN is just TLS via OpenSSL. Yes, at some points it has used now-insecure algorithms, but so have web browsers and most everything else. One wouldn’t configure OpenVPN today the way they did in 2001.

Not that it necessarily means much, but AWS Client VPN is just OpenVPN. AWS, GCP, & Azure all support IPsec VPN which dates back to the ’90s. Just because something has been around for a long time doesn’t mean it hasn’t evolved its cryptography at all.