|
|
Subscribe / Log in / New account

Turris: secure open-source routers

By Jake Edge
March 13, 2019

SCALE

The Czech Republic top-level domain registrar, CZ.NIC, wondered about the safety of home routers, so it set out to gather some information on the prevalence of attacks against them. It turns out that one good way to do that is to create a home router that logs statistics and other information. Michal Hrušecký from CZ.NIC came to the 2019 Southern California Linux Expo (SCALE 17x) in Pasadena, CA to describe the experiment and how it grew into a larger project that makes and sells open-source routers.

CZ.NIC is legally an association of competing companies, but in reality it is run like a non-profit, Hrušecký said. Beyond just domain registration, CZ.NIC has various other activities around making the internet more accessible and secure. That includes projects like the BIRD internet routing daemon and the Knot DNS resolver, as well as books, translations, and even a television series on "How to handle the internet". Beyond that, the Czech Computer Security Incident Response Team (CSIRT) is part of CZ.NIC.

[Michal Hrušecký]

One of the other things it is doing is creating open-source home routers. It started because CZ.NIC wondered about how safe home users are from network attacks. Are there active attacks against home users? And, if so, how frequent are they and what kinds of attacks are being made? To figure out the answer, the organization created Project Turris to create a secure router that it gave away. These routers would monitor the network and report suspicious traffic back to the project. They also served as endpoints for some honeypots that the project was running.

CZ.NIC wanted to make the Turris router "the right way", he said, so the organization made it all open source. The router has automatic security updates and users are given root access on the device. It also sported some "interesting hardware", Hrušecký said; it had a two-core PowerPC CPU, 2GB of RAM, and 256MB of NAND flash.

Based on the information provided by the Turris routers, CZ.NIC researchers started publishing reports about what they were finding. That led some people to ask if they could get the routers themselves, because they felt that other router makers were "not doing things right". That led to the creation of commercial Turris routers: the Turris Omnia (which was reviewed here in 2016) and the upcoming Turris Mox. Those routers will still allow people to participate in the research if they choose to.

Building the routers with free and open-source software (FOSS) is really the only way to go, he said. The project knew that it was not going to be able to compete with small, cheap routers, so it created routers with lots of capability that would allow them to run lots of different kinds of services. FOSS makes it easy to get started on a project like this because there is lots of available software that can be easily integrated into the OS.

These routers allow users to do whatever they want and people believe they are more capable than they truly are, Hrušecký said. That means they break things in "really creative ways". Sometimes they will make custom changes, completely outside of the OS framework, which get overwritten with the next automatic update. These are "tricky problems" to handle; the project would not have if it locked its users out. At some "dark moments" he understands why some companies do that.

Another tricky piece is upstreaming, he said. Turris works on getting its code upstream, but it takes longer than "anyone would want", he said. The project can take shortcuts that the upstream project will find lacking. Upstream projects want the code to be polished and generalized, which takes time. The "upstream project" in this case is OpenWrt, which is a distribution for routers. But OpenWrt is optimized for routers with far less resources than the Turris routers.

Typically, OpenWrt installs a highly compressed filesystem image into flash and has a small overlay where packages can be installed—generally only a few, however. Turris is not using the compressed image, but is instead using the "coolest filesystem for Linux": Btrfs. The project is using Btrfs snapshots and "went crazy" with them. It does a snapshot automatically weekly and before any update; it also allows manual snapshots. A "factory" reset can go back to the previous snapshot, the factory snapshot, or reflash the system.

Turris created its own web interface for the router, which is simpler than the standard OpenWrt interface. OpenWrt is targeted at more-technical users, while Turris wanted an interface for less-technical users, but to still allow them to use advanced features, such as VPNs or adding a guest WiFi network. Since Turris does things a bit differently, it sometimes runs into problems that OpenWrt does not have. In addition, OpenWrt packages are sometimes too trimmed down feature-wise, so Turris must build its own versions. Some packages use LXC containers, which may seem crazy, he said, but does make sense in some cases; it requires a different kernel configuration from the standard OpenWrt kernels, though.

