生成安全计算模式的命令行工具
cerber的Python项目详细描述
用于生成seccomp json配置文件的简单命令行工具
概述
seccomp(secure computing mode的缩写)是一种计算机安全性 Linux内核中的功能。 seccomp允许进程单向转换为“安全” 无法进行系统调用的状态, sigReturn()、read()和write()到已打开的文件描述符。 如果它尝试任何其他系统调用,内核将终止 使用sigkill或sigsys的进程。 从这个意义上说,它不是虚拟化系统的资源,而是隔离 完全是他们的过程。
seccomp profile用于许多应用程序,如:
- 码头工人
- 火狐
- 系统d
- openssh
- 铬
- 还有更多…
Cerber帮助您生成您可以 与Docker一起使用。
先决条件
- Linux
- Python3.5+
- 斯特拉斯
安装
$ pip install cerber
用法
在当前目录中生成seccomp_profile.json:
$ cerber docker run hello-world $ ls seccomp_profile.json $ cat seccomp_profile.json {"defaultAction": "SCMP_ACT_ERRNO", "architecture": ["SCMP_ARCH_X86_64", "SCMP_ARCH_X86", "SCMP_ARCH_X32"], "syscalls": [{"action": "SCMP_ACT_ALLOW", "args": [], "name": "read"}, ... {"action": "SCMP_ACT_ALLOW", "args": [], "name": "execve"}, {"action": "SCMP_ACT_ALLOW", "args": [], "name": "arch_prctl"}]}
现在您可以在运行时将此seccomp配置文件分配给容器:
$ docker run \ --rm \ --security-opt="no-new-privileges"\ --security-opt seccomp=seccomp_profile.json \ hello-world # you can get the following output for docker hello world Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. ... For more examples and ideas, visit: https://docs.docker.com/engine/userguide/
注意在同一个cpu架构上用cerber生成seccomp配置文件 您的生产环境(您希望在其中运行容器)。
功能
- 检测系统调用
- 从检测到的系统调用生成seccomp配置文件
贡献
$ git clone https://github.com/gr0und-s3ct0r/cerber $ cd cerber $ pipenv install pbr $ pipenv shell # generate a virtual environment $ python setup.py develop # install cerber in development mode $ pip install -e .[test]# install testing dependencies $ # make your changes $ tox
进一步读数
更改
0.2.0
- 从pypi安装
- 修复许可证分类器
- 更新更改日志
0.1.0
- 添加构建徽章
- 修复PEP8错误
- 忽略PYC
- 修复PEP8错误
- 添加有关seccomp的概述
- 添加更多读数
- 如何使用security profil的示例
- 在文档中修复文件名输出
- 修复安装
- 修复贡献指南
- 使用生成的seccomp.json文件更新用法
- 对自述文件使用structuredtext而不是markdown
- 包装+tu+ci
- 介绍ci
- 保持strace统计
- 添加gitignore
- 重命名tmpfile并在文件中创建seccomp配置文件
- 执行时不要触摸stdout和stderr使其透明
- 进一步阅读和投稿
- 使用命令更新文档
- 将要执行的命令传递给保镖
- 提高使用率
- 重命名工具
- 初始化存储库
hervéberaud,herveberaud.pro@gmail.com>; 塞巴斯蒂安·博伊隆sebastien@boyron.eu>;