Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

shh

> 编程语言
Open source

Systemd Hardening Helper - Automatic systemd service hardening guided by strace profiling

376 stars0 likes1 views
WebsiteGitHub

About

Systemd Hardening Helper - Automatic systemd service hardening guided by strace profiling

Automatic systemd service hardening guided by strace profiling.

SHH can generate an optimal set of hardening options for each of your services, so you can raise the security level of your system without sweating about random errors in production caused by too restrictive sandboxing.

Official repository - Mirror repository

Documentation

  • High level introduction: Systemd hardening made easy with SHH
  • FAQ
  • Changelog
  • Currently supported systemd options

Installation

Dependencies

Strace needs to be installed and its executable reachable in PATH. Strace version >= 6.6 is currently required.

From source

You need a Rust build environment for example from rustup.

Run in the current repository:

cargo build --release
install -Dm 755 -t /usr/local/bin target/release/shh

From crates.io

bash
sudo cargo install --root /usr/local systemd-hardening-helper

Debian (or Debian based distribution)

See GitHub releases for Debian packages built for each tagged version.

Arch Linux

Arch Linux users can install the shh AUR package.

Nixpkgs

Nixos/Nix users can install the latest package from the unstable branch.

Usage

Hardening a service

To harden a system unit named SERVICE.service:

  1. Start service profiling: shh service start-profile SERVICE. The service will be restarted with strace profiling.
  2. Use the service normally for a while, trying to cover as much features and use cases as possible.
  3. Run shh service finish-profile SERVICE -a. The service will be restarted with a hardened configuration built from previous runtime profiling, to allow it to run safely as was observed during the profiling period, and to deny other dangerous system actions.

Run shh -h for full command line reference, or append -h to a subcommand to get help.

[!WARNING] The hardening options generated by shh are by construction not portable across different systems. They depend on many factors, and may break the service if any of those change:

  • the code path covered during profiling
  • the Linux kernel version
  • the libc used
  • the systemd version

Reusing options generated by shh on a system with a different environment (ie. different Linux distribution) is very likely to break the service.

Testing locally

If you want to run a quick test to see what options would be generated, you can use shh run -- COMMAND.

Current directory and PATH environment variable both influence the program execution, reset those first:

bash
$ cd /
export PATH=/usr/local/bin:/usr/bin:/bin

Then to see what options would be generated for a curl https://www.example.com invocation:

…

Or to sandbox as much as possible:

…

License

GPLv3

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言