13

I am trying to think of a way to secure Linux servers that are exposed to physical access. My specific platform are small form factor Linux servers on a PC Engines brand alix2d13 mother board. The small size presents an additional risk of removal from the premises by an attacker.

Assuming there is physical access to the server:

1) ROOT-PASSWORD: You connect a console cable to the server and you get a prompt for a password. If you don’t know the password you can restart the machine in single user mode and reset the password. Voilà, you get root access.

In order to secure the above you insert a password on the GRUB menu so when server is restarted in order to enter single user mode you have to provide the GRUB password.

2) GRUB_PASSWORD. If you shut down the machine, get the hard drive out and mount it on another workstation you will be able to browse the /boot directory which contains the grub.cfg file inside which you can find the GRUB password. You can either change the GRUB password or delete it.

Obviously when we talk about big production machines most probably there won't be any physical access and apart from that, even if someone gets physical access to the server he won't shut it down.

What are possible solutions to prevent data theft on servers that are physically easy to steal?

The way I see it, one way or another access to the contained data can be obtained.

closed as off-topic by 200_success, fukawi2, HBruijn, Jim B, mdpc May 15 '15 at 6:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – fukawi2, Jim B, mdpc
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    Unless you want to be around to enter a decryption password each time it boots, there is not much you can do. Decryption could be done by communicating with a network service which is only available as long as it is on the proper network. That's not very secure, but sufficient to cover the case where the thief doesn't try to access the data while on site. But a targeted attacker could even steal the machine without powering it off. I suppose it wouldn't take a lot of battery capacity to keep it powered for a few minutes. – kasperd May 13 '15 at 10:13
  • 12
    Bury it in concrete. That will certainly prevent theft! – Michael Hampton May 13 '15 at 10:34
  • 14
    It's not really clear what the threat model is. You want a device that is invulnerable to physical compromise? That's going to be very complex and expensive. Computers are not vaults. If you want a vault, you need a vault. – David Schwartz May 13 '15 at 10:34
  • 3
    @BlueCompute The question can arise in a professional environment as well, so it should stay here. – Nils May 13 '15 at 10:53
  • 3
    @giomanda And it's "threat model". And part of what it means is that you have to thoroughly understand what you're securing and what you're securing it from. You might use SEAL Team Six to defend Fort Knox from Al Qaeda, but not to defend your new plasma TV from neighborhood thieves. – David Schwartz May 13 '15 at 22:39
18

The rule I've always worked from is that once an attacker has physical access to your host, they can eventually break into it - unless, as kasperd says, you use strong all-disk encryption with a boot password, and are willing to be there to enter it every time the host boots.

  • 14
    And even then, somwone with physical access might replace the keyboard used to enter the boot password and thus learn the password ... – Hagen von Eitzen May 13 '15 at 11:43
  • 2
    @HagenvonEitzen solution: carry around your own keyboard and tamper-proof the physical USB (or PS/2) port on the box. – Jules May 13 '15 at 16:46
  • 10
    @JulesMazur Counterattack: Evil Maid re-flashing the onboard firmware. – a CVn May 13 '15 at 16:48
  • 1
    @MichaelKjörling Defense: firmware password, physically, robustly-locked server box. – Jules May 13 '15 at 16:49
  • 6
    @MichaelKjörling you can never be too safe with roving gangs of evil maids hijacking the keyboard and/or firmware – Jules May 13 '15 at 16:57
10

The solution I'm aware of is encrypt the disk and use a TPM: Trusted Platform Module

In this way there's now way do decrypt the hard drive as:

Full disk encryption applications [...] can use this technology [TPM] to protect the keys used to encrypt the computer's hard disks and provide integrity authentication for a trusted boot pathway (for example BIOS, boot sector, etc.) A number of third party full disk encryption products also support TPM. However, TrueCrypt decided not to use it. - Wikipedia

Of course I might be wrong and the TPM can be easily cracked or I might not know other solutions.

  • This is correct. With a TPM, an encrypted drive and UEFI signing, it's impossible for an outsider to read the drive, or modify the bootloader to circumvent the encryption. – longneck May 13 '15 at 13:27
  • It would be interesting to know if USB pen exists with a TPM to add this feature to any computer. – ColOfAbRiX May 13 '15 at 13:43
  • 1
    No, because the bios has to manage the tpm. – longneck May 13 '15 at 13:44
  • 3
    With physical access even the TPM won't do much... you can easily sniff the data from the TPM chip when the machine is booting, or have access to the computer's entire memory without the computer noticing (and thus the TPM will "unseal" the key just fine). – user186340 May 13 '15 at 14:08
  • 2
    TPM will fall to a PCI device on the bus that doesn't respond to PCI enumeration but overwrites the OS via DMA later. – joshudson May 13 '15 at 20:18