Hrušecký introduced the honeypots as a service (HaaS) project by saying: "Honeypots are cool, right? Everyone wants a honeypot at home." But it takes time to set up and maintain a honeypot and there is some risk, so why not have someone else run it for you? CZ.NIC will run the honeypot; users just need to run the HaaS proxy on their system, which will relay potentially malicious traffic (e.g. connections to the SSH port) to a honeypot on the HaaS server. It will simulate a device and record what is sent by the attack. Users can then check out the attacks aimed at their server on the HaaS web site. HaaS is something that came from the security research but has now been separated out from the router project so it can be used elsewhere.

Turris Sentinel is a work in progress that will make some of the other security-research pieces available outside of the router framework. It will collect firewall logs and send them to a central location. It also has "minipots", which pretend to be a service on some port (e.g. telnet, HTTP), ask for login credentials that get logged, then close the connection. There was an earlier version of this, but it was closely tied to the Turris routers, so it has been rewritten to be more general. The Turris project was a bit surprised how willing people are to provide this data to it. The data will be made available on the site eventually, but is currently being shared with the Czech and other countries' CSIRT organizations.

The project has integrated the Suricata open-source intrusion-detection system (IDS) and intrusion-prevention system (IPS). It can look deeply into the packets and log or block a network flow based on its rules. For unencrypted communication, it has access to all of the information exchanged. But even for encrypted connections, there is a fair amount of information that can be extracted from things like the IP and MAC addresses, parts of certificate exchange, the length of the connection, and the amount of data transferred.

Suricata can be used to monitor untrusted devices and detect suspicious anomalies. There are open-source rules available to detect malware attacks, which can be used to block the traffic, for example. There is also the PaKon tool for Suricata that will aggregate information about the traffic on the network. It will alert when a new computer connects to the network. It will allow you to find out what your refrigerator is doing on the network when you are not at home, Hrušecký said with a grin.

Something that has come out of the research that CZ.NIC is doing is a "list of bad guys". If certain hosts are repeatedly attacking servers and routers that are reporting back, they will get added to the list, which is sent out to all of the routers. They can then block those IP addresses to reduce the malicious traffic they are handling.

Something that people have been asking for is Nextcloud support. It makes good sense, he said, because the Turris routers are the ultimate in self-hosting. They live at your home and you are root, so it is natural fit. Turris is also working with Nextcloud on a device that will specifically target hosting that service. So far, much of the software side is working, though there are still some areas that need work.

One of the "little bit crazier" uses is to turn the router into a digital video recorder (DVR). Adding a USB DVB-T device and a disk drive gives you a DVR, he said. Adding TVHeadend along with Nextcloud turns the Turris device into a router and home server combo box.

Hrušecký demonstrated the HaaS interface and took questions at the end of the talk. He showed how you can look at the kinds of attacks that are being attempted against your router (but are actually being handled by the CZ.NIC HaaS server) including the credentials used, the commands the attacks are trying, and the locations where they are trying to download code from. The Turris routers cost around €300, he said in response to an attendee question. They are not directly available in the US, but that is being worked on; there is lots of paperwork that needs to be completed. Until then, he suggested looking on eBay and similar sites.

A YouTube video of the talk is available.

[I would like to thank LWN's travel sponsor, the Linux Foundation, for travel assistance to Pasadena for SCALE.]

Index entries for this article
SecurityHome network
SecurityInternet/Routers
ConferenceSouthern California Linux Expo/2019


to post comments

Turris: secure open-source routers

Posted Mar 13, 2019 23:34 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link] (3 responses)

I have tried to use Turris software but ended up migrating to vanilla OpenWRT. It works really well since the 18.06 release, even the cellular modem is supported just fine.

You do lose the ability to roll back using BTRFS snapshots and automatic upgrades though. Also some minor stuff (like nice rainbow LEDs) is not supported by the stock kernel.

