Dockle - 用于安全的容器镜像检查工具,帮助构建最佳实践的Docker镜像,易于上手
Dockle 帮助你:
参见 [安装](#installation) 和 [常见示例](#common-examples)
<img src="https://assets.kitploit.com/production/public/readmes/4137/343598bd4d53296c6d6d23acde8c2917d5727f03e7b3a34c1ff0865c435bb974.png" width="800">
# 检查点对比
<img src="https://assets.kitploit.com/production/public/readmes/4137/4f4835c3a5fd70f436d9d8ea656fd8a521112fece4e35977288064d3f6f4510a.png" width="800">
<img src="https://assets.kitploit.com/production/public/readmes/4137/7bee9da0b061957af6a175a3b975dca82813c27f72ab6921dfe8ab2d6747322b.png" width="800">
# 目录
- [特性](#features)
- [对比](#comparison)
- [安装](#installation)
- [Homebrew (Mac OS X / Linux 和 WSL)](#homebrew-mac-os-x--linux-and-wsl)
- [RHEL/CentOS](#rhelcentos)
- [Debian/Ubuntu](#debianubuntu)
- [Arch Linux](#arch-linux)
- [Windows](#windows)
- [Microsoft PowerShell 7](#microsoft-powershell-7)
- [二进制](#binary)
- [asdf](#asdf)
- [mise](#mise)
- [源码编译](#from-source)
- [使用 Docker](#use-docker)
- [快速开始](#quick-start)
- [基础](#basic)
- [Docker](#docker)
- [检查点概述](#checkpoint-summary)
- [常见示例](#common-examples)
- [扫描镜像](#scan-an-image)
- [扫描镜像文件](#scan-an-image-file)
- [以 JSON 格式获取或保存结果](#get-or-save-the-results-as-json)
- [以 SARIF 格式获取或保存结果](#get-or-save-the-results-as-sarif)
- [指定退出码](#specify-exit-code)
- [指定退出级别](#specify-exit-level)
- [忽略指定的检查点](#ignore-the-specified-checkpoints)
- [接受可疑的环境变量 / 文件 / 文件扩展名](#accept-suspicious-environment-variables--files--file-extensions)
- [拒绝可疑的环境变量 / 文件 / 文件扩展名](#reject-suspicious-environment-variables--files--file-extensions)
- [持续集成 (CI)](#continuous-integration-ci)
- [GitHub Action](#github-action)
- [Travis CI](#travis-ci)
- [CircleCI](#circleci)
- [GitLab CI](#gitlab-ci)
- [私有 Docker 仓库的认证](#authorization-for-private-docker-registry)
- [Docker Hub](#docker-hub)
- [Amazon ECR (Elastic Container Registry)](#amazon-ecr-elastic-container-registry)
- [GCR (Google Container Registry)](#gcr-google-container-registry)
- [自托管仓库 (BasicAuth)](#self-hosted-registry-basicauth)
- [贡献者](#contributors)
- [代码贡献者](#code-contributors)
- [财务贡献者](#financial-contributors)
- [个人](#individuals)
- [组织](#organizations)
- [许可证](#license)
- [作者](#author)
# 特性
- 检测容器漏洞
- 帮助构建最佳实践的 Dockerfile
- 使用简单
- 仅需指定镜像名称
- 参见 [快速开始](#quick-start) 和 [常见示例](#common-examples)
- 支持 CIS 基准
- 高准确度
- DevSecOps
- 适用于 CI,如 Travis CI、CircleCI、Jenkins 等
- 参见 [CI 示例](#continuous-integration-ci)
# 对比
| | [Dockle](https://github.com/goodwithtech/dockle) | [Hadolint](https://github.com/hadolint/hadolint) | [Docker Bench for Security](https://github.com/docker/docker-bench-security) | [Clair](https://github.com/coreos/clair) |
|--- |---:|---:|---:|---:|
| 目标 | 镜像 | Dockerfile | 主机<br/>Docker 守护进程<br/>镜像<br/>容器运行时 | 镜像 |
| 运行方式 | 二进制 | 二进制 | Shell 脚本 | 二进制 |
| 依赖 | 无 | 无 | 一些依赖 | 无 |
| CI 适用性 | ✓ | ✓ | x | x |
| 目的 | 安全审计<br/>Dockerfile 检查 | Dockerfile 检查 | 安全审计<br/>Dockerfile 检查 | 漏洞扫描 |
# 安装
## Homebrew (Mac OS X / Linux 和 WSL)
你可以在 [Mac OS X](https://brew.sh/) 或 [Linux 和 WSL(Windows Subsystem for Linux)](https://docs.brew.sh/Homebrew-on-Linux) 上使用 Homebrew。```bash
$ brew install goodwithtech/r/dockle
VERSION=$(
curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" |
grep '"tag_name":' |
sed -E 's/."v([^"]+)"./\1/'
) && rpm -ivh https://github.com/goodwithtech/dockle/releases/download/v${VERSION}/dockle_${VERSION}_Linux-64bit.rpm
## Debian/Ubuntu```bash
VERSION=$(
curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" | \
grep '"tag_name":' | \
sed -E 's/.*"v([^"]+)".*/\1/' \
) && curl -L -o dockle.deb https://github.com/goodwithtech/dockle/releases/download/v${VERSION}/dockle_${VERSION}_Linux-64bit.deb
$ sudo dpkg -i dockle.deb && rm dockle.deb
可以通过Arch用户软件仓库使用dockle或dockle-bin包来安装dockle。```
git clone https://aur.archlinux.org/dockle-bin.git
cd dockle-bin
makepkg -sri
## Windows```bash
VERSION=$(
curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" | \
grep '"tag_name":' | \
sed -E 's/.*"v([^"]+)".*/\1/' \
) && curl -L -o dockle.zip https://github.com/goodwithtech/dockle/releases/download/v${VERSION}/dockle_${VERSION}_Windows-64bit.zip
$ unzip dockle.zip && rm dockle.zip
$ ./dockle.exe [IMAGE_NAME]
if (((Invoke-WebRequest "https://api.github.com/repos/goodwithtech/dockle/releases/latest").Content) -match '"tag_name":"v(?[^"]+)"') { $VERSION=$Matches.ver && Invoke-WebRequest "https://github.com/goodwithtech/dockle/releases/download/v${VERSION}/dockle_${VERSION}_Windows-64bit.zip" -OutFile dockle.zip && Expand-Archive dockle.zip && Remove-Item dockle.zip }
## Binary
你可以从 [releases 页面](https://github.com/goodwithtech/dockle/releases/latest) 获取最新版本的二进制文件。
下载适用于你操作系统/架构的归档文件。解压归档,并将二进制文件放到你的 `$PATH` 中的某个位置(在类 UNIX 系统上,通常是 `/usr/local/bin` 或类似路径)。
- 注意:确保其可执行位已开启。(`chmod +x dockle`)
## asdf
你可以通过 [asdf 版本管理器](https://asdf-vm.com/) 和这个 [插件](https://github.com/mathew-fleisch/asdf-dockle) 来安装 dockle,该插件自动化了安装(以及切换)各种版本 GitHub 发布二进制文件的过程。在已安装 asdf 的情况下,运行以下命令来安装 dockle:```bash
# Add dockle plugin
asdf plugin add dockle
# Show all installable versions
asdf list-all dockle
# Install specific version
asdf install dockle latest
# Set a version globally (on your ~/.tool-versions file)
asdf global dockle latest
# Now dockle commands are available
dockle --version
你可以使用 mise(多语言工具版本管理器)来安装 dockle。在已安装 mise 的情况下,运行以下命令来安装 dockle:```bash
mise ls-remote dockle
mise install dockle@latest
mise use -g dockle@latest
dockle --version
## 从源码```bash
$ GO111MODULE=off go get github.com/goodwithtech/dockle/cmd/dockle
$ cd $GOPATH/src/github.com/goodwithtech/dockle && GO111MODULE=on go build -o $GOPATH/bin/dockle cmd/dockle/main.go
Docker Hub 上也有一个 Dockle 镜像。你可以在安装命令之前试用 dockle。```
$ VERSION=$(
curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" |
grep '"tag_name":' |
sed -E 's/."v([^"]+)"./\1/'
) && docker run --rm -v /var/run/docker.sock:/var/run/docker.sock
goodwithtech/dockle:v${VERSION} [YOUR_IMAGE_NAME]
当你想要扫描主机上的镜像时,你只需要 `-v /var/run/docker.sock:/var/run/docker.sock`。
# 快速开始
## 基础
只需指定一个镜像名称(及标签)。```bash
$ dockle [YOUR_IMAGE_NAME]
</details>
## Docker
此外,您也可以使用 Docker 运行 `dockle` 命令,如下所示。```bash
$ export DOCKLE_LATEST=$(
curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" | \
grep '"tag_name":' | \
sed -E 's/.*"v([^"]+)".*/\1/' \
)
$ docker run --rm goodwithtech/dockle:v${DOCKLE_LATEST} [YOUR_IMAGE_NAME]
如果您想扫描宿主机上的镜像,您需要挂载 docker.sock。
$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ...
$ docker save alpine:latest -o alpine.tar $ dockle --input alpine.tar
### 获取或保存结果为JSON```bash
$ dockle -f json goodwithtech/test-image:v1
$ dockle -f json -o results.json goodwithtech/test-image:v1
$ dockle -f sarif goodwithtech/test-image:v1 $ dockle -f sarif -o results.json goodwithtech/test-image:v1
<details>
<summary>结果</summary>```json
{
"version": "2.1.0",
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"runs": [
{
"tool": {
"driver": {
"name": "Dockle",
"informationUri": "https://github.com/goodwithtech/dockle",
"rules": [
{
"id": "CIS-DI-0009",
"shortDescription": {
"text": "Use COPY instead of ADD in Dockerfile"
},
"help": {
"text": "https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#CIS-DI-0009"
}
},
{
"id": "CIS-DI-0010",
"shortDescription": {
"text": "Do not store credential in ENVIRONMENT vars/files"
},
"help": {
"text": "https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#CIS-DI-0010"
}
},
{
"id": "DKL-DI-0005",
"shortDescription": {
"text": "Clear apt-get caches"
},
"help": {
"text": "https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#DKL-DI-0005"
}
},
{
"id": "DKL-LI-0001",
"shortDescription": {
"text": "Avoid empty password"
},
"help": {
"text": "https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#DKL-LI-0001"
}
},
{
"id": "CIS-DI-0005",
"shortDescription": {
"text": "Enable Content trust for Docker"
},
"help": {
"text": "https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#CIS-DI-0005"
}
},
{
"id": "CIS-DI-0008",
"shortDescription": {
"text": "Confirm safety of setuid/setgid files"
},
"help": {
"text": "https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#CIS-DI-0008"
}
},
{
"id": "CIS-DI-0001",
"shortDescription": {
"text": "Create a user for the container"
},
"help": {
"text": "https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#CIS-DI-0001"
}
},
{
"id": "CIS-DI-0006",
"shortDescription": {
"text": "Add HEALTHCHECK instruction to the container image"
},
"help": {
"text": "https://github.com/goodwithtech/dockle/blob/master/CHECKPOINT.md#CIS-DI-0006"
}
}
]
}
},
"results": [
{
"ruleId": "CIS-DI-0009",
"level": "error",
"message": {
"text": "Use COPY : /bin/sh -c #(nop) ADD file:81c0a803075715d1a6b4f75a29f8a01b21cc170cfc1bff6702317d1be2fe71a3 in /app/credentials.json "
}
},
{
"ruleId": "CIS-DI-0010",
"level": "error",
"message": {
"text": "Suspicious filename found : app/credentials.json , Suspicious ENV key found : MYSQL_PASSWD"
}
},
{
"ruleId": "DKL-DI-0005",
"level": "error",
"message": {
"text": "Use 'rm -rf /var/lib/apt/lists' after 'apt-get install' : /bin/sh -c apt-get update \u0026\u0026 apt-get install -y git"
}
},
{
"ruleId": "DKL-LI-0001",
"level": "error",
"message": {
"text": "No password user found! username : nopasswd"
}
},
{
"ruleId": "CIS-DI-0005",
"level": "note",
"message": {
"text": "export DOCKER_CONTENT_TRUST=1 before docker pull/build"
}
},
{
"ruleId": "CIS-DI-0008",
"level": "note",
"message": {
"text": "setuid file: urwxr-xr-x usr/bin/newgrp, setgid file: grwxr-xr-x usr/bin/ssh-agent, setgid file: grwxr-xr-x usr/bin/expiry, setuid file: urwxr-xr-x usr/lib/openssh/ssh-keysign, setuid file: urwxr-xr-x bin/umount, setgid file: grwxr-xr-x usr/bin/chage, setuid file: urwxr-xr-x usr/bin/passwd, setgid file: grwxr-xr-x sbin/unix_chkpwd, setuid file: urwxr-xr-x usr/bin/chsh, setgid file: grwxr-xr-x usr/bin/wall, setuid file: urwxr-xr-x bin/ping, setuid file: urwxr-xr-x bin/su, setuid file: urwxr-xr-x usr/bin/chfn, setuid file: urwxr-xr-x usr/bin/gpasswd, setuid file: urwxr-xr-x bin/mount"
}
},
{
"ruleId": "CIS-DI-0001",
"level": "none",
"message": {
"text": "Last user should not be root"
}
},
{
"ruleId": "CIS-DI-0006",
"level": "none",
"message": {
"text": "not found HEALTHCHECK statement"
}
}
]
}
]
}
默认情况下,即使存在一些问题,Dockle 也会以退出码 0 退出。
使用 --exit-code, -c 选项,如果发现 WARN 或 FATAL 警报,则以非零退出码退出。```bash
$ dockle --exit-code 1 [IMAGE_NAME]
### Specify exit level
默认情况下,当存在 `WARN` 或 `FATAL` 级别的警报时,`--exit-code` 会运行。
使用 `--exit-level, -l` 选项更改警报级别。可以设置为 `info`、`warn` 或 `fatal`。```bash
$ dockle --exit-code 1 --exit-level info [IMAGE_NAME]
$ dockle --exit-code 1 --exit-level fatal [IMAGE_NAME]
--ignore, -i 选项可以忽略指定的检查点。```bash
$ dockle -i CIS-DI-0001 -i DKL-DI-0006 [IMAGE_NAME]
或者,使用 `DOCKLE_IGNORES`:```
export DOCKLE_IGNORES=CIS-DI-0001,DKL-DI-0006
dockle [IMAGE_NAME]
或者,使用 .dockleignore 文件:```bash
$ cat .dockleignore
CIS-DI-0001
DKL-DI-0006
### 接受可疑的 `environment variables` / `files` / `file extensions````bash
# --accept-key value, --ak value You can add acceptable keywords.
dockle -ak GPG_KEY -ak KEYCLOAK_VERSION [IMAGE_NAME]
or DOCKLE_ACCEPT_KEYS=GPG_KEY,KEYCLOAK_VERSION dockle [IMAGE_NAME]
# --accept-file value, --af value You can add acceptable file names.
dockle -af id_rsa -af id_dsa [IMAGE_NAME]
or DOCKLE_ACCEPT_FILES=id_rsa,id_dsa dockle [IMAGE_NAME]
# --accept-file-extension value, --ae value You can add acceptable file extensions.
dockle -ae pem -ae log [IMAGE_NAME]
or DOCKLE_ACCEPT_FILE_EXTENSIONS=pem,log dockle [IMAGE_NAME]
environment variables / files / `file extensions````bashdockle -sw PRIVATE [IMAGE_NAME] or DOCKLE_ACCEPT_KEYS=GPG_KEY,KEYCLOAK_VERSION dockle [IMAGE_NAME]
dockle -sf .env [IMAGE_NAME] or DOCKLE_REJECT_FILES=.env dockle [IMAGE_NAME]
dockle -se pfx [IMAGE_NAME] or DOCKLE_REJECT_FILE_EXTENSIONS=pfx dockle [IMAGE_NAME]
## 持续集成 (CI)
你可以在 Travis CI/CircleCI 中使用 `Dockle` 扫描构建的镜像。
在这些示例中,如果发现任何警告,测试将会失败。
不过,你可以通过使用 `.dockleignore` 文件忽略指定的检查点。
或者,如果你只想显示结果而不让测试因此失败,可以在 `dockle` 命令中指定 `--exit-code` 为 `0`。
### GitHub Action
我们提供了 [goodwithtech/dockle-action](https://github.com/goodwithtech/dockle-action)。```yaml
- uses: goodwithtech/dockle-action@main
with:
image: 'target'
format: 'list'
exit-code: '1'
exit-level: 'warn'
ignore: 'CIS-DI-0001,DKL-DI-0006'
env: global: - COMMIT=${TRAVIS_COMMIT::8}
before_install:
</details>
- 示例: https://travis-ci.org/goodwithtech/dockle-ci-test
- 仓库: https://github.com/goodwithtech/dockle-ci-test
### CircleCI
<details>
<summary>.circleci/config.yml</summary>```yaml
jobs:
build:
docker:
- image: docker:18.09-git
steps:
- checkout
- setup_remote_docker
- run:
name: Build image
command: docker build -t dockle-ci-test:${CIRCLE_SHA1} .
- run:
name: Install dockle
command: |
apk add --update curl
VERSION=$(
curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" | \
grep '"tag_name":' | \
sed -E 's/.*"v([^"]+)".*/\1/'
)
wget https://github.com/goodwithtech/dockle/releases/download/v${VERSION}/dockle_${VERSION}_Linux-64bit.tar.gz
tar zxvf dockle_${VERSION}_Linux-64bit.tar.gz
mv dockle /usr/local/bin
- run:
name: Scan the local image with dockle
command: dockle --exit-code 1 dockle-ci-test:${CIRCLE_SHA1}
workflows:
version: 2
release:
jobs:
- build
variables: DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 services:
unit_test:
stage: test
before_script:
- apk -Uuv add bash git curl tar sed grep
script:
- docker build -t dockle-ci-test:${CI_COMMIT_SHORT_SHA} .
- |
VERSION=$(
curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" |
grep '"tag_name":' |
sed -E 's/."v([^"]+)"./\1/'
) && curl -L -o dockle.tar.gz https://github.com/goodwithtech/dockle/releases/download/v${VERSION}/dockle_${VERSION}_Linux-64bit.tar.gz &&
tar zxvf dockle.tar.gz
- ./dockle --exit-code 1 dockle-ci-test:${CI_COMMIT_SHORT_SHA}
</details>
- 示例:https://gitlab.com/tomoyamachi/dockle-ci-test/-/jobs/238215077
- 仓库:https://github.com/goodwithtech/dockle-ci-test
## 私有 Docker 仓库的认证
`Dockle` 可以下载来自私有仓库的镜像,无需安装 `Docker` 或任何其他第三方工具。其设计目的是为了在 CI 流程中易于使用。
您只需执行:安装 `Dockle` 并设置环境变量。
- 注意:我不建议在本地机器上使用环境变量。
### Docker Hub
要从 Docker Hub 下载私有仓库,您需要设置 `DOCKLE_AUTH_URL`、`DOCKLE_USERNAME` 和 `DOCKLE_PASSWORD` 环境变量。```bash
export DOCKLE_AUTH_URL=https://registry.hub.docker.com
export DOCKLE_USERNAME={DOCKERHUB_USERNAME}
export DOCKLE_PASSWORD={DOCKERHUB_PASSWORD}
Dockle 使用 AWS SDK。你无需安装 aws CLI 工具。
请使用 。```bash export AWS_ACCESS_KEY_ID={AWS ACCESS KEY} export AWS_SECRET_ACCESS_KEY={SECRET KEY} export AWS_DEFAULT_REGION={AWS REGION}
| CODE | 描述 | LEVEL※ |
|---|---|---|
| CIS 的 Docker 镜像检查点 | ||
| CIS-DI-0001 | 为容器创建一个用户 | WARN |
| CIS-DI-0002 | 使用受信任的基础镜像 | FATAL |
| CIS-DI-0003 | 不要在容器中安装不必要的包 | FATAL |
| CIS-DI-0004 | 扫描并重建镜像以包含安全补丁 | FATAL |
| CIS-DI-0005 | 为 Docker 启用内容信任 | INFO |
| CIS-DI-0006 | 在容器镜像中添加 HEALTHCHECK 指令 | INFO |
| CIS-DI-0007 | 不要在 Dockerfile 中单独使用 update 指令 | FATAL |
| CIS-DI-0008 | 确认 setuid 和 setgid 文件的安全性 | INFO |
| CIS-DI-0009 | 在 Dockerfile 中使用 COPY 而不是 ADD | FATAL |
| CIS-DI-0010 | 不要在 Dockerfile 中存储机密 | FATAL |
| CIS-DI-0011 |
Dockle 有 5 个检查级别。
| 级别 | 描述 |
|---|---|
| FATAL | 需实际且谨慎 |
| WARN | 需实际且谨慎,但用途受限(即使是官方镜像) |
| INFO | 可能会负面影响实用性或性能 |
| SKIP | 未找到目标文件 |
| PASS | 未发现任何问题 |
只需指定镜像名称(和标签)。```bash $ dockle goodwithtech/test-image:v1
<details>
<summary>结果</summary>```
FATAL - CIS-DI-0001: Create a user for the container
* Last user should not be root
WARN - CIS-DI-0005: Enable Content trust for Docker
* export DOCKER_CONTENT_TRUST=1 before docker pull/build
FATAL - CIS-DI-0006: Add HEALTHCHECK instruction to the container image
* not found HEALTHCHECK statement
FATAL - CIS-DI-0007: Do not use update instructions alone in the Dockerfile
* Use 'Always combine RUN 'apt-get update' with 'apt-get install' : /bin/sh -c apt-get update && apt-get install -y git
FATAL - CIS-DI-0008: Remove setuid and setgid permissions in the images
* Found setuid file: etc/passwd grw-r--r--
* Found setuid file: usr/lib/openssh/ssh-keysign urwxr-xr-x
* Found setuid file: app/hoge.txt ugrw-r--r--
* Found setuid file: app/hoge.txt ugrw-r--r--
* Found setuid file: etc/shadow urw-r-----
FATAL - CIS-DI-0009: Use COPY instead of ADD in Dockerfile
* Use COPY : /bin/sh -c #(nop) ADD file:81c0a803075715d1a6b4f75a29f8a01b21cc170cfc1bff6702317d1be2fe71a3 in /app/credentials.json
FATAL - CIS-DI-0010: Do not store secrets in ENVIRONMENT variables
* Suspicious ENV key found : MYSQL_PASSWD
FATAL - CIS-DI-0010: Do not store secret files
* Suspicious filename found : app/credentials.json
PASS - DKL-DI-0001: Avoid sudo command
FATAL - DKL-DI-0002: Avoid sensitive directory mounting
* Avoid mounting sensitive dirs : /usr
PASS - DKL-DI-0003: Avoid apt-get/apk/dist-upgrade
PASS - DKL-DI-0004: Use apk add with --no-cache
FATAL - DKL-DI-0005: Clear apt-get caches
* Use 'apt-get clean && rm -rf /var/lib/apt/lists/*' : /bin/sh -c apt-get update && apt-get install -y git
PASS - DKL-DI-0006: Avoid latest tag
FATAL - DKL-LI-0001: Avoid empty password
* No password user found! username : nopasswd
PASS - DKL-LI-0002: Be unique UID
PASS - DKL-LI-0002: Be unique GROUP
### GCR (Google Container Registry)
`Dockle` 使用 Google Cloud SDK。因此,您无需安装 `gcloud` 命令。
如果您想使用目标项目的仓库,可以通过 `GOOGLE_APPLICATION_CREDENTIAL` 进行设置。```bash
# must set DOCKLE_USERNAME empty char
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credential.json
BasicAuth服务器需要 DOCKLE_USERNAME 和 DOCKLE_PASSWORD。```bash
export DOCKLE_USERNAME={USERNAME}
export DOCKLE_PASSWORD={PASSWORD}
export DOCKLE_NON_SSL=true
## 贡献者
### 代码贡献者
这个项目感谢所有贡献者。[[贡献](https://github.com/goodwithtech/dockle/blob/master/CONTRIBUTING.md)]。
<a href="https://github.com/goodwithtech/dockle/graphs/contributors"><img src="https://opencollective.com/dockle/contributors.svg?width=890&button=false" /></a>
### 财务贡献者
成为财务贡献者,帮助我们维持社区发展。[[贡献](https://opencollective.com/dockle/contribute)]
#### 个人
<a href="https://opencollective.com/dockle"><img src="https://opencollective.com/dockle/individuals.svg?width=890"></a>
#### 组织
用您的组织支持这个项目。您的Logo将显示在这里,并附带您的网站链接。[[贡献](https://opencollective.com/dockle/contribute)]
<a href="https://www.tines.com/?utm_source=oss&utm_medium=sponsorship&utm_campaign=dockle"><img src="https://assets.kitploit.com/production/public/readmes/4137/e063c5948228b346da42565b27ee62f2dd85648c0de86a2b184c7f111319d275.png"></a>
<a href="https://opencollective.com/dockle/organization/1/website"><img src="https://opencollective.com/dockle/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/dockle/organization/2/website"><img src="https://opencollective.com/dockle/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/dockle/organization/3/website"><img src="https://opencollective.com/dockle/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/dockle/organization/4/website"><img src="https://opencollective.com/dockle/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/dockle/organization/5/website"><img src="https://opencollective.com/dockle/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/dockle/organization/6/website"><img src="https://opencollective.com/dockle/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/dockle/organization/7/website"><img src="https://opencollective.com/dockle/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/dockle/organization/8/website"><img src="https://opencollective.com/dockle/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/dockle/organization/9/website"><img src="https://opencollective.com/dockle/organization/9/avatar.svg"></a>
### 开源项目支持者
本项目使用了以下开源项目提供的服务。
<a href="https://flatt.tech/oss/gmo/trampoline" target="_blank"><img src="https://flatt.tech/assets/images/badges/gmo-oss.svg" height="24px"/></a>
<a href="https://github.com/1Password/for-open-source" target="_blank"><img src="https://img.shields.io/badge/1Password-OSS%20Program-0094F5?logo=1password&logoColor=white" height="24px"/></a>
# 许可证
- Apache许可证 2.0
# 作者
[@tomoyamachi](https://github.com/tomoyamachi) (Tomoya Amachi)
特别感谢 [@knqyf263](https://github.com/knqyf263) (Teppei Fukuda) 和 [Trivy](https://github.com/knqyf263/trivy)
| 仅安装已验证的包 |
| INFO |
| Dockle 针对 Docker 的检查点 |
| DKL-DI-0001 | 避免使用 sudo 命令 | FATAL |
| DKL-DI-0002 | 避免挂载敏感目录 | FATAL |
| DKL-DI-0003 | 避免使用 apt-get dist-upgrade | WARN |
| DKL-DI-0004 | 使用 apk add 搭配 --no-cache | FATAL |
| DKL-DI-0005 | 清除 apt-get 缓存 | FATAL |
| DKL-DI-0006 | 避免使用 latest 标签 | WARN |
| Dockle 针对 Linux 的检查点 |
| DKL-LI-0001 | 避免空密码 | FATAL |
| DKL-LI-0002 | 确保 UID/GROUP 唯一 | FATAL |
| DKL-LI-0003 | 仅放置必要的文件 | INFO |