r/IOT • u/vstollen • Mar 21 '24
How to secure Linux-based IoT device?
Hey everyone,
I'm a Computer Science student working on my first IoT project.
The device will be based on a Raspberry Pi and I was wondering what measures are typically taken to secure such devices. I'm especially worried about (not running) security updates.
My current ideas were:
Router level: no port forwarding
Raspberry pi: Firewall, close all ports
Does a read-only file system improve security?
Does a VPN help? The device will communicate with a server which has to be exposed to the public internet.
What of these ideas make sense? What do you usually do? Any pointers are helpful!
2
u/_colemurray Mar 24 '24
I’d recommend creating a threat model document that outlines threats you’d expect, the risk if acted upon and plans to mitigate them.
At a high level, you have multiple threats, depending on your operating environment are a bigger or smaller deal.
Common threats:
man in the middle attacks
exposed ports / services (can be attacked on the same network or externally depending on environment)
vulnerabilities in software
vulnerabilities in hardware
physical tampering / vulnerabilities
1
u/cbrake Mar 21 '24
The biggest thing is to block incoming network requests and initiate all connections from the router. Something like https://nats.io/ helps a lot as they have solved many of the security problems, yet allow you to push information to edge devices without having open ports.
3
u/[deleted] Mar 21 '24
A couple tools to investigate
keylime https://keylime.dev/
network bound disk encryption https://github.com/RedHatDemos/SecurityDemos/blob/master/2020Labs/RHELSecurity/documentation/lab3_NBDE.adoc
FDO, fido https://www.redhat.com/sysadmin/edge-device-onboarding-fdo