Turris: secure open-source routers

Posted Mar 14, 2019 3:05 UTC (Thu) by pabs (subscriber, #43278) [Link]

Turris: secure open-source routers

Posted Mar 18, 2019 20:00 UTC (Mon) by diederich (subscriber, #26007) [Link] (1 responses)

> I have tried to use Turris software but ended up migrating to vanilla OpenWRT

May I ask: why did you migrate back? Thanks.

Turris: secure open-source routers

Posted Mar 18, 2019 21:14 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link]

I needed a package that was not available in Turris. Something to do with the cellular modem, as far as I remember.

Crazy Obvious Home DVR Server

Posted Mar 23, 2019 5:05 UTC (Sat) by Garak (guest, #99377) [Link] (28 responses)

One of the "little bit crazier" uses is to turn the router into a digital video recorder (DVR). Adding a USB DVB-T device and a disk drive gives you a DVR, he said.
you mean I could like- program and watch my dvr's library from my phone or laptop wherever I am with an internet connection. Wow. Seriously, that should have existed in a much more advanced form many years ago. Along with asterix-level voicemail functionality (both on the router/homeserver and on the phone itself). And throw in home email server with domain registration price ridiculously lower than current rates. Maybe next year. Though I won't be happy till it comes with a complete self hosting set of its own FOSS code by default with very little hassle tweaking small code fixes for any itchy perceived deficiency (of the variety that can be changed with very small code tweaks, which is to say, a very large number of them. Like seriously, why is number of rings before vmail picks up not a more prevalent user-controlled option? Along with white/black/pass/blocklist contingent configurations of that number. Robocalls are only hard to mitigate if neither you nor the masses have the easy ability to go add blaringly obvious features to phone software)

Crazy Obvious Home DVR Server

Posted Mar 23, 2019 20:59 UTC (Sat) by mpr22 (subscriber, #60784) [Link] (27 responses)

> And throw in home email server with domain registration price ridiculously lower than current rates.

I pay £12/year (plus VAT) for a .com domain; if I settled for .co.uk it would only be £6/year. What kind of ridiculously lower were you thinking of?

'reasonable' domain registration prices?

Posted Mar 23, 2019 22:01 UTC (Sat) by Garak (guest, #99377) [Link] (26 responses)

1% of that or lower. If technically adept people can use FOSS, a raspberrypi, and a home internet connection that allows home (bind/dns/etc) servers for whatever yearly electric and isp cost that works out to... Even if one has to pay a dozen such home server operators a yearly rate to get the level of dns-style-decentralized-redundancy/highavailability one wants, it seems like that should be totally doable at <1% of current rates. Of course it would take a few years to smooth out rough edges as they appear, but it seems straightforward enough to me from an engineering/resources/softwaredevelopmentiteration perspective. All it would take in the U.S. I think would be the FCC admitting that terms of service home server prohibition is clearly a form of network non-neutrality. Crazy Obvious Home DVR Servers done FOSS right that can also handle common dns seem like an easy enough sell once you remove the slandering of 'servers' from ordinary people's terms of service. My rational/paranoid side suspects the NSA has been adept at not furthering such empowering of the masses with DNS server power. DNS servers make pretty powerful chokepoint targets for folks like the NSA to enjoy exploiting. Maybe next year.

'reasonable' domain registration prices?

Posted Mar 23, 2019 22:19 UTC (Sat) by mpr22 (subscriber, #60784) [Link] (4 responses)

While I can comprehend thinking £6/year (i.e. about what it costs to buy four bottles of decent beer from the supermarket) is too much to have to pay for a domain (I don't agree, but I can comprehend it), I can't comprehend thinking that charging 6p/year (i.e. less than the brewery pays for the crown caps on those four bottles of beer) makes any sense for anyone involved; it would literally be cheaper to not charge at all.

micropayment efficiency dynamics

Posted Mar 24, 2019 23:43 UTC (Sun) by Garak (guest, #99377) [Link] (3 responses)

it would literally be cheaper to not charge at all.
The theory is that cryptocurrencies/micropayments make that not true. And by charging and making a business of it, you incentivise the relevant system administrators to do a good job. Standard capitalistic theory, those who provide the best quality services considering price keep the job and are financially sustained to do so going forward.

micropayment efficiency dynamics

Posted Mar 25, 2019 0:41 UTC (Mon) by mpr22 (subscriber, #60784) [Link]

> The theory is that cryptocurrencies/micropayments make that not true.

That's a fascinating hypothesis. I'd be interested to see what evidence there is to support it.

micropayment efficiency dynamics

Posted Mar 25, 2019 1:20 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link]

As of now, a transaction on the BitCoin blockchain costs around $5 in transaction fees paid to miners.

And this is cheap, compared to $50 fees just a year and a half ago.

Keep in mind, that each transaction on the blockchain has to be kept there _forever_, replicated to all the nodes that host the full chain. This is quite expensive and wasteful in itself.

micropayment efficiency dynamics

Posted Mar 25, 2019 15:13 UTC (Mon) by anselm (subscriber, #2796) [Link]

The theory is that cryptocurrencies/micropayments make that not true.

We may eventually find a use for cryptocurrencies (other than “ripping off suckers”) but certainly micropayments are not it.

To make micropayments viable at scale, transactions must be very, very cheap, and it must be efficient to process very large numbers of them. Cryptocurrency transactions – certainly the blockchain-based ones that people mean when they say “cryptocurrency” today – are very expensive indeed, and it is nearly impossible to process even ridiculously low numbers of them efficiently. So, bad theory.

'reasonable' domain registration prices?

Posted Mar 23, 2019 23:45 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link] (5 responses)

> If technically adept people can use FOSS, a raspberrypi, and a home internet connection that allows home (bind/dns/etc) servers for whatever yearly electric and isp cost that works out to... Even if one has to pay a dozen such home server operators a yearly rate to get the level of dns-style-decentralized-redundancy/highavailability one wants, it seems like that should be totally doable at <1% of current rates.
So you're willing to give out full email control to multiple random people running unsecured RPi-based severs at home.

Ok....

/me backs slowly away

magic words

Posted Mar 24, 2019 23:34 UTC (Sun) by Garak (guest, #99377) [Link] (4 responses)

I will ask a second time @Cyberax. Please cease and desist your pattern of comments I characterize as trolling and harassing. If you feel your comments are important, please start a thread of your own, do not reply to mine. I will reciprocate.

magic words

Posted Mar 25, 2019 1:10 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

Feel free to stop posting here. Tks, bye!

sh!t forum

Posted Mar 25, 2019 2:28 UTC (Mon) by Garak (guest, #99377) [Link] (1 responses)

whatever...

This is a good stopping point

Posted Mar 25, 2019 2:46 UTC (Mon) by corbet (editor, #1) [Link]

Certainly I think we can all agree that this particular conversation isn't going anywhere useful; perhaps we can just stop now?

Thanks.

magic words

Posted Mar 27, 2019 12:50 UTC (Wed) by nix (subscriber, #2304) [Link]

Speaking as someone running all his own email from a home server... Cyberax's concern seems perfectly reasonable, and your calling it trolling, let alone harrassment, seems like an attempt to dodge the issue. One of the concerns about home server operations of crucial services *is* that great big dedicated teams behind huge central services can handle security better than you can. (The countervailing concern, of course, is that they are a much bigger target, but in the IPv4 world where worms exist that can pre-scan the entire address space and infect every vulnerable system in a matter of minutes I'm not sure that is terribly relevant. If your home servers were IPv6-only, perhaps... but even then, a mailserver needs an MX record pointing to it, and an attacker can trivially pre-scan all of those. So Curious Yellow-style worms atop zero-day vulns in popular mailservers remain a problem with home mail service...)

'reasonable' domain registration prices?

Posted Mar 24, 2019 16:16 UTC (Sun) by Wol (subscriber, #4433) [Link] (4 responses)

OMG. £1/month is too expensive? When it costs £20/pm for even a *basic* ADSL connection? (I pay that for 20Mb ADSL-2)

I know pennies add up, but that really is peanuts compared to all the other costs!

Cheers,
Wol

magic words

Posted Mar 24, 2019 23:37 UTC (Sun) by Garak (guest, #99377) [Link] (3 responses)

And to you as well @Wol, I ask you to please cease and desist your pattern of comments I characterize as trolling and harassing. If you feel your comments are important, please start a thread of your own, do not reply to mine. I will reciprocate.

magic words

Posted Mar 25, 2019 0:54 UTC (Mon) by pizza (subscriber, #46) [Link] (2 responses)

FYI, you would do well to keep in mind that your arguments might not be as well thought out as you think they are.

When you make public comments you open yourself up to public responses.

magic words

Posted Mar 25, 2019 2:25 UTC (Mon) by Garak (guest, #99377) [Link]

Truisms are truisms indeed. Someone once said knowing all the cliches by heart is what makes one a good parent.

magic words

Posted Mar 25, 2019 12:51 UTC (Mon) by Wol (subscriber, #4433) [Link]

And if you're going to accuse someone of trolling, I usually look at the subscriber number. It's very rare for trolls to hang around ... :-)

Cheers,
Wol

'reasonable' domain registration prices?

Posted Mar 25, 2019 9:35 UTC (Mon) by farnz (subscriber, #17727) [Link] (9 responses)

There are three counterarguments that you're simply dismissing as they don't fit your narrative:

  1. Devices that do some fraction of what you describe have been on the market before - for example, EchoStar sold a "Sling" range of STBs that were internet-accessible DVRs (I owned one for a while, although I now use IPTV instead of satellite), Synology NASes have e-mail service available, and Helm are still going, selling email solutions in an appliance, but hasn't reached huge marketshare.
  2. People have happily run servers on home Internet connections in the USA where there's no way for them to buy the service they want without doing so - KaZaA, BitTorrent, eDonkey, Napster et al all involve running a home server in order to pick up pirate materials. This was not shut down for "running a server against T&Cs", but rather because of the copyright infringement involved - so that's a strong suggestion that the "home server" ban is permitted simply because no-one has seen a market opportunity in challenging it, not because it actually affects consumer behaviour.
  3. The USA is not the world; in large swathes of the world (including much of the EU), running a home server is legal, and encouraged by some ISPs. If a market of 450 million consumers isn't enough to make it economic to sell home server appliances, why would a smaller market (the USA) suddenly render it economic to do so?

In other words, most of what you say would exist if the FCC barred providers from putting "home server" restrictions in their T&Cs already exists, people are willing to ignore that restriction if they see a benefit from doing so, and that restriction is not universal and yet foreign countries don't have a market for the devices you say would appear if the FCC barred that term. What evidence do you have that counters all of this?

'reasonable' domain registration prices?

Posted Mar 25, 2019 15:32 UTC (Mon) by Wol (subscriber, #4433) [Link] (8 responses)

My previous ISP (which no longer exists except possibly in name) *was* a very good ISP.

"Here's a dial-up, here's an IPv4, off you go ..."

Trouble is, most of the decent ISPs like that have been bought out by the likes of Clueless & Witless.

Cheers,
Wol

'reasonable' domain registration prices?

Posted Mar 25, 2019 16:05 UTC (Mon) by farnz (subscriber, #17727) [Link] (7 responses)

Not all - at least AAISP in the UK are still at that quality, although it's now a "here's an Openreach link, here's a small amount of IPv4, here's a /48 of IPv6, off you go". But I have a VDSL2 (aka FTTC, BT Infinity, Sky Fibre etc) connection, my Fedora box runs PPPoE over that link, and I get nice Internets from it.

'reasonable' domain registration prices?

Posted Mar 25, 2019 20:33 UTC (Mon) by Wol (subscriber, #4433) [Link] (6 responses)

FTTC is not an option for me - I don't have a cabinet. And I don't want it anyway because 17MB achieved is more than adequate for my purposes IFF it is working - I think I've "big red switch"ed my router about 3 or 4 times tonight because it just dies on me.

Cheers,
Wol

'reasonable' domain registration prices?

Posted Mar 25, 2019 21:00 UTC (Mon) by farnz (subscriber, #17727) [Link] (5 responses)

AAISP do all the normal options - ADSL2+ (Annex A and Annex M) included. Back before FTTC was an option for me, I used two ADSL2+ Annex M lines to get me enough upload (4 Mbit/s was enough for me back then), and wrote this AAISP wiki page to explain how I split traffic across the two upload links from a Debian system doing PPPoA using an ADSL2+ card from Traverse Technologies. Nowadays, I'd probably buy a pair of Draytek Vigor 130s to act as PPPoA to PPPoE translators, then use PPPoE on the Linux side.

'reasonable' domain registration prices?

Posted Mar 26, 2019 10:18 UTC (Tue) by Wol (subscriber, #4433) [Link] (4 responses)

When "the internet" comes up for renewal, I'll definitely look at switching.

Only thing is, if as I suspect it's the exchange, will that actually improve matters?

Cheers,
Wol

'reasonable' domain registration prices?

Posted Mar 26, 2019 14:33 UTC (Tue) by farnz (subscriber, #17727) [Link] (3 responses)

Well, AAISP are (IME) very good at getting the exchange-end equipment fixed for you (finding via their CQM that there's a reproducible explicable problem), or at least determining what tradeoffs you can make to get stability (e.g. slower speed such as 10 Mbit/s down and total stability if it's noise between you and exchange).

'reasonable' domain registration prices?

Posted Mar 27, 2019 13:02 UTC (Wed) by nix (subscriber, #2304) [Link] (2 responses)

Quite so. I switched to them ten years ago when I had a rain-induced intermittent fault on the line, so extreme that you couldn't even make a fault call to describe it because the chaos of crackling was so intense. BT, bless their little hearts, sent round engineers at pre-arranged times (when, of course, it was not raining) and then blamed me and tried to charge me for the callout. They did this despite the fault affecting half the town.

I switched to A&A -- for telco as well, so I had no conctractual arrangement with BT that BT could use to try to avoid interacting with A&A -- and A&A just kept calling BT out: BT kept cancelling the callout because nothing was wrong, whereupon A&A would wave the evidence of hundreds of linedrops whenever it rained in their faces and tell them, you have a contract, you are not providing the stated service to an acceptable standard, fix it. After a while A&A pushed me up to business-priority (free of charge) to give BT more, ah, encouragement. BT ended up closing the fault nineteen times before they considered actually doing their jobs and tracing the line fault and found a bunch of dry joints near the exchange equipment in the town centre. (These days, of course, with FTTC, they'd only have to fail to trace the fault as far as the cabinet...)

'reasonable' domain registration prices?

Posted Mar 27, 2019 14:49 UTC (Wed) by Wol (subscriber, #4433) [Link] (1 responses)

That's good encouragement, thanks :-)

Reminds me of one of these "true crimes" programs I saw. The guy was accused of murdering his wife, but he said "we were crawling through the undergrowth, the rifle fell off my back and fired, killing her".

Despite the safety being on.

The prosecution said "we've tried every which way we can to make the rifle fire with the safety on, and we can't".

Then the defence said "let us have a go" and came back the next day with "we tried to reproduce the scenario described by the defendant, and the rifle fired reliably roughly 80% of the time".

Different approach, different outcome ...

Cheers,
Wol

'reasonable' domain registration prices?

Posted Mar 29, 2019 14:18 UTC (Fri) by jezuch (subscriber, #52988) [Link]

> Different approach, different outcome ...

Different incentives? Like O.J. Simpson proving that the gloves don't fit?


Copyright © 2019, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds