
Container-Image-Linter für Sicherheit, hilft beim Erstellen des Docker-Images nach Best Practices, einfach zu starten
Dockle - Container-Image-Linter für Sicherheit, Hilft beim Erstellen von Best-Practice-Docker-Images, einfacher Einstieg
Dockle hilft Ihnen:
Siehe [Installation](#installation) und [Häufige Beispiele](#common-examples)
<img src="https://assets.kitploit.com/production/public/readmes/4137/343598bd4d53296c6d6d23acde8c2917d5727f03e7b3a34c1ff0865c435bb974.png" width="800">
# Vergleich der Prüfpunkte
<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">
# Inhaltsverzeichnis
- [Funktionen](#features)
- [Vergleich](#comparison)
- [Installation](#installation)
- [Homebrew (Mac OS X / Linux und 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)
- [Binärdatei](#binary)
- [asdf](#asdf)
- [mise](#mise)
- [Aus dem Quellcode](#from-source)
- [Docker verwenden](#use-docker)
- [Schnellstart](#quick-start)
- [Grundlagen](#basic)
- [Docker](#docker)
- [Zusammenfassung der Prüfpunkte](#checkpoint-summary)
- [Häufige Beispiele](#common-examples)
- [Ein Image scannen](#scan-an-image)
- [Eine Imagedatei scannen](#scan-an-image-file)
- [Ergebnisse als JSON abrufen oder speichern](#get-or-save-the-results-as-json)
- [Ergebnisse als SARIF abrufen oder speichern](#get-or-save-the-results-as-sarif)
- [Exit-Code festlegen](#specify-exit-code)
- [Exit-Level festlegen](#specify-exit-level)
- [Bestimmte Prüfpunkte ignorieren](#ignore-the-specified-checkpoints)
- [Verdächtige `Umgebungsvariablen` / `Dateien` / `Dateierweiterungen` akzeptieren](#accept-suspicious-environment-variables--files--file-extensions)
- [Verdächtige `Umgebungsvariablen` / `Dateien` / `Dateierweiterungen` ablehnen](#reject-suspicious-environment-variables--files--file-extensions)
- [Kontinuierliche Integration](#continuous-integration-ci)
- [GitHub Action](#github-action)
- [Travis CI](#travis-ci)
- [CircleCI](#circleci)
- [GitLab CI](#gitlab-ci)
- [Autorisierung für private Docker-Registry](#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)
- [Selbst gehostete Registry (BasicAuth)](#self-hosted-registry-basicauth)
- [Mitwirkende](#contributors)
- [Code-Mitwirkende](#code-contributors)
- [Finanzielle Unterstützer](#financial-contributors)
- [Einzelpersonen](#individuals)
- [Organisationen](#organizations)
- [Lizenz](#license)
- [Autor](#author)
# Funktionen
- Container-Schwachstellen erkennen
- Hilft beim Erstellen von Best-Practice-Dockerfiles
- Einfache Verwendung
- Nur den Image-Namen angeben
- Siehe [Schnellstart](#quick-start) und [Häufige Beispiele](#common-examples)
- CIS-Benchmarks-Unterstützung
- Hohe Genauigkeit
- DevSecOps
- Geeignet für CI wie Travis CI, CircleCI, Jenkins usw.
- Siehe [CI-Beispiel](#continuous-integration-ci)
# Vergleich
| | [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) |
|--- |---:|---:|---:|---:|
| Ziel | Image | Dockerfile | Host<br/>Docker-Daemon<br/>Image<br/>Container-Laufzeit | Image |
| Ausführung | Binärdatei | Binärdatei | Shell-Skript | Binärdatei |
| Abhängigkeiten | Nein | Nein | Einige Abhängigkeiten | Nein |
| CI-geeignet | ✓ | ✓ | x | x |
| Zweck | Sicherheitsaudit<br/>Dockerfile-Lint | Dockerfile-Lint | Sicherheitsaudit<br/>Dockerfile-Lint | Schwachstellen scannen |
# Installation
## Homebrew (Mac OS X / Linux und WSL)
Sie können Homebrew unter [Mac OS X](https://brew.sh/) oder [Linux und WSL (Windows-Subsystem für Linux)](https://docs.brew.sh/Homebrew-on-Linux) verwenden.```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
dockle kann aus dem Arch User Repository mit dem Paket dockle oder dockle-bin installiert werden.```
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 }
## Binärdatei
Sie können die neueste Binärversion von der [Releases-Seite](https://github.com/goodwithtech/dockle/releases/latest) herunterladen.
Laden Sie die Archivdatei für Ihr Betriebssystem/Ihre Architektur herunter. Entpacken Sie das Archiv und legen Sie die Binärdatei in Ihrem `$PATH` ab (auf UNIX-ähnlichen Systemen `/usr/local/bin` oder ähnlich).
- HINWEIS: Stellen Sie sicher, dass die Ausführungsbits gesetzt sind. (`chmod +x dockle`)
## asdf
Sie können dockle mit dem [asdf-Versionmanager](https://asdf-vm.com/) und diesem [Plugin](https://github.com/mathew-fleisch/asdf-dockle) installieren, das den Installationsprozess (und das Wechseln zwischen) verschiedener Versionen von GitHub-Release-Binärdateien automatisiert. Wenn asdf bereits installiert ist, führen Sie diese Befehle aus, um dockle zu installieren:```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
Sie können dockle mit mise installieren, dem polyglotten Tool-Versionsmanager. Wenn mise bereits installiert ist, führen Sie diese Befehle aus, um dockle zu installieren:```bash
mise ls-remote dockle
mise install dockle@latest
mise use -g dockle@latest
dockle --version
## Aus dem Quellcode```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
Es gibt auch ein Dockle-Image auf Docker Hub. Sie können dockle ausprobieren, bevor Sie den Befehl installieren.```
$ 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]
Sie benötigen `-v /var/run/docker.sock:/var/run/docker.sock` nur, wenn Sie das Image auf Ihrem Hostrechner scannen möchten.
# Schnellstart
## Einfach
Geben Sie einfach einen Image-Namen (und einen Tag) an.```bash
$ dockle [YOUR_IMAGE_NAME]
</details>
## Docker
Außerdem können Sie Docker verwenden, um den Befehl `dockle` wie folgt auszuführen.```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]
Wenn Sie das Image auf Ihrem Host-Rechner scannen möchten, müssen Sie docker.sock mounten.
$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ...
| LEVEL | DESCRIPTION |
|---|---|
| FATAL | Praktisch und umsichtig sein |
Einfach einen Image-Namen (und einen Tag) angeben.```bash $ dockle goodwithtech/test-image:v1
<details>
<summary>Ergebnis</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
$ docker save alpine:latest -o alpine.tar $ dockle --input alpine.tar
### Ergebnisse als JSON abrufen oder speichern```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>Ergebnis</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"
}
}
]
}
]
}
Standardmäßig beendet sich Dockle mit dem Code 0, selbst wenn es Probleme gibt.
Verwenden Sie die Option --exit-code, -c, um mit einem Exit-Code ungleich Null zu beenden, falls eine WARN- oder FATAL-Warnung gefunden wurde.```bash
$ dockle --exit-code 1 [IMAGE_NAME]
### Specify exit level
Standardmäßig wird `--exit-code` ausgeführt, wenn Warnungen (`WARN`) oder schwerwiegende (`FATAL`) Alarme vorliegen.
Verwenden Sie die Option `--exit-level, -l`, um den Alarmlevel zu ändern. Sie können `info`, `warn` oder `fatal` festlegen.```bash
$ dockle --exit-code 1 --exit-level info [IMAGE_NAME]
$ dockle --exit-code 1 --exit-level fatal [IMAGE_NAME]
Die Option --ignore, -i kann angegebene Checkpoints ignorieren.```bash
$ dockle -i CIS-DI-0001 -i DKL-DI-0006 [IMAGE_NAME]
Oder, verwenden Sie `DOCKLE_IGNORES`:```
export DOCKLE_IGNORES=CIS-DI-0001,DKL-DI-0006
dockle [IMAGE_NAME]
Oder, verwende die .dockleignore-Datei:```bash
$ cat .dockleignore
CIS-DI-0001
DKL-DI-0006
### Akzeptiere verdächtige `Umgebungsvariablen` / `Dateien` / `Dateierweiterungen````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 ablehnen```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]
## Continuous Integration (CI)
Sie können Ihr erstelltes Image mit `Dockle` in Travis CI/CircleCI scannen.
In diesen Beispielen wird der Test fehlschlagen, wenn Warnungen gefunden werden.
Sie können jedoch die angegebenen Ziel-Prüfpunkte mit der `.dockleignore`-Datei ignorieren.
Oder, wenn Sie nur die Ergebnisse anzeigen möchten und den Test nicht fehlschlagen lassen möchten, geben Sie `--exit-code` auf `0` im `dockle`-Befehl an.
### GitHub Action
Wir bieten [goodwithtech/dockle-action](https://github.com/goodwithtech/dockle-action) an.```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>
- Beispiel: https://travis-ci.org/goodwithtech/dockle-ci-test
- Repository: 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>
- Beispiel: https://gitlab.com/tomoyamachi/dockle-ci-test/-/jobs/238215077
- Repository: https://github.com/goodwithtech/dockle-ci-test
## Autorisierung für private Docker-Registrierung
`Dockle` kann Images aus einer privaten Registrierung herunterladen, ohne `Docker` oder andere Drittanbieter-Tools zu installieren. Es ist so konzipiert, dass es in einem CI-Prozess einfach zu verwenden ist.
Alles, was Sie tun müssen, ist: `Dockle` installieren und Umgebungsvariablen setzen.
- HINWEIS: Ich empfehle nicht, ENV-Variablen auf Ihrem lokalen Rechner zu verwenden.
### Docker Hub
Um das private Repository von Docker Hub herunterzuladen, müssen Sie die ENV-Variablen `DOCKLE_AUTH_URL`, `DOCKLE_USERNAME` und `DOCKLE_PASSWORD` setzen.```bash
export DOCKLE_AUTH_URL=https://registry.hub.docker.com
export DOCKLE_USERNAME={DOCKERHUB_USERNAME}
export DOCKLE_PASSWORD={DOCKERHUB_PASSWORD}
Dockle verwendet das AWS SDK. Sie müssen das aws CLI-Tool nicht installieren.
Verwenden Sie die Umgebungsvariablen der AWS CLI.```bash export AWS_ACCESS_KEY_ID={AWS ACCESS KEY} export AWS_SECRET_ACCESS_KEY={SECRET KEY} export AWS_DEFAULT_REGION={AWS REGION}
### GCR (Google Container Registry)
`Dockle` verwendet das Google Cloud SDK. Daher müssen Sie den Befehl `gcloud` nicht installieren.
Wenn Sie das Repository des Zielprojekts verwenden möchten, können Sie es über `GOOGLE_APPLICATION_CREDENTIAL` einrichten.```bash
# must set DOCKLE_USERNAME empty char
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credential.json
BasicAuth-Server benötigt DOCKLE_USERNAME und DOCKLE_PASSWORD.```bash
export DOCKLE_USERNAME={USERNAME}
export DOCKLE_PASSWORD={PASSWORD}
export DOCKLE_NON_SSL=true
## Mitwirkende
### Code-Mitwirkende
Dieses Projekt existiert dank aller Menschen, die beitragen. [[Beitragen](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>
### Finanzielle Mitwirkende
Werde ein finanzieller Mitwirkender und hilf uns, unsere Gemeinschaft zu erhalten. [[Beitragen](https://opencollective.com/dockle/contribute)]
#### Einzelpersonen
<a href="https://opencollective.com/dockle"><img src="https://opencollective.com/dockle/individuals.svg?width=890"></a>
#### Organisationen
Unterstütze dieses Projekt mit deiner Organisation. Dein Logo wird hier mit einem Link zu deiner Website angezeigt. [[Beitragen](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>
### Unterstützer von OSS-Programmen
Dieses Projekt nutzt Dienste, die durch die folgenden OSS-Programme bereitgestellt werden.
<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>
# Lizenz
- Apache License 2.0
# Autor
[@tomoyamachi](https://github.com/tomoyamachi) (Tomoya Amachi)
Besonderer Dank an [@knqyf263](https://github.com/knqyf263) (Teppei Fukuda) und [Trivy](https://github.com/knqyf263/trivy)
| CODE | BESCHREIBUNG | EBENE※ |
|---|
| CIS's Docker Image Checkpoints | ||
| CIS-DI-0001 | Einen Benutzer für den Container erstellen | WARN |
| CIS-DI-0002 | Vertrauenswürdige Basis-Images für Container verwenden | FATAL |
| CIS-DI-0003 | Keine unnötigen Pakete im Container installieren | FATAL |
| CIS-DI-0004 | Images scannen und neu erstellen, um Sicherheitsupdates einzubeziehen | FATAL |
| CIS-DI-0005 | Content Trust für Docker aktivieren | INFO |
| CIS-DI-0006 | HEALTHCHECK-Anweisung zum Container-Image hinzufügen | INFO |
| CIS-DI-0007 | update-Anweisungen nicht allein in der Dockerfile verwenden | FATAL |
| CIS-DI-0008 | Sicherheit von setuid- und setgid-Dateien bestätigen | INFO |
| CIS-DI-0009 | COPY anstelle von ADD in der Dockerfile verwenden | FATAL |
| CIS-DI-0010 | Keine Geheimnisse in Dockerfiles speichern | FATAL |
| CIS-DI-0011 | Nur verifizierte Pakete installieren | INFO |
| Dockle Checkpoints für Docker | ||
| DKL-DI-0001 | sudo-Befehl vermeiden | FATAL |
| DKL-DI-0002 | Sensitives Verzeichnis-Mounting vermeiden | FATAL |
| DKL-DI-0003 | apt-get dist-upgrade vermeiden | WARN |
| DKL-DI-0004 | apk add mit --no-cache verwenden | FATAL |
| DKL-DI-0005 | apt-get-Cache leeren | FATAL |
| DKL-DI-0006 | latest-Tag vermeiden | WARN |
| Dockle Checkpoints für Linux | ||
| DKL-LI-0001 | Leeres Passwort vermeiden | FATAL |
| DKL-LI-0002 | Einzigartige UIDs/Gruppen sicherstellen | FATAL |
| DKL-LI-0003 | Nur notwendige Dateien ablegen | INFO |
| WARN | Praktisch und umsichtig sein, aber eingeschränkte Verwendung (selbst bei offiziellen Images) |
| INFO | Kann Nutzen oder Leistung negativ beeinträchtigen |
| SKIP | Zieldateien nicht gefunden |
| PASS | Keine Probleme gefunden |