Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve compose file #534

Merged
merged 8 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/22.4/container/admin-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generated password, the following command can be used:
---
caption: Updating password of administrator user
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
y0urself marked this conversation as resolved.
Show resolved Hide resolved
exec -u gvmd gvmd gvmd --user=admin --new-password='<password>'
```

Expand Down
2 changes: 1 addition & 1 deletion src/22.4/container/docker-compose.yml
8 changes: 7 additions & 1 deletion src/22.4/container/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

## Docker Compose File

```{important}
Please always ensure to use the latest version of the `docker-compose.yml` file
when following this guide. The file might got updates and important changes
since your last download.
```

To run the Greenbone Community Edition with containers, the following compose
file should be used:

Expand All @@ -33,7 +39,7 @@ it can be downloaded with the following command directly:
---
caption: Downloading docker-compose file
---
cd $DOWNLOAD_DIR && curl -f -L https://greenbone.github.io/docs/latest/_static/docker-compose-22.4.yml -o docker-compose.yml
curl -f -O -L https://greenbone.github.io/docs/latest/_static/docker-compose.yml --output-dir "$DOWNLOAD_DIR"
```

### Description
Expand Down
13 changes: 7 additions & 6 deletions src/22.4/container/manual-feed-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ caption: Extending the docker compose file for performing a manual feed sync usi
---
...
greenbone-feed-sync:
image: greenbone/greenbone-feed-sync
image: registry.community.greenbone.net/community/greenbone-feed-sync
volumes:
- vt_data_vol:/var/lib/openvas/plugins
- notus_data_vol:/var/lib/notus
Expand All @@ -41,7 +41,7 @@ during a vulnerability scan.
caption: Downloading {term}`NASL<NASL>` {term}`VTs<VT>` processed by the
ospd-openvas scanner, this will take a while.
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
run --rm greenbone-feed-sync greenbone-feed-sync --type nasl
```

Expand All @@ -50,9 +50,10 @@ docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-editio
caption: Downloading `notus` {term}`VTs<VT>` processed for local security checks,
this will take a while.
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
run --rm greenbone-feed-sync greenbone-feed-sync --type notus
```

### Syncing SCAP, CERT and GVMD Data

{term}`SCAP` data contains {term}`CPE` and {term}`CVE` information.
Expand All @@ -61,7 +62,7 @@ docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-editio
---
caption: Downloading SCAP data processed by gvmd, this will take a while
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
run --rm greenbone-feed-sync greenbone-feed-sync --type scap
```

Expand All @@ -72,7 +73,7 @@ and [CERT-Bund](https://cert-bund.de/) agencies.
---
caption: Downloading CERT data processed by gvmd
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
run --rm greenbone-feed-sync greenbone-feed-sync --type cert
```

Expand All @@ -83,6 +84,6 @@ policies, port lists and report formats.
---
caption: Downloading data objects processed by gvmd
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
run --rm greenbone-feed-sync greenbone-feed-sync --type gvmd-data
```
2 changes: 1 addition & 1 deletion src/22.4/container/preamble.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ intended for production setups.
Currently the docs support the following distributions

* **Debian stable** [(bookworm)](https://www.debian.org/releases/stable)
* **Ubuntu 22.04 LTS**
* **Ubuntu 24.04 LTS**
* **Fedora 35 and 36**
* **CentOS 9 Stream**

Expand Down
7 changes: 3 additions & 4 deletions src/22.4/container/starting.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ and the containers can be started in the background.
---
caption: Downloading the Greenbone Community Containers
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition pull
docker compose -f $DOWNLOAD_DIR/docker-compose.yml pull
```

```{code-block} shell
---
caption: Starting the Greenbone Community Containers
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition up -d
docker compose -f $DOWNLOAD_DIR/docker-compose.yml up -d
```

To get a continuous stream of the log output of all services, run the following
Expand All @@ -24,8 +24,7 @@ command:
---
caption: Show log messages of all services from the running containers
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition logs -f
docker compose -f $DOWNLOAD_DIR/docker-compose.yml logs -f
```

The log stream can be stopped by pressing {kbd}`Ctrl-C`.

30 changes: 11 additions & 19 deletions src/22.4/container/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ command. For displaying the complete log output you can run
---
caption: Display all logs
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
logs
docker compose -f $DOWNLOAD_DIR/docker-compose.yml logs
```

To follow the current log output to display log messages as they occur use the
Expand All @@ -26,8 +25,7 @@ following command
---
caption: Follow current log output
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
logs -f
docker compose -f $DOWNLOAD_DIR/docker-compose.yml logs -f
```

It's also possible to just display the logs of a specific container by using
Expand All @@ -38,8 +36,7 @@ within the docker compose file](./index.md#description).
---
caption: Follow the log messages of the gvmd container only
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
logs -f gvmd
docker compose -f $DOWNLOAD_DIR/docker-compose.yml logs -f gvmd
```

Additionally it is possible to bypass the `docker compose log` command and
Expand All @@ -50,7 +47,7 @@ the content of the OpenVAS scanner log file via {command}`cat`
---
caption: Print messages from /var/log/gvm/openvas.log
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
exec ospd-openvas cat /var/log/gvm/openvas.log
```

Expand All @@ -70,8 +67,7 @@ scanner.
---
caption: Restart the scanner to ensure that new {term}`VTs<VT>` are loaded
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
restart ospd-openvas
docker compose -f $DOWNLOAD_DIR/docker-compose.yml restart ospd-openvas
```

### Port list, scan configurations, report formats are up-to-date but not visible on the web interface
Expand All @@ -82,7 +78,7 @@ If port lists, scan configurations, or report formats are missing on the web int
---
caption: Forcing reload of report formats, scan configs and port lists
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
exec -u gvmd gvmd gvmd --rebuild-gvmd-data=all
```

Expand All @@ -109,8 +105,7 @@ restart the corresponding container with:
---
caption: Restarting the ospd-openvas scanner
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
restart ospd-openvas
docker compose -f $DOWNLOAD_DIR/docker-compose.yml restart ospd-openvas
```

If you still get errors, you need to take a look at the `ospd-openvas` logs.
Expand All @@ -119,8 +114,7 @@ If you still get errors, you need to take a look at the `ospd-openvas` logs.
---
caption: Showing log message of the ospd-openvas scanner
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
log -f ospd-openvas
docker compose -f $DOWNLOAD_DIR/docker-compose.yml log -f ospd-openvas
```

### Cannot log in to the web interface: *Greenbone Vulnerability Manager service is not responding*
Expand All @@ -144,8 +138,7 @@ had some issues accessing the PostgreSQL database.
---
caption: Restarting {term}`gvmd`
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
restart gvmd
docker compose -f $DOWNLOAD_DIR/docker-compose.yml restart gvmd
```

### Redis server keeps restarting `rm: cannot remove ‘/run/redis/redis.sock’: Permission denied`
Expand All @@ -160,9 +153,8 @@ The volume can be removed safely because it gets recreated on the next startup.
---
caption: Recreating the Redis server socket volume
---
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
docker compose -f $DOWNLOAD_DIR/docker-compose.yml \
rm -s -f redis-server ospd-openvas
docker volume rm greenbone-community-edition_redis_socket_vol
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition \
up -d
docker compose -f $DOWNLOAD_DIR/docker-compose.yml up -d
```
Loading
Loading