# Tamper detection methods

**URL:** <https://forums.balena.io/t/tamper-detection-methods/48679>\
**Category:** balenaOS\
**Created:** [December 4, 2019, 8:11pm UTC](https://forums.balena.io/t/tamper-detection-methods/48679 "2019-12-04T20:11:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvetter](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bvetter](https://forums.balena.io/u/bvetter)\
**Post date:** [December 4, 2019, 8:11pm UTC](https://forums.balena.io/t/tamper-detection-methods/48679/1 "2019-12-04T20:11:41Z")

</div>

This post is related to

> [@Tamper access detection and FS crypting with ZymKey from Zymbit?](https://forums.balena.io/t/tamper-access-detection-and-fs-crypting-with-zymkey-from-zymbit/40258):
>
> Hi, May be you know such device pour PI [https://www.zymbit.com/zymkey/](https://www.zymbit.com/zymkey/) ? Would it work for BalenaFin + BalenaOS? My goal would be to ensure no physical violation nor usurpation of our devices. Do you have plan to support devices for tamper detection and filesystem encryption? Regards, Sylvain.

We have Non Balena devices in production using Zymbits Zymkey and encrypted filesystem to prevent misuse of devices stolen from their mounting location.

My current impression is that going this way makes our setup unnecessarily complex and costly and prevents us from choosing hardware that does not support this.

So I am looking for other ways to reduce mainly the risk of s.o. misusing the credentials they might find on the unencrypted device.

1. Make sure the device has limited access to out backend systems.
2. Implement a kind of tamper detection (not prevention) that informs us about unusual device metrics that indicate a risk that the device has been compromised.

My interest here is to sort out the second point: Which metrics or information available on the device could I use as triggers for a ‚I have been tampered with‘ message to the backend, knowing and accepting that some of them could be faked with some effort?

Our devices are stationary, so one thing I could check is if the location (gsm cell) has changed.

Any more ideas much welcome.  
Bruno

---

<div class="post-metadata">

**Author:** ![pdcastro](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pdcastro/32/1264_2.png) [@pdcastro](https://forums.balena.io/u/pdcastro)\
**Post date:** [December 4, 2019, 8:56pm UTC](https://forums.balena.io/t/tamper-detection-methods/48679/2 "2019-12-04T20:56:24Z")

</div>

> Our devices are stationary, so one thing I could check is if the location (gsm cell) has changed. Any more ideas much welcome.

Related to the location / GSM cell idea, something else that could be checked is the MAC address of the “default gateway” (e.g. a WiFi router providing internet access), like “4c:38:d8:00:22:18” in the example below:

```auto
root@5d3ffbf:~# balena-engine run -it --privileged --network host --rm alpine
/ # ip route show | grep default
default via 192.168.0.1 dev wlan0 metric 600
/ # arp -an
? (192.168.0.1) at 4c:38:d8:00:22:18 [ether] on wlan0
...

```

---

<div class="post-metadata">

**Author:** ![pdcastro](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pdcastro/32/1264_2.png) [@pdcastro](https://forums.balena.io/u/pdcastro)\
**Post date:** [December 4, 2019, 9:09pm UTC](https://forums.balena.io/t/tamper-detection-methods/48679/3 "2019-12-04T21:09:44Z")

</div>

Also, if your board has a spare GPIO pin, perhaps fitting a simple on/off switch to the case, that detects if the case is physically opened – at least while the board is powered up…

---

<div class="post-metadata">

**Author:** ![bvetter](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bvetter](https://forums.balena.io/u/bvetter)\
**Post date:** [December 5, 2019, 8:56am UTC](https://forums.balena.io/t/tamper-detection-methods/48679/7 "2019-12-05T08:56:50Z")

</div>

Good suggestions, thank you! We are looking for off-the-shelf hardware, so I am looking mainly for software based solutions.

---

<div class="post-metadata">

**Author:** ![AlidaOdendaal](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alidaodendaal/32/1641_2.png) [@AlidaOdendaal](https://forums.balena.io/u/AlidaOdendaal)\
**Post date:** [December 5, 2019, 10:21am UTC](https://forums.balena.io/t/tamper-detection-methods/48679/8 "2019-12-05T10:21:14Z")

</div>

Hi Bruno, just want to let you know that we’ve also asked one of our security experts if he has more suggestions for tamper detection, if so we will get back to you again 🙂

---

<div class="post-metadata">

**Author:** ![bvetter](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bvetter](https://forums.balena.io/u/bvetter)\
**Post date:** [December 5, 2019, 11:30am UTC](https://forums.balena.io/t/tamper-detection-methods/48679/10 "2019-12-05T11:30:19Z")

</div>

Great Alida,

the idea we think about is accepting the device itself is insecure, but minimizing the potential misuse and impact on the backend.

Bruno

---

<div class="post-metadata">

**Author:** ![richbayliss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/richbayliss/32/1054_2.png) [@richbayliss](https://forums.balena.io/u/richbayliss)\
**Post date:** [December 5, 2019, 12:39pm UTC](https://forums.balena.io/t/tamper-detection-methods/48679/11 "2019-12-05T12:39:33Z")

</div>

Bruno,

I have personally been investigating the options around encryption at rest and what we could build into the OS to allow support for this. I have access to a Zymbit and I have been looking into how it integrates and what support is needed on the OS/HW level.

I don’t have anything concrete to put forward yet, but I thought it would useful to you to know that this is a conversation that is happening internally and these kinds of feedback help us focus our discussions. So thank you 😁

Regarding tamper detection mechanism, if the risk is that the device could be moved/stolen, then you could periodically write the device’ uptime to a file and then check that the uptime is always greater than that value - and keep updating it. If the device reboots then you would be able to detect it, but how you handle that would be up to you 👍

---

<div class="post-metadata">

**Author:** ![bvetter](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bvetter](https://forums.balena.io/u/bvetter)\
**Post date:** [December 8, 2019, 8:46am UTC](https://forums.balena.io/t/tamper-detection-methods/48679/14 "2019-12-08T08:46:24Z")

</div>

Ok. Zymbit will still be an option but we will focus on tamper detection. Tnx for the suggestions.
