集装箱质量保证的命令行工具
stools的Python项目详细描述
#奇点容器工具
这些是用于奇点容器的工具,经过优化后可用于安全性的连续集成 以及质量检查。有关在连续集成上下文中使用的包的示例,请参阅[stools clair](https://github.com/singularityhub/stools-clair)存储库。
[![ascicast](https://asciinema.org/a/178712.png)](https://asciinema.org/a/178712)
在这项工作中,我们将结合使用[clair os](https://github.com/coreos/clair)和连续集成 (travis和circle)扫描[奇点](https://singularityware.github.io)容器以确保安全 脆弱性。
##背景 clair打算作为服务器运行,以连续扫描dockerlayers中的漏洞。这不是地图 由于以下原因,我们将进入研究领域:
- Docker containers come in layers (.tar.gz files) while Singularity images are single binary files that don’t “plug in” nicely to Clair.
- Most researchers can’t support continuous running of such a service.
另一方面,一个典型的研究人员使用像[travisci](https://travis-ci.org)和[circleci](https://circle-ci.org)这样的服务来 根据测试运行他们的代码库。由于这些服务现在提供运行容器和其他服务类型,我们实际上可以执行以下操作:
- Spin up a Clair server during testing
- Build a Singularity image, and scan the filesystem contents (before finalized in the image).
虽然这不是一个持续运行的服务,但我们可以最低限度地确保每次扫描一个容器 它被构建(然后可能被合并用于生产)。如果用户利用了[singularity hub](https://www.singularity-hub.org)或[singularity registry server](https://singularityhub.github.io/sregistry),图像将在经过 这些不同的测试。
这个实验基于[这个线程](https://github.com/singularityhub/sregistry/issues/14)中的早期讨论。
##基本用法
如果需要,可以构建容器(或从Docker Hub使用)
`bash docker build -tvanessa/stools-clair . `
用docker compose启动应用程序。请注意,您应该在$pwd中拥有要扫描的图像,该图像将映射到/code中的容器(请参阅docker-compose.yml文件)。你可以改变这个,只要确定你想添加的容器在这里。我将更新此内容,以便内部服务器可以接受外部容器的帖子,但我需要先睡眠:)
`bash docker-compose up -d `
扫描$pwd中映射到容器中/代码的本地图像。如果没有克隆repo,请确保首先获得[docker compose.yml](https://github.com/singularityhub/stools/blob/master/docker-compose.yml)文件!
`bash singularity pull shub://vsoch/singularity-hello-world docker exec -itclair-scanner sclair vsoch-singularity-hello-world-master-latest.simg `