A web app or a small API has no reason to see /dev/sda or /dev/mem. By default it does, and as root it could read a whole disk.
sudo systemctl edit --drop-in=devices myapp.service
[Service]
PrivateDevices=yes
The service then gets its own small /dev with only pseudo devices. Listed through the service’s mount namespace, it holds null, zero, random, urandom, tty, pts, shm and a few more, and nothing else. A quick check with a one-off unit:
sudo systemd-run --wait -p PrivateDevices=yes ls /dev/sda /dev/null
That prints /dev/null and cannot access '/dev/sda': No such file or directory.
The setting also removes the capability to create device nodes and turns on NoNewPrivileges=, so the service can not get the disks back by itself. systemd-analyze security counts it among its checks, and I find it one of the easiest to add because most network services never touch hardware.
Leave it off for anything that does need a device: a backup tool reading a raw disk, a service talking to a USB serial adapter, a media server using /dev/dri for hardware transcoding, or smartmontools. Those fail with missing device errors, which at least makes the cause easy to spot in the journal.
Further reading: systemd.exec man page