If you built an IoT Device, would you ever:
- Not consider changing the root username and password?
- Not consider shutting off the SSH server?
- Not consider writing the most delicate parts in a memory-safe language?
- Not consider enabling Secure Boot or tamper detection?
- Not consider building a system for easy and automatic security updates, perhaps with an opt-out for those interested?
Almost all of us here would consider the above. Yet most IoT manufacturers never thought of any of them. You're competent.
The reality is that it takes a ton of work to get a microcontroller to blink an LED. Various clocks need to be configured, various peripheral devices (I2C controllers, GPIO controllers etc) need to be configured, interrupt vector tables need to be set up and so on.
Who is expected to do this work?
Today, it is done by the semiconductor vendor. When you buy a microcontroller, you’ll use an SDK and a toolchain that the vendor offers.
The vendor is incentivized to keep their SDK and tool chain as general as possible to sell into as many different designs as possible.
The OEM wants to ship a product as quickly as possible to make their cashflow model work.
There’s a huge gap between these two ends where a ton of important stuff goes unaddressed. At no point are the OEM and semiconductor vendor incentivized to sit together and addresses all the issues that fall through the cracks.
The current school of thought dominating MBA courses would see addressing these issues as a cost with no tangible benefits to the business. I can see their rationale: if consumers don’t signal that they care about security, then it is actually hard to argue that addressing security is a benefit to the business.
Most consumers today don’t know how bad the situation is to care about this stuff. It sucks because we firmware engineers want to do the right thing but we can’t justify it.
No, that's the easy part (even if done manually). The hard part starts with networking
> There’s a huge gap between these two ends where a ton of important stuff goes unaddressed. At no point are the OEM and semiconductor vendor incentivized to sit together and addresses all the issues that fall through the cracks.
Most SDKs I've seen end up somewhere at level of TCP stack, sometimes at level of simple web server. Because everything above will be very application specific.
It's near-entirely on the app vendor to fuck stuff above that. Don't try to push blame on manufacturer of the chip here, they didn't force your password to be 12345678
Frankly this whole idea the same protocols that are used on the web should go anywhere near microcontrollers is braindead.
Edit: apologies if this was too strongly/inappropriately worded, but I stand by the underlying point.
sshd has no place on most of these devices. But it comes packaged by default in many distributions. Real products are shipping with it right out of the box, and it's a problem.
At least in the US, customers are very price conscious and will sacrifice a lot to save a dollar. To frame this from their standpoint, "Why do I have to pay more for ¨features¨ that I don't want?"
I think folks _should_ demand more secure devices, but they also must be willing to pay for it.
(Many folks will immediately respond, "We'll use the government to force companies to do this!" but that can cost even more, as the company provides the extra features and also pays for the bureaucracy.)
The hardware vendors are providing the firmware instead of a spec that allows you to write your own. Then you're stuck using their software to use their hardware, even if it's awful or they stop updating it.
It's perfectly fine to provide a reference implementation, but that's not a substitute for hardware documentation sufficient to let you make your own if you don't want the vertical integration.
Because the party with the economic incentive to make it better is the end user. Not all of them have the capacity to do that, but only one of them needs to and you have better code available to the whole world.
It's possible they did think of these and just didn't do them for various reasons. Like it wasn't worth the cost (not necessarily due to changing the setting, but more from a support side), or they might have an incentive to leave it unsecured (Chinese tech), or something else.
The sad part is, the people making the decisions don't have imposter syndrome because they're making money with a success product and any shortcomings must be from the people under them.
Sure thing... How long will it take and will it get in the way of these 4 features we promised to the customer that they wanted last week?
Probably like about a month of work.
Well add it to the backlog and we will get to it eventually.
My idea is that, if you limit the IoT device - say, a thermostat or a smart bulb - to only have the exact capabilities it is supposed to have, then the damage from any external hack is limited to messing with the user's house. And, if the user has the ability to turn it off, the damage of the hack is limited to "the device doesn't do anything anymore".
I figure this is much better than the possibility that breaking the security enables the IoT device to spy on the user's network traffic, or their house, or be part of a botnet, or a bounce point for hacking attempts.
EDIT: I recognize there are good real-world reasons why IoT companies don't do it this way. If we actually valued security, then there would be an incentive for someone to build up the systems to facilitate this kind of limited-attack-value design.
Take a Wifi-based smart outlet, for example. The functionality is literally a single output that drives a relay. But in order for that to work, it needs to join a Wifi network - that means that you need some way to get an SSID and password onto the device and it needs a DHCP client to get an IP address. There also needs to be a way for the controller to discover the device's IP address, which means there's now likely an mDNS implementation on the device. Then there needs to be a way for the device to receive commands, so now we've got an HTTP server.
If you want out-of-home access, which I suspect most people do, there's even more work required. Usually this means a central server that the device connects to since most regular people don't have a VPN connection back home. Another option is HomeKit, which is explicitly about local control with all of the remote access magic handled by Apple. But HomeKit is yet more stuff to run on the device, and only works if you've bought into the Apple ecosystem.
This is a ton of scope creep for a pretty minimal device.
A Zigbee or Z-Wave based outlet would be better, but that really just moves all of that scope creep from the individual device to the hub.
This is actually fine as long as the hub is open source software running on a general purpose computer, because then you're not reliant on the hardware vendor to support it.
The fundamental problem is that the hardware vendors (1) don't provide what's necessary for anyone but themselves to support the hardware, and then (2) don't adequately support it themselves.
Far better to address (1) than (2).
You can do exactly what you propose, right now, with stuff like ESPhome. You pre-bake what device does and which WiFi network it uses into image, burn it in, and you're done.
But that's for "us"
Normal user needs a way to get the box to configure to his needs, and do it easily. So suddenly you can "log" onto device and edit its config, and you need to find a way to make sure only legit user does it etc.
And now it is a big blob of code and you DONT, UNDER ANY CIRCUMSTANCE want to have big blob of code that's hard to update in the wild.
I would bake it in the bios or similar, and print it on the bottom of the device.
- Not consider shutting off the SSH server?
I would keep sshd running, precisely for the fact that the person who bought this could modify it I'm a reasonable and sane manner, like any Linux peripheral. It also allows for more extensibility past what I thought of.
- Not consider writing the most delicate parts in a memory-safe language?
I wouldn't reinvent the wheel. Use Linux, QNX, or Tron. Probably not Tron, but it IS open source.
- Not consider enabling Secure Boot or tamper detection?
Are we assuming the person who buys this as the enemy, or are we trying to evade Mission Impossible level national spies from looking how some IoT shit works?
- Not consider building a system for easy and automatic security updates, perhaps with an opt-out for those interested?
Most "security" updates are just malware in disguise. I've seen enough de-featurization and others in the name of security.