9 ms·
Spiped – symmetric, encrypted, authenticated pipes between sockets
- natch 13y agoTo check the sha256 checksum on a system with openssl, in terminal find the download and do: openssl dgst -sha256 spiped-1.3.1.tgz
- cperciva 13y agoMost systems have sha256 or sha256sum utilities, too.
- dfc 13y agogpg --print-md sha256
- jedbrown 13y agoNote that the SHA256 hashes on the linked website are served over HTTP, which is no security against a MITM. If you use the HTTPS site (https://www.tarsnap.com/spiped.html https://www.tarsnap.com/spiped.html) then the tarball links are also HTTPS (same security). Why are we asking people to manually verify hashes when the hash and content enjoy the same level of security?
- mtoledo 13y agowondering the same thing. cperciva, care to elaborate? if you had https/hsts would the hashes be unnecessary?
- cperciva 13y agoThe hashes are there for convenience, not for security.
- malandrew 13y agoI should have posted the https link. If a mod wants to edit the url for this, twould be appreciated. cperciva, why serve http at all or not at least redirect people to https by default?
- cperciva 13y agowhy serve http at all Any sane packaging system will check hashes against known good values after downloading, so using https just opens up more attack surface.
- hueving 13y agoIf they're not using http, where exactly do the known good values come from?
- cperciva 13y agoThe GPG-signed release announcement.
- hueving 13y agoWhile valid, this is an extremely user hostile response. Requiring administrators to dig up release notes and hoping they actually have your gpg key and know what to do with it is essentially giving the middle finger to admins that don't understand crypto well.
- jasomill 13y agoNot really, because admins that don't bother to read release notes or to verify GPG keys should probably be using package management systems maintained by those who do.
- hueving 13y agoThat would be fine if there were never a case where a package management system fell out of date due to a package maintainer not staying on top of things.
- junglhilt 13y agoHow would they get the GPG key securely?
- JosephRedfern 13y agoBeing able to verify the hash of the file can help ensure it didn't get corrupt in transit (rather than maliciously tampered with).
- robbles 13y ago> The simplicity of the code ... makes it unlikely that spiped has any security vulnerabilities. Famous last words :) On a serious note - this looks like a really useful addition to the toolbox of "low-level unix flavored tools". I can see this being a simple basis for connecting infrastructure together without exposing potentially sensitive data.
- cperciva 13y agoFamous last words :) Please audit the code! Just like tarsnap, spiped is eligible for bug bounties. I can see this being a simple basis for connecting infrastructure together without exposing potentially sensitive data. Yes, that's exactly it. The use case is "I have a bunch of servers and I want them to talk to each other securely". Ten years ago this would have just been a matter of stringing cat5 between them, but Cloud changes that.
- deleted 13y ago[deleted]
- PeterisP 13y ago... and as recent public revelations have shown, having dedicated cat5 or fiber between your servers/datacenters doesn't prevent attackers from reading that data; this approach would inconvenience NSA more than that.
- jedismith 13y ago> On a serious note - this looks like a really useful addition to the toolbox of "low-level unix flavored tools". Anyone have a list or collection of these? I feel like I'm missing out on a whole world considering I just learned about spiped from this post.
- stock_toaster 13y agoI have been using spiped for years. Works great!
- b6 13y agoI use spiped every day the same way I would ssh tunnels, except spiped is rock-solid, dealing with flaky network with no problems. I highly recommend it.
- cperciva 13y agoexcept spiped is rock-solid, dealing with flaky network with no problems In case anyone is wondering about this: When you set up an SSH tunnel, you have a single persistent TCP connection which everything runs through. If there's a network glitch which kills that TCP connection, everything dies. With spiped on the other hand, a separate TCP connection is used for each "pipe", so a network glitch won't kill a connection which isn't actively sending data, nor will it prevent future connections from being established.
- beagle3 13y agoEverything you say is true; but in some cases, you want to know that things have disconnected and data won't be coming through even if it should. ssh -L (with ClientAliveInterval / ServerAliveInterval) does that. Also, autossh is good at keeping connections up. (But for the ultra paranoid - spiped sounds like a better deal)
- cperciva 13y agoin some cases, you want to know that things have disconnected and data won't be coming through even if it should ... which is what TCP keepalives are for.
- beagle3 13y agoFirst of all - does spiped give you an option to set TCP_KEEPALIVE on its socket? The README doesn't mention it, and if I understand correctly, unless spiped does it, the application has no way to do it either. But even if not - don't rush to add it: TCP keepalives is the common but practically wrong answer. TCP keepalives kick in after 2 hrs (default), and I've used TCP stacks that wouldn't let you configure it to less than 60 mins. For almost any use over a fragile connection, I'd like to know the connection failed within minutes, not hours. Just to be clear: spiped gives you the same "disconnection detection" guarantee that the underlying TCP gives you in a local network; if you have a connection to another computer, and it unexpectedly reboots / panics / shuts down, and you don't transmit anything - you'll never know the connection is dead with either a TCP connection or a spiped connection (until you try to send something, OR you've configured TCP keepalive _and_ it's been more than 2 hours). However, with ssh using ServerAliveInterval and ClientAliveInterval settings, you'll get active detection and immediate notification when the disconnect is detected. (With ServerAliveInterval 60 and default count of 3, it'll take up to 4 minutes). autossh will also give you automatic reconnect (whether you pipe through the main shell or use -L / -R). Using ssh's keep alive to detect connection problems is a kludge; if you really need this functionality, build it into your protocol. However, if you use it to forward a service you cannot modify (e.g. tunneling HTTP connections from browser to server), I find that it is very useful to let ssh figure out that a connection is borked, rather than wait for hours until the TCP stack of browser realizes that. In fact, I am ashamed to admit that I've used sshuttle on a LAN just so that I get quick disconnect notifications from a computer that had kernel panics. It's ugly, but it does work.
- aba_sababa 13y agoWondering - what's wrong with SSH? Is it considered insecure?
- cperciva 13y agoProbably easiest to answer this with the blog post I wrote when I released this code: http://www.daemonology.net/blog/2011-07-04-spiped-secure-pipe-daemon.html http://www.daemonology.net/blog/2011-07-04-spiped-secure-pip...
- hueving 13y ago>You don't need to be running sshd. Given the relative complexities of the two daemons, it's vastly more likely that your server will be compromised via a vulnerability in sshd than via a vulnerability in spiped. (In fact, if you need to run SSH for the benefit of interactive logins, you're probably better off having sshd only listening on 127.0.0.1 and connecting to it via spiped.) This is a really bad argument. It may be generally true that increased complexity leads to more vulnerabilities in general, but it's not necessary that increased size leads to a large increase in complexity. Poor software design that involves a lot of strange relationships between components inside of an application leads to vulnerabilities. Unless your code base is so small you can provide formal proofs of security, you can make absolutely no assertions based on code size that your code is more or less vulnerably than larger code bases. Additionally, the number of attempts to break OpenSSH because of the massive user-base gives it a stronger security foundation than you to imply. Put another way, there are massive economic incentives for hackers to pour hours into finding vulnerabilities in OpenSSH since it's the gateway to millions of *nix systems on the Internet. Has spiped been subject to that level of scrutiny? As a security-minded person, you should not be making grandiose claims about freshly released software being so much more secure than OpenSSH that it should be used to protect OpenSSH endpoints. Would you trust a newly released symmetric crypto algorithm more than AES just because it performed fewer operations?
- tptacek 13y agoI agree with Colin. I feel much safer with spiped than I would with OpenSSH, even though my opinion of OpenSSH is reasonably high (I trust it more than nginx, for instance). I'm familiar with both codebases, and spiped is just a lot simpler than OpenSSH.
- ing33k 13y agonever heard about this tool, thanks for posting. I installed this but was not able to find manpages for this.. any how found instructions in README ..
- cperciva 13y agoIf you define MAN1DIR then the man pages will be installed.
- pezz 13y agoThanks for this, I just updated the Arch AUR build to include them. FYI - the man pages still say version 1.3.0 :)
- malandrew 13y agoWhat about the MANPATH env var? Is that considered as well? Either way, `brew install spiped` fails on OSX if $MAN1DIR is set because brew works without sudo and all the directories in /usr/share/man are only writeable by root. Obviously not your problem, but just putting it out there. Is MAN1DIR a FreeBSD env var or is it used by other distros? I was bummed out that spiped was not in Red Hat's yum package registry. I wonder if it's in the other distro registries.
- cperciva 13y agoMANPATH is a directive to man to tell it where to look for man pages. Typically it includes multiple directories. MAN1DIR is just a variable name I picked. I was assuming that most people would be installing this code via some sort of packaging system which could set that variable appropriately.
- bbatsell 13y agoFYI, I just submitted a pull request fixing this in homebrew. They're usually pretty good about merging PRs fast, but if you'd like your manpage right now, you can run: brew install https://raw.githubusercontent.com/bbatsell/homebrew/spiped-1.3.1-fixmanpage/Library/Formula/spiped.rb Edit: 1 hour later, it's already been merged. brew update;brew reinstall spiped
- yp_master 13y agoIt's such a simple and useful idea. But being tied to what's in OpenSSL is scary. I have been doing what spiped/spipe does using curvecpserver/curvecpclient.
- cperciva 13y agoBut being tied to what's in OpenSSL is scary. OpenSSL is scary, but spiped only uses a very very small corner of the OpenSSL code. In particular, it doesn't use any SSL code.
- tezza 13y agoI've been using spiped in production now for a few years, ever since the initial announcement here. I tunnel Zabbix health monitoring communications to and from the server. I don't have to worry about setting up users, and each node 'config' is only 1 shared keyfile. If a node is compromised, I can cut it off with one move ( changing the shared key )
- malandrew 13y agoOP here. So quick technical question for those reading this thread since I came across spiped while trying to find a solution to a problem that I believe should be solvable without resorting to spiped or socat. The manpage for sshd_config says that turning off AllowAgentForwarding still doesn't prevent users from setting up their own forwarders. If I have ssh-agent set up to forward to the host I am connecting to, but it has AllowAgentForwarding turned off, is it possible to set up my own forwarder in sshd without changing having to enable it and reconnect with a new session? i.e. is there a way to get the SSH_AUTH_SOCK unix domain socket on my localhost forwarded to the host machine I'm currently sshed into using only the tools likely to be installed on a typical linux box or is the only way to do it with tools like spiped or socat?
- tezza 13y agoIf I understand you correctly, the admin of sshd has turned off forwarding. You'll have to set you your own userspace forwarder if the admin hasn't also clamped down the firewall config too tight. If they HAVE clamped down the config, you could still invoke netcat on the remote side and use some form of kermit tunneling to get to the remote target side.
- malandrew 13y agoNot quite. The server is an amazon elastic beanstalk image that comes with it turned off. I can turn it back on after the machine is provisioned, but I want to be able to turn it on before the machine is provisioned so that the npm install with git urls pointing to private repos works. Basically, once I SSH and I'm root during the provisioning process, how do I programmatically set up ssh-agent for an in progress ssh session so that all future commands have access to the SSH_AUTH_SOCKET on my localhost.
- tezza 13y agoWell, you'll need a bit of trial and error here. Try changing the sshd config and send the sshd a reload signal. Normally that keeps existing connections alive. YMMV.
- mattjaynes 13y agoAmazing project. And I love the understated tone of this in the README: "Security Requirements: The user is responsible for ensuring that any individual connection does not transmit more than 2^64 bytes." If you don't happen to know how big 2^64 bytes is, it's over 18 BILLION GIGABYTES! We can probably safely assume most of us will never hit that limit on a single connection, haha. Ref: https://code.google.com/p/spiped/source/browse/trunk/README https://code.google.com/p/spiped/source/browse/trunk/README
- cperciva 13y agoYou also have to ensure that you don't create more than 2^64 connections using the same key.
- mattjaynes 13y agoomg, I love you. Yes folks, also, remember not to create 18 QUINTILLION connections (18 billion billion) with the same key. :)
- mattjaynes 13y agoApparently my comment is being misinterpreted (evident by the downvotes) :/ To clarify: It's simply amazing the scale at which you have to get to for spiped to need a new key. It's a tribute to its design and its author. If I understand it right, in order for this to be a real issue, an attacker would have to spend decades or centuries diligently recording either 18 quintillion connections or 18 billion gigabytes of your encrypted traffic in order to even begin to try cracking the key in any serious way. The solution to this "vulnerability"? Switch out your key (takes a few seconds tops). I laugh because of Colin's dry humor matter-of-factness about this mind-blowing level of scale. If you missed his own poking fun at it, read his other comments in this thread :)
- tokenizerrr 13y agoDo you have any recommendations on how to manage this? I realize this number is quite huge, and likely will never become an issue for me, but I'm not sure how I would manage or monitor the amount of connections a third party application creates.
- acqq 13y agoAnybody to explain advantages and disadvantages of spipes over using TLS?
- nanofortnight 13y agoIf you have actually tried to implement TLS yourself, there are a lot of places where you can go wrong. There are some places in TLS where it is easy to make implementation errors, and you can't confidently say there are unlikely to be any vulnerabilities in an implementation. spipes builds upon well-understood primitives and provides a simple, clear, and likely to be correct implementation.
- lmb 13y agoThat seems to be a non-argument to me: you shouldn't implement TLS yourself anyways. And given that spiped is a younger project than say OpenSSL will mean less eyeballs applied to finding bugs. And the cryptographic primitives spiped uses are available in TLS as well. TLS and spiped are simply two different tools, for two different purposes. Control only one of the endpoints? You'll have to use TLS. Want to secure communication between infrastructure you control? Check out spiped.
- makomk 13y agoEven if you're just implementing TLS using an existing TLS library it's easy to get that wrong. TLS is a pain.
- ghshephard 13y agoIronic - the timing of your comment, " And given that spiped is a younger project than say OpenSSL will mean less eyeballs applied to finding bugs. " given todays announcement regarding the absolutely epic OpenSSL bug. What are your thoughts now on not exposing yourself to all of the complexity of OpenSLL?
- tptacek 13y ago* Does not require you to set up or trust a CA. * Does not require X.509 processing, which is a huge source of TLS implementation bugs. * Uses secure-by-default ciphersuite which, unlike TLS's, was designed after the most important work in authenticated encryption was published. * Does not include legacy ciphersuites with known flaws. * Mutually authenticated without invoking TLS corner case subprotocols like client certificates and session resumption. * Small enough to be auditable.
- sunyc 13y agoreinvented stunnel.
- icebraining 13y agoThe author uses stunnel to terminate SSL connections[1], so if he reinvented it, it's because he thought it necessary. [1] http://www.daemonology.net/blog/2009-09-28-securing-https.html http://www.daemonology.net/blog/2009-09-28-securing-https.ht...
- tptacek 13y agoNot being stunnel is the entire point of spiped. The author doesn't trust TLS.
- ig1 13y agoIs this for unix domain sockets or network sockets ? - the description of "unix sockets" makes me think the first but the reference to "SSH -L" makes me think it's the second.
- icebraining 13y agoBoth.
- eliteraspberrie 13y agoIt is part of the Tarsnap bug bounty (http://www.tarsnap.com/bugbounty.html http://www.tarsnap.com/bugbounty.html). When I first heard of the bounty I gave it a shot but could never find anything. I ended up learning from the code, which is priceless.
- xor1234 13y agocperciva, how come your code never includes a test suite? At the very least, every implementation of sha256, hmac-drbg, aes, and any other crypto primitive should come with tests based on the publicly available test vectors. Your implementations don't include these tests. Perhaps you run tests before releasing code, but that is not very reassuring. Please distribute tests with your code.
- swordswinger12 13y agoJust read the full protocol description - does anyone know why PBKDF-SHA256 is used in steps 3 and 7? As far as I can tell, the input key material in both cases is high-entropy; what does a PBKDF do that e.g. HKDF couldn't?
- cperciva 13y agoPBKDF2-SHA256 is used with an iteration count of 1, so it doesn't make the computation any more expensive. I'm using PBKDF2-SHA256 to fulfill the role of "something which has the same cryptographic strength as SHA256, but produces an arbitrary length output".
- swordswinger12 13y agoHave you looked at the new SHA-3 for this? Seems like you're looking for something like a sponge function. (It's obviously fine as-is, I was just curious)
- cperciva 13y agoThat would have worked fine. Except it didn't exist yet when I wrote spiped. ;-)
- damian2000 13y agoAnyone know of any blog posts with some more usage examples? The README is ok, but I couldn't follow the given examples (probably a sign I shouldn't be using it at all).
- deleted 13y ago[deleted]
- cperciva 13y agoYou might fine this useful: http://www.daemonology.net/blog/2012-08-30-protecting-sshd-using-spiped.html http://www.daemonology.net/blog/2012-08-30-protecting-sshd-u...