7

Full disk encryption is a good idea for laptops and small home servers.

Full disk encryption does not require a TPM. And even a TPM is unable to protect you against a sophisticated evil maid attack. So in order to really protect your small home Linux server (or a data center) you need appropriate other physical counter measures.

For your home use case it might be sufficient to install some creative DIY hardware which:

  1. allows you to recognise any physical intrusion when you come back and
  2. interupts the power supply of your computer on any physical intrusion attempt.

For journalists and whistle blowers facing some huge companies or mighty government agencies as their enemies this is probably still not secure enough. These three letter agencies might have the forensic equipment needed to salvage clear text from RAM even minutes after power down.

7

Here's a simple solution: rebuild the kernel without single-user mode!

More aptly put, edit the linux kernel you're using so that mode S is remapped to whatever your default mode happens to be (3,4,5). That way, any attempt to boot into single-user mode starts the system normally. You could probably do the same thing in the init scripts. That way there'd be no special means of entering the system without knowing the password.

  • If I can still get access to the grub prompt I can still change the kernel parameters to to init=/bin/bash. This will boot you into a root bash shell, where you can then mount /. – Jens Timmerman May 18 '15 at 9:13
  • Grub can always be configured to not allow access to its shell. – Arkain Oct 7 '15 at 18:55
  • As already has been pointed in other answers to this question: If a skilled attacker gets physical access to the computer then your rebuild kernel is nothing more than an old spider web on the way into the tomb containing your precious secret data jewels. :-) – pefu Dec 15 '15 at 16:41
3

Go over and ask on the Electronics site. I am pretty sure there are embedded SOC designs which encrypt everything and once you fuse it, is "impossible" to reverse engineer.

That said, I was at a DefCon presentation where the team showed exactly how they took it apart. In a lot of cases the chips hadn't been fused, or the chip design foolishly included an unconnected debug port. On others they removed chip layers chemically and read the chip with a electron microscope scan. You'll never be safe from really dedicated hackers.

1

I'd like to offer a different approach, if you're willing to consider destructive preventative measures. Consider soldering a large capacity capacitor to your hdd and ram, which on tamper detection (you decide method/sensors) discharges destroying data.

This "prevents" access in the empty sense of no one can access the system afterwards. So it answers the question verbatim, while possibly completely missing your intent.

A capacitor is just an example. Other possibilities exist. The issue is weather destruction of the device (or at least the data it contains) is acceptable.

Timer based solution are also possible - unless the device can ping home every few minutes/hours/... it self destructs. Many different possibilities along this theme.

  • At least a rotational HDD can have its platters transplanted to another, same-model drive, and they will read just fine even if the PCB was totally destroyed. (Not sure about SSDs, but I wouldn't count on it being that much harder.) This is something data recovery companies do all the time. If you're going to do something like this with any reasonable degree of certainty (though still by no means certain!), put a small explosive inside the bowels of the drive. Works better with SSDs than with rotational HDDs for reasons unrelated to the intended destructive force. – a CVn May 13 '15 at 16:53
  • @MichaelKjörling Thermite is the way to go. Explosives in an hdd requires a relatively large explosion to actually destroy the data. You'll destroy the top platter if the explosive is actually in the drive, but drive platters are pretty hefty, they aren't going to just incinerate without a rather unsafe amount of explosive. Thermite burns through metal quite nice though. – slicedtoad May 14 '15 at 14:59
1

A potential solution would be to use full disk encryption, put the key on an USB stick/memory card and put the computer in a metal box with a single door which has an opening switch, along with some environmental sensors.

To boot the device once you put the USB drive in the port (on the outside of the "vault") and it reads the FDE key from there and boots the system. If the "vault" is ever opened the opening switch will reset the system, erasing the key from the memory.

If the environment allows it, you can add more sensors such as temperature, acceleration, humidity, etc. If a sudden change is detected in the values reported, the system resets, so if a thief is just trying to take the system and put it in his pocket it'll already be reset before he even disconnects it from all its cables.

Not the answer you're looking for? Browse other questions tagged or ask your own question.