百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

shh

> 编程语言
开源

Systemd 加固辅助程序 - 由 strace 分析导引的自动系统d 服务加固

376 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Systemd 加固辅助程序 - 由 strace 分析导引的自动系统d 服务加固

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

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