13 ms·
Producing a trustworthy x86-based Linux appliance
- R0b0t1 5y agoYou can't. The post is still somewhat valuable, but should really not use "trustworthy."
- eklitzke 5y agoWhy can't you? The article explains how.
- usr1106 5y agoDepends on your level of paranoia and the age of the CPU. The ME has had many security vulnerabilities and probably more to come. For an appliance some old CPU might be good enough, but it does not get security updates. Some claim the ME might contain a NSA backdoor. That the ME can do networking certainly doesn't give confidence. The US government can order CPUs without ME, but nobody else can. Does not raise confidence either.
- eru 5y agoWhat's ME? The article doesn't seem to mention this.
- adrianN 5y agohttps://en.wikipedia.org/wiki/Intel_Management_Engine https://en.wikipedia.org/wiki/Intel_Management_Engine, AMD has something similar.
- SilverRed 5y agoEvery intel cpu past 2008 contains a coprocessor which runs at a higher permissions level than the normal CPU and therefor the OS. Its primary function is DRM for video and theorized backdoor access for governments.
- Google234 5y agoIt should be noted that AMD has an equivalent management engineZ
- usr1106 5y agoBut ARM hasn't. Or have they added something to their server range of designs?
- mjg59 5y agoThe short version is "It's complicated". Most ARM cores have a feature called TrustZone. Effectively, there's a set of system resources that are allocated to TrustZone and not accessible from the normal world. Various events can trigger the CPU to transition into executing code in this "Secure world", at which point the core stops running stuff from the normal world and instead starts running an entirely separate set of things. This can be used to do things like "hardware" key generation, DRM management, device state attestation and so on. Whether a specific platform makes use of TrustZone is largely up to the platform designers, but there's plenty of room to hide backdoors there if you were so inclined.
- usr1106 5y agoHmm, I have never seen Trustzone as comparable to ME. Trustzone is a secure execution environment, mostly isolated from normal CPU operation. Wasn't it so that it cannot even access main memory??? ME is really more privileged than the CPU? I have not heard about Trustzone doing networking. But ME can supposedly do even WLAN while the CPU is not running. Disclaimer: I am not a hands-on expert at that level, more like an armchair pilot...
- als0 5y agoTrustZone is a CPU mode, hence it is not fully isolated from normal CPU operation. The CPU chooses to enter it and the current CPU state gets saved/restored. It contains the highest exception level, so it is able to access all memory. It does not usually have networking because that would invite complexity, but there is nothing to stop a vendor from putting a full network stack in there and assigning a network peripheral. Typically, it would rely on the main OS to send and receive packets.
- ex_amazon_sde 5y agoPlease don't call it "paranoia": a whole lot of vulnerabilities have been found in CPUs together with plenty of undocumented functions that look just like backdoors. On top of that, it is well known that governments research or buy 0-day hardware and software vulnerabilities and keep them secret to be used as weapons. ME is just a fraction of the attack surface. When I read the title of the article I thought "trustworthy" was about mitigating hardware vulnerabilities. At this stage it's practically impossible. :(
- hulitu 5y agoIt's right there in the article : " In the general purpose Linux world, we use an intermediate bootloader called Shim to bridge from the Microsoft signing authority to a distribution one. " So you need to trust Microsoft for the first keys :)
- midasuni 5y ago“ Dan would eventually find out about the free kernels, even entire free operating systems, that had existed around the turn of the century. But not only were they illegal, like debuggers—you could not install one if you had one, without knowing your computer's root password. And neither the FBI nor Microsoft Support would tell you that.”
- MaxBarraclough 5y agoSource: The Right to Read, a short story by RMS, 1997. https://www.gnu.org/philosophy/right-to-read.en.html https://www.gnu.org/philosophy/right-to-read.en.html
- mjg59 5y agoWe do that for convenience, so you can boot Linux without having to hunt through firmware menus to reconfigure them. But every machine /should/ let the user enroll their own keys[1], so users are free to shift to a different signing authority. [1] Every machine I've ever had access to has. If anyone has an x86 machine with a Windows 8 or later sticker that implements secure boot but doesn't let you modify the secure boot key database, I have a standing offer that I'll buy one myself and do what I can to rectify this. I just need a model number and some willingness on your part to chip in if it turns out you were wrong.
- Foxboron 5y agoI have been trying to improve the usability of secure boot key management on Linux for the past year by writing some libraries from scratch and sbctl. I have even started writing full integration testing with tianocore/ovmf! https://github.com/Foxboron/sbctl https://github.com/Foxboron/sbctl It should hopefully end up being an improvement on efitools and sbsigntools. Tried posting about this on HN but somehow it's a topic with little to no interest, strange world!
- tinus_hn 5y agoConsole and phone manufacturers have chased this dream for decades and each and every one has been hacked to run arbitrary code and applications that are supposed to ‘only run on trusted hardware’. You can make it difficult but defeating an attacker who can touch the hardware is for all intents and purposes impossible.
- mjg59 5y agoWhere are the hacks that let you run arbitrary code on an Xbox One running current firmware?
- tinus_hn 5y agoDo you think they will never exist? edit I found that Microsoft did the smart thing like Sony did with the original PS3 and allowed people to run their own code (but not XBox games) on their consoles, removing a large incentive for people hacking the console. That doesn’t automatically make the security watertight though.
- mjg59 5y ago"Never" is a strong word, but given that they're already previous generation devices and haven't been properly compromised yet, it wouldn't surprise me.
- sarnowski 5y agoDealing in absolute terms does not help security. It depends entirely on your threat model. If you consider NSA or similar agencies a problem then you are in a world of pain anyway and using an entry level guiding blog post is certainly not appropriate. For everyone else, this puts already quite a big defense layer to your arsenal even if not unhackable in absolute terms.
- R0b0t1 5y agoI know. Thus I said: >The post is still somewhat valuable, but should really not use "trustworthy." The posted article is dealing in absolutes, not me.
- Layke1123 5y agoThis is what should be posted at the top of Hacker News. I hate corporate software engineers sold on the capitalism train.
- c0l0 5y agoWhile I find this post and the ideas presented very interesting on the technical level, work in that direction ("remote attestation", making devices "tamper-proof") tends to give me a dystopian vibe - foreshadowing a world where there's no hardware left you can hack, build and flash your own firmware onto: Complete tivoization, to re-use lingo from when the GPLv3 was drafted. With that, really neutering all the benefits Free Software provides. What good is having all the source code in the world if I can never put my (or anyone else's) modifications to it into effect?
- mjg59 5y agoYou're not wrong, but unfortunately those of us on the side of free software aren't the ones driving most technology decisions. This technology already exists, and if people want to use it to lock us out of our own hardware, they can already use it to do so. Right now we're partially saved by remote attestation on x86 systems just being too complicated (and, basically, too privacy violating) to deployed in a way that could be used against users, but this is basically what things like Safetynet on Android are doing right now. When the proprietary software industry is already using technology, I don't think we benefit by refusing to touch it ourselves. We can use this tech to lock down devices that are better off locked down, and where we're not violating user freedom in the process. We can use this to make it harder for activists to have their machines seized and compromised in a way they can't detect. Refusing to do the good things isn't going to slow down the spread of the bad things.
- lmm 5y agoDevelopment work is expensive. A cheap turnkey way of building a locked-down, remote-attesting distribution is going to make the bad things cheaper and more common. I'm sure proprietary developers would get there eventually, but this is one class of software where I think publishing a stable, bug-free implementation that anyone can use does more harm than good.
- zxzax 5y agoHow? You can use this to secure your own devices from tampering. Lots of (cheap) devices are already locked down like this, would it really help to deprive yourself of the capability to secure your own devices too?
- strstr 5y agoThe frustrating flaw in these setups is disk integrity. It’s pretty consistently {speed, integrity, mutability}, choose two. Dmcrypt, dm-integrity, and dm-verity cover all the pairs, but none of them completely solve the problem. If you have fairly static configuration, I imagine you can set up a blend of, say, dm-verity (for binaries/static files) and dm-integrity (for mutable files) and get something workable. Caveat: I seem to recall dm-integrity being somewhat flawed and vulnerable to rollback.
- mkj 5y agoYou could possibly use ZFS with sha256 checksums for that purpose? You would have to somehow sign the merkle root each time you write it, not sure how easy that would be. Perhaps write it to another partition and hope it's atomic enough? Or ZFS encryption would probably do it already if you don't need the system in cleartext. https://blogs.oracle.com/bonwick/zfs-end-to-end-data-integrity https://blogs.oracle.com/bonwick/zfs-end-to-end-data-integri...
- strstr 5y agoYou then have write amplification from the merkle tree. Ignoring performance, something like this should be possible though. For atomicity, there’s going to be some clever journaling based solution.
- t0mas88 5y agoThe tricky part with modifications is described in the article: You would have to have the signing key available on the system which usually means it could be extracted from that system and then looses all protections.
- marcus_holmes 5y agoIt's interesting that there's no attempt to solve the actual problem here - telling the difference between the owner of the device (who should be able to do what they like to their stuff) and an attacker (who must be prevented from making changes to the device). Both are presumed to have extended physical access to the device, any requisite knowledge, tools, etc. The normal solution to this is to have a password that only the owner knows. I'm assuming that that hasn't been used in this case because the intention here is actually to lock the owner out and only allow the manufacturer access to change the device. Is that the case?
- mjg59 5y agoWhere do you put the password? If you're just protecting the firmware setup, then I can just rewrite the secure boot key database without using the firmware setup. If you're using it for disk encryption, I just buy one myself, dump the disk image after it's decrypted, modify it so it'll boot whatever password you type in, intercept your device while it's being shipped or spend some time alone in a room with it, and drop my backdoored image on there. Please don't get me wrong - I would love a solution to this problem that wasn't isomorphic to a solution that can be used to lock out users. But I've spent the last 8 years or so of my life trying to do so and haven't succeeded yet, because the hardware we have available to us simply doesn't seem to give us that option.
- marcus_holmes 5y agoWell, you're comparing hashes to ones online, can't you put the password hash online? (sorry, I am very ignorant of the situation here and am asking stupid simple questions) I mean, surely the same problem exists for any data stored on the device (keys, hashes, whatever)? If there's a way of storing a key chain securely on the device so it can't be modified by an attacker, can't a password be stored there instead? > ... the hardware we have available to us simply doesn't seem to give us that option. Is that because the manufacturers don't give the option, or because technically there isn't a way of giving the option?
- mjg59 5y ago
- xvector 5y agoRelevant, HEADS firmware: https://github.com/osresearch/heads https://github.com/osresearch/heads Definitely worth reading the Wiki: https://osresearch.net/ https://osresearch.net/ Can be run on a variety of laptops, including a ThinkPad X230. Ships by default on Librem laptops. Uses the second-to-last approach described by the article (TOTP-based).
- exxo_ 5y agoIf one can measure the whole boot process and verify the attestation "remotely", why would he need secureboot on top of that?
- viraptor 5y agoYou need secureboot to be able to ensure that the boot process is the one you set up. Otherwise the attacker can observe it once and replace it with their own version doing whatever they want and saying "yup, here's your magic number, I totally generated in a legit way not read from a saved store".
- mlang23 5y agoMy generation was taught: "Once you have physical access, the game is over." I believe this is still true. Pretending otherwise feels like snake oil.
- userbinator 5y agoIt's merely a rationalisation for the companies to maintain control and lock users out of what they should rightly own.
- qayxc 5y agoThis only applies to parties with significant resources. The same way that locking your front door or being home or parking in a guarded parking lot will be efficient in deterring opportunist thieves and even most regular thieves. Absolute security doesn't exist but that doesn't mean security measures are futile in general.
- modshatereality 5y agoMaybe not exactly futile, but too many security measures can become a serious problem in certain scenarios. Imagine you are being chased and need to get inside your front door as quickly as possible, the more locks you need to operate, the higher chances of not making it inside. Now I'm going to propose a more likely future scenario. Imagine you are on another planet and there is a software flaw that needs to be patched. Do you want to have to beg some billionaire millions of miles away for the privilege of modifying the code, or do you want the ability to fix it as soon as possible? If its a time-sensitive issue consider the consequences of having to fumble around with deploying signed patches, or installing a new key and updating everything to work with the new key. None of these trust devices are perfect, they might leak data that can be used to infer keys through side channel, or can be physically inspected, etc, I think we can all agree they are not perfect. So if the security model breaks down with physical access then the only adequate solution is physical security. Putting your faith into some crypto function that will be obsoleted by time is not a winning defense. It's also possible the keys may have been obtained by a malicious adversary, rendering this mathematical security layer ineffective at best. If I can install new keys, then an attacker can also install new keys. If the imperfect security measure causes more problems than it solves, then its worth rethinking. What problem would it ACTUALLY solve in this scenario? Maybe it could be used to mitigate a breakaway civilization by only allowing patches through remote update channels, keeping new outposts fully dependent on Earth. Potentially at the cost of real lives if that update channel is broken somehow. Though someone always figures out a way to break the lock :) Please I don't want to hear about some hypothetical dissident of a tyrannical regime, they should have destroyed the device before capture if they had any wits. The regime would probably be forcing its citizens to run fully validated stack anyway and would be all up in their business for (red flag) installing their own key instead of government approved key... Corporate security? Lol do you think your petty secrets are worth restricting humanity by normalizing imperfect security measures? Some of these corporations need to be kept in check somehow, they have too much power already. The only future I'm on board with is one with a robust well tested software ecosystem controlled by its users/operators/owners, not a careless conglomeration that prioritizes the well being of it's shareholders, or crushing its competition.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- cy6erlion 5y ago> Let's say you're building some form of appliance on top of general purpose x86 hardware. You want to be able to verify the software it's running hasn't been tampered with. What's the best approach with existing technology? Why can we not use something like Guix by declaratively setting up a system [0] and for extra safety have it run in a container [1]? [0] https://framagit.org/tyreunom/guix/-/blob/99f47b53f755f0a6cb15615c2b9a449a930e82e9/gnu/system/examples/lightweight-desktop.tmpl https://framagit.org/tyreunom/guix/-/blob/99f47b53f755f0a6cb... [1] https://guix.gnu.org/en/blog/2017/running-system-services-in-containers/ https://guix.gnu.org/en/blog/2017/running-system-services-in...
- devit 5y agoYou should not do that since there is no reason to disallow the user from doing what they want. But if you really want it, writing a custom boot ROM and OS is probably the only way you can have an actually secure system (you might need a custom CPU as well). Given the lack of skill and discipline of most programmers the whole TPM/secure-boot/UEFI/grub/Linux/dm-verity stack is likely full of holes, so just the assuming that it works as you'd expect will probably be disappointing.
- GordonS 5y ago> You should not do that since there is no reason to disallow the user from doing what they want. For desktop computing ("personal computing", if you like), anyone here will agree. But the article is specifically talking about securing appliances, and generally when talking about appliances, you're talking about rackable machines sold to the enterprise. There, they don't care a jot about being able to muck around with the machine - the whole point of an appliance is that you plug it in and go; that is more or less manages itself. And for many of these customers, and of course any operating in a high-security environment (e.g. defence), this level of security is a feature, not a hindrance.
- no_time 5y agoTrusted computing and TPMs by extension are treachery on a chip without an user override. And the fact that even the most tech savvy of us don't care (looking at security researchers with macs) makes me super pessimistic about the future of computing. Can't wait for the time when i wont be allowed to access a website because I have unsigned drivers running...
- tachyonbeam 5y ago> Can't wait for the time when i wont be allowed to access a website because I have unsigned drivers running... If that happens, it will create a market opportunity for websites without DRM or such checks. If you fuck with the ergonomics, you necessarily always create a market opportunity for competitors IMO. That being said, I also would rather use open computing platforms where I can easily install whatever OS, drivers, hardware or userland software I please.
- no_time 5y agoWill it though? From what I see anecdotally, people will just accept it as the new normal sooner or later. Just like when Android rolled out a feature that enables apps to prevent you screenshotting them. At first it was annoying but now nobody cares.
- nebulous1 5y agoI tend to agree. This ended up longer than expected, sorry. There's the theory of how incentives should work in free markets, and then there's the practice of exactly how savvy consumers can really be, and whether non-consumer interests can organize themselves in a way that easily overpowers the consumers. I've thought about this recently regarding hardware DRM in Android phones. Google has Widevine which has different levels of support, and Netflix, for example, will only send high definition streams if your device supports L1 Widevine which means it will only be decrypted in "secure" sections of hardware and the user cannot access these areas. This is intended to stop user access to the unencrypted media. This hardware is widely available in Android devices already, so why would Netflix* do otherwise? And if you want to stream HD from Netflix then you'll get a device that supports it because Netflix require it. However, how did our devices end up with this technology to begin with? If consumers acted in their own best interest, why would they pay to have this extra technology in their devices that protects somebody else's interest? If this technology wasn't on our devices already, do we think that Netflix wouldn't be offering HD streams anyway? Basically, if consumers could organize as effectively as corporate interest, would this technology have made it to our devices at all? It's possible that it would have. Perhaps overall people would deem it worthwhile to acknowledge and protect corporate rights holders so that they can continue to produce the media they want to consume and stop people consuming it for free. Personally, I would not have accepted this bargain and I would have left it up to the media companies to manage their own risks and rewards, and I strongly suspect that they would have found profitable ways of doing so that would include non-DRM HD streaming. I think it's tough to say what an educated consumer would think on average because so few consumers think about these things and those that do may have a strong bias that led them to research it in the first place. * I'm saying Netflix here because it's easier, but in reality I'm sure a lot of the content they licence will require DRM so it's not entirely up to them
- 3np 5y agoThe next step to this would be to put the actual workloads in a Trusted Execution Environment (Intel SGX) to add another layer of integrity.
- salawat 5y agoTrusted computing is almost without fail never about making the device trustworthy to the owner operator. Quite the opposite generally. It just gets marketed as that in the hope folks don't ask too many questions.
- swiley 5y agoNo one wants this. (the people who understand it don't want it and the people who don't care don't care.)
- strstr 5y agoThis seems obviously false? I want it and I understand it? Corporate ITs would want it to mitigate risk?
- 1vuio0pswjnm7 5y ago"Unless you've got enough RAM that you can put your entire workload in the initramfs, you're going to want a filesystem as well, and you're going to want to verify that that filesystem hasn't been tampered with." I have enough RAM. More than enough. About 10+ years ago I was easily running the entire OS in 500MB of RAM on an underpowered computer, boot from USB stick, tmpfs (or mfs), no swap. Today, the amounts of RAM are even greater on a comparabley-priced equivalant, at least double, more likely triple or quadruple. I was not doing this to avoid some "anti-tampering" scheme, I just wanted speed and cleanliness, and not having to worry about HDD failures. However I was using NetBSD not Linux. One thing I have learned about Linux, it is not nearly as nice in the way it handles memory exhaustion, or, in the case of this RAM disk setup, what we might call "running out of disk space". IME, NetBSD anticpitates and handles this situation better by default. I could routinely run out of space, delete the overgrown file at issue and continue working. I noticed an interesting comment recently from a Linux developer on resource usage under NetBSD: "Lastly, redbean does the best job possible reporting on resource usage when the logger is in debug mode noting that NetBSD is the best at this." I like this RAM disk setup because it forces me to decide what data I truly want to save long-term. Any data I want to preserve I move to removable storage. The system is clean on every reboot. In a sense, code is separated from data. The OS and user data are not stored together. Anyway, putting the entire OS in intramfs makes sense to me. Intramfs, or at least tmpfs, is a filesystem so the "you're going to want a filesystem" comment seems strange. Also I think the reason(s) one might want a more optimised, lower overhead HDD-based filesystem could be something other than "not enough RAM".