# How do you secure your dev machine/environment?

**URL:** <https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461>\
**Category:** Dev Env / Tools / AI\
**Tags:** security, dev-machines\
**Created:** [April 5, 2024, 11:42pm UTC](https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461 "2024-04-05T23:42:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstonJ](https://erlangforums.com/user_avatar/erlangforums.com/astonj/32/9_2.png) [@AstonJ](https://erlangforums.com/u/AstonJ)\
**Post date:** [April 5, 2024, 11:42pm UTC](https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461/1 "2024-04-05T23:42:09Z")

</div>

Following some of the comments in the EF version of [How often do you upgrade/replace your dev machine? (poll)](https://erlangforums.com/t/how-often-do-you-upgrade-replace-your-dev-machine-poll/3378) I’m wondering how you all secure your dev machines. Please let us know in this thread! 🔒

_When answering please say which OS you’re talking about if applicable._

---

<div class="post-metadata">

**Author:** ![AstonJ](https://erlangforums.com/user_avatar/erlangforums.com/astonj/32/9_2.png) [@AstonJ](https://erlangforums.com/u/AstonJ)\
**Post date:** [April 5, 2024, 11:42pm UTC](https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461/2 "2024-04-05T23:42:46Z")

</div>

While fresh in my mind…  
_(Was messing around with the stats and istats apps and noticed weird startup processes!)_

# macOS

Apart from the obvious like setting a password etc…

- Turn on **FileVault** to encrypt your drive: `Privacy & Security > FileVault`
- Turn on your **firewall** : `Network > Firewall` (then periodically click on ‘Options’ to check those in the list of incoming connections).
- Enable **end-to-end encryption of iCloud** data: `iCloud > Advanced Data Protection`

Oddly - none of the above is on by default!

- Install **LittleSnitch** to allow/disallow connections to the web (there are free alternatives)
- Set up **Time Machine** backups (encrypted and usually run two and keep old copies)
- Check `Privacy & Security > Files * Folders` to see which folders your apps can access
- Check `Privacy & Security > Full Disk Access`
- Check `Privacy & Security > Accessibility` to see which apps can ‘control’ your Mac
- Check `Lock Screen > require password after screen saver begins` immediately/whatever you require
- Check `General > login items` for apps/services that automatically start at login
- Check your folder permissions (particularly if you have added any to you home folder). `Folder > right click > info` (should be `you` \> `Read & Write` and `everyone` \> `no access`)
- `Privacy & Security > Advanced > log out automatically after inactivity` (means a password would be required instead of just Touch ID)

You may also want to look at Apple’s new `Lockdown Mode`, which they say can offer extreme protection.

That’s all I can think of for now, I’d be curious how people are achieving similar in Linux (if I move from macOS I’d probably go to Linux).

---

<div class="post-metadata">

**Author:** ![dch](https://erlangforums.com/user_avatar/erlangforums.com/dch/32/962_2.png) [@dch](https://erlangforums.com/u/dch)\
**Post date:** [March 23, 2025, 11:16am UTC](https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461/3 "2025-03-23T11:16:21Z")

</div>

This necro-thread popped up in my feed today for some reason.

# FreeBSD

- login only via yubikey, whether ssh or locally
- zfs with native encryption on key partitions
- pf firewall, block by default
- a bunch of typical FreeBSD security sysctls

As security is CIA (confidentiality, Integrity, Availability) I also do backups!

- tarsnap for critical individual files & key server files
- restic for larger things like database backups
- patch regularly of course

Without the yubikey and the disk password the system is useless, same setup for my laptop.

---

<div class="post-metadata">

**Author:** ![jchrist](https://erlangforums.com/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jchrist](https://erlangforums.com/u/jchrist)\
**Post date:** [March 29, 2025, 8:32am UTC](https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461/4 "2025-03-29T08:32:51Z")

</div>

Very interesting question! And I guess I’m gonna join in on reviving the thread. 😁

> That’s all I can think of for now, I’d be curious how people are achieving similar in Linux (if I move from macOS I’d probably go to Linux).

I am on Linux, the standard system setup procedure for me is:

- set up full disk encryption using [dm-crypt](https://en.wikipedia.org/wiki/Dm-crypt) via [cryptsetup](https://linux.die.net/man/8/cryptsetup)
- configure the [nftables](https://en.wikipedia.org/wiki/Nftables) firewall to block everything inbound except for anything apps might need (e.g. syncthing)
- lock down the kernel via selected `sysctl`s from [Linux Hardening Guide | Madaidan's Insecurities](https://madaidans-insecurities.github.io/guides/linux-hardening.html)
- install [USBGuard](https://usbguard.github.io/) to block any unexpected USB devices by default
- install and configure [firejail](https://github.com/netblue30/firejail/). This will put most programs into a restrictive sandbox, e.g. Firefox can’t access files outside of the downloads directory. This isn’t a perfect sandbox (see e.g. [NVD - CVE-2022-31214](https://nvd.nist.gov/vuln/detail/CVE-2022-31214)) but it’s very very good and really ships with profiles for almost everything. I also set `force-nonewprivs yes` to reduce the possibility of privilege escalation. (This pretty much does the “see which folders your apps can access”, but you can also restrict the network, process tree and so on).
- I install a bunch of browser plugins to restrict what may run in my browser, mainly [UBlock Origin](https://ublockorigin.com/) and [NoScript](https://noscript.net/).
- heavily recommended: do not give your own user `sudo` rights, instead switch to a virtual console (i.e. CTRL+ALT+F1), use [Secure Attention Key](https://en.wikipedia.org/wiki/Secure_attention_key) and only then enter root password

There’s a decent amount of privacy measures as well.

Anyways, the problem I see with all this sandboxing - which is why I think it’s a very interesting topic - is that basically the moment you install something with `mix` / `pip` / `gem` / `rebar` / `go` etc. usually no “standard” sandboxing is available. So any piece of malicious open source code can take over your computer (or at least user account). At least on Linux this is the case, on the BSDs I’m not really sure, if I remember correctly on Mac once you give Terminal access to your files that’s also the case? Not sure how it is on Windows. The [XZ Utils backdoor](https://en.wikipedia.org/wiki/XZ_Utils_backdoor) IMO is a good example how “easy” it is to hide something malicious even in the open, or see [Ken Thompson’s Turing Award Lecture: Reflections on Trusting Trust](https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf) I see a few options:

- accept the risk that any malicious open source can take over your computer (most convenient)
- sandbox using something like firejail (small inconvenience)
- set up some containerization for every development environment (has other benefits, too)
  - at least guix can also make isolated containers, see [GNU Guix cookbook, p. 49](https://guix.gnu.org/cookbook/en/guix-cookbook.pdf)
  - of course this gets messy with things like how to edit files in there, networking and so on

- use VMs, e.g [https://www.qubes-os.org/](https://www.qubes-os.org/)
  - most inconvenient but most secure I think !

I think it’s all a big scale on how much you want to inconvenience yourself. For Python (which I use at work) I wrote a plugin for the dependency manager that uses Linux’s [Landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) and [`unshare`](https://man7.org/linux/man-pages/man2/unshare.2.html) to restrict what any code running in there can’t see. Not perfect, but it’s all about raising the bar 🙂

---

<div class="post-metadata">

**Author:** ![AstonJ](https://erlangforums.com/user_avatar/erlangforums.com/astonj/32/9_2.png) [@AstonJ](https://erlangforums.com/u/AstonJ)\
**Post date:** [March 29, 2025, 5:51pm UTC](https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461/5 "2025-03-29T17:51:25Z")

</div>

Thanks @dch and @jchrist - what do you use for backups?

On macOS I use Time Machine, encrypted and usually have two on the go (and keep old copies from time to time just to be on the safe side).

---

<div class="post-metadata">

**Author:** ![jchrist](https://erlangforums.com/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jchrist](https://erlangforums.com/u/jchrist)\
**Post date:** [March 30, 2025, 8:22am UTC](https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461/6 "2025-03-30T08:22:48Z")

</div>

> what do you use for backups?

A mix of two things:

- filesystem snapshots - I use BTRFS and these are very cheap to make, the [`btrbk`](https://digint.ch/btrbk/) tool manages them automatically for me, [Snapper](http://snapper.io/) would be a GUI snapshot tool. These are shipped offsite via `btrbk`, too. Usually if I screw up something it’s enough to look into the local snapshots.
  - Note that btrfs doesn’t have native encryption, so you will want to put this on top of encrypted hard drives.

- “true” backups I do via [`borgmatic`](https://torsion.org/borgmatic/) which is a “frontend” for [Borg](https://borgbackup.readthedocs.io/en/stable/). Basically, you have one (or more) configuration file(s) which say I want to back up these files to those locations, retain this data for so long etc… It’s fully encrypted and has never failed me. [Vorta](https://vorta.borgbase.com/) is a GUI for borg.

---

<div class="post-metadata">

**Author:** ![torstenn](https://erlangforums.com/user_avatar/erlangforums.com/torstenn/32/2540_2.png) [@torstenn](https://erlangforums.com/u/torstenn)\
**Post date:** [April 13, 2025, 9:37am UTC](https://erlangforums.com/t/how-do-you-secure-your-dev-machine-environment/3461/7 "2025-04-13T09:37:44Z")

</div>

GNOME Backups aka DejaDup now works as a front end to Restic and even doing backups straight to OneDrive works surprisingly well.
