From 149ee5960eead764bf1defc5b3a36c821b771062 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 05:14:25 +0000 Subject: [PATCH 1/7] Bump greenbone/actions from 2 to 3 Bumps [greenbone/actions](https://github.com/greenbone/actions) from 2 to 3. - [Release notes](https://github.com/greenbone/actions/releases) - [Commits](https://github.com/greenbone/actions/compare/v2...v3) --- updated-dependencies: - dependency-name: greenbone/actions dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build-container.yml | 2 +- .github/workflows/build-docs.yml | 2 +- .github/workflows/container.yml | 2 +- .github/workflows/conventional-commits.yml | 2 +- .github/workflows/dependency-review.yml | 2 +- .github/workflows/release-pontos.yml | 4 ++-- .github/workflows/sbom-upload.yml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index ebdd9e29d..60e034a0a 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - uses: greenbone/actions/is-latest-tag@v2 + - uses: greenbone/actions/is-latest-tag@v3 id: latest - name: Setup container meta information id: meta diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 606e4ed44..c92599d83 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -11,7 +11,7 @@ jobs: container: greenbone/doxygen steps: - name: Run the c lang coverage action - uses: greenbone/actions/doc-coverage-clang@v2 + uses: greenbone/actions/doc-coverage-clang@v3 build-gmp-doc: name: Build GMP documentation diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 3c0ab749a..861c91665 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - uses: greenbone/actions/is-latest-tag@v2 + - uses: greenbone/actions/is-latest-tag@v3 id: latest - name: Setup container meta information id: meta diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml index a929906e4..5d0bb41e4 100644 --- a/.github/workflows/conventional-commits.yml +++ b/.github/workflows/conventional-commits.yml @@ -13,4 +13,4 @@ jobs: runs-on: ubuntu-latest steps: - name: Report Conventional Commits - uses: greenbone/actions/conventional-commits@v2 + uses: greenbone/actions/conventional-commits@v3 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index bbc5a50d9..36afcc325 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -9,4 +9,4 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Dependency Review' - uses: greenbone/actions/dependency-review@v2 + uses: greenbone/actions/dependency-review@v3 diff --git a/.github/workflows/release-pontos.yml b/.github/workflows/release-pontos.yml index 00a2ca726..18aab9fd4 100644 --- a/.github/workflows/release-pontos.yml +++ b/.github/workflows/release-pontos.yml @@ -36,11 +36,11 @@ jobs: steps: - name: Selecting the Release type id: release-type - uses: greenbone/actions/release-type@v2 + uses: greenbone/actions/release-type@v3 with: release-type-input: ${{ inputs.release-type }} - name: Release with release action - uses: greenbone/actions/release@v2 + uses: greenbone/actions/release@v3 with: github-user: ${{ secrets.GREENBONE_BOT }} github-user-mail: ${{ secrets.GREENBONE_BOT_MAIL }} diff --git a/.github/workflows/sbom-upload.yml b/.github/workflows/sbom-upload.yml index 28289bdfe..fefdfeafe 100644 --- a/.github/workflows/sbom-upload.yml +++ b/.github/workflows/sbom-upload.yml @@ -11,4 +11,4 @@ jobs: contents: write steps: - name: 'SBOM upload' - uses: greenbone/actions/sbom-upload@v2 + uses: greenbone/actions/sbom-upload@v3 From e0b092d36fca11ab98a427582e195982e7ec7421 Mon Sep 17 00:00:00 2001 From: Castor Sky Date: Sun, 16 Jul 2023 17:21:41 +0300 Subject: [PATCH 2/7] Add: Mail transport agent to enable email notifications in docker This adds the `msmtp` and `msmtp-mta` packages to achieve ability of sending email notifications from docker container. Default `gvmd` image has no MTA but tries to send emails via local mailer (and always fails for sure). With msmtp user can send emails to a single preferred SMTP server. --- .docker/entrypoint.sh | 1 + .docker/prod.Dockerfile | 3 +++ .docker/setup-mta.sh | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 .docker/setup-mta.sh diff --git a/.docker/entrypoint.sh b/.docker/entrypoint.sh index 4063de001..d3506c405 100644 --- a/.docker/entrypoint.sh +++ b/.docker/entrypoint.sh @@ -18,4 +18,5 @@ #!/bin/bash +. setup-mta exec gosu gvmd "$@" diff --git a/.docker/prod.Dockerfile b/.docker/prod.Dockerfile index 375062b76..212ecde50 100644 --- a/.docker/prod.Dockerfile +++ b/.docker/prod.Dockerfile @@ -84,6 +84,8 @@ RUN apt-get update && \ libgpgme11 \ libical3 \ libpq5 \ + msmtp \ + msmtp-mta \ openssh-client \ postgresql-client-13 \ postgresql-client-common \ @@ -107,6 +109,7 @@ COPY --from=builder /install/ / COPY .docker/start-gvmd.sh /usr/local/bin/start-gvmd COPY .docker/entrypoint.sh /usr/local/bin/entrypoint +COPY .docker/setup-mta.sh /usr/local/bin/setup-mta RUN addgroup --gid 1001 --system gvmd && \ adduser --no-create-home --shell /bin/false --disabled-password --uid 1001 --system --group gvmd diff --git a/.docker/setup-mta.sh b/.docker/setup-mta.sh new file mode 100644 index 000000000..9b4c4da43 --- /dev/null +++ b/.docker/setup-mta.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Make any changes only when MTA_HOST has been set +if [ -n MTA_HOST ]; then + echo "setting up configuration file for mail agent" + CONFIG="/etc/msmtprc" + echo "host $MTA_HOST" > $CONFIG + [ -n MTA_PORT ] && echo "port $MTA_PORT" >> $CONFIG + [ -n MTA_TLS ] && echo "tls $MTA_TLS" >> $CONFIG + [ -n MTA_STARTTLS ] && echo "tls_starttls $MTA_STARTTLS" >> $CONFIG + [ -n MTA_AUTH ] && echo "auth $MTA_AUTH" >> $CONFIG + [ -n MTA_USER ] && echo "user $MTA_USER" >> $CONFIG + [ -n MTA_FROM ] && echo "from $MTA_FROM" >> $CONFIG + [ -n MTA_PASSWORD ] && echo "password $MTA_PASSWORD" >> $CONFIG + [ -n MTA_LOGFILE ] && echo "logfile $MTA_LOGFILE" >> $CONFIG + chown gvmd:mail $CONFIG + chmod 750 $CONFIG +fi From c9bca00f3e15458a8dc001148ae9d9c544d20514 Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Thu, 13 Jul 2023 11:52:12 +0200 Subject: [PATCH 3/7] Add: New options to set a new credential encryption key This adds new command line options to create a new credential encryption key, select an existing ones by UID and change parameters for new keys (currently only the RSA key length). This makes it simpler to implement new recommendation regarding the secure key length and adds interfaces for supporting other key types like elliptic curve based ones. --- doc/gvmd.8 | 9 +++ doc/gvmd.8.xml | 28 ++++++++ doc/gvmd.html | 22 +++++++ src/gvmd.c | 68 ++++++++++++++++++++ src/lsc_crypt.c | 138 +++++++++++++++++++++++++++++++-------- src/lsc_crypt.h | 32 ++++++++- src/manage.c | 102 +++++++++++++++++++++++++++++ src/manage.h | 16 +++++ src/manage_migrators.c | 2 +- src/manage_sql.c | 143 +++++++++++++++++++++++++++++++++++------ 10 files changed, 510 insertions(+), 50 deletions(-) diff --git a/doc/gvmd.8 b/doc/gvmd.8 index b64e38bfc..a9c0794bc 100644 --- a/doc/gvmd.8 +++ b/doc/gvmd.8 @@ -22,6 +22,9 @@ Check SecInfo alerts. \fB--client-watch-interval=\fINUMBER\fB\f1 Check if client connection was closed every NUMBER seconds. 0 to disable. Defaults to 1 second. .TP +\fB--create-encryption-key\f1 +Create a new credential encryption key, set it as the new default and exit. With no other options given, a 4096 bit RSA key is created. +.TP \fB--create-scanner=\fISCANNER\fB\f1 Create global scanner SCANNER and exit. .TP @@ -58,6 +61,12 @@ Do not restrict passwords to the policy. \fB--disable-scheduling\f1 Disable task scheduling. .TP +\fB--encryption-key-length=\fILENGTH\fB\f1 +Set key length to LENGTH bits when creating a new RSA credential encryption key. Defaults to 4096. +.TP +\fB--encryption-key-type=\fITYPE\fB\f1 +Use the key type TYPE when creating a new credential encryption key. Currently only RSA is supported. +.TP \fB--encrypt-all-credentials\f1 (Re-)Encrypt all credentials. .TP diff --git a/doc/gvmd.8.xml b/doc/gvmd.8.xml index 7498442b2..ab873160d 100644 --- a/doc/gvmd.8.xml +++ b/doc/gvmd.8.xml @@ -74,6 +74,16 @@ along with this program. If not, see . 0 to disable. Defaults to 1 second.

+ + +