Hi,
I recently tried out the restic rest-server (GitHub - restic/rest-server: Rest Server is a high performance HTTP server that implements restic's REST backend API.) and it worked quite well, thanks for providing that piece of software
I saw that there is a docker image and used that. Usually, I have a small container image scanner (trivy) locally which I use to check if images are outdated before I deploy them GitHub - aquasecurity/trivy: Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues and hard-coded secrets.
It can be freely used and also has a GitHub Action which could be incorporated into the build/release process.
Currently, it finds those issues:
$ trivy image restic/rest-server:latest
2022-09-27T10:14:11.949+0200 INFO Need to update DB
2022-09-27T10:14:11.949+0200 INFO DB Repository: ghcr.io/aquasecurity/trivy-db
2022-09-27T10:14:11.949+0200 INFO Downloading DB...
34.22 MiB / 34.22 MiB [----------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 13.63 MiB p/s 2.7s
2022-09-27T10:14:15.521+0200 INFO Vulnerability scanning is enabled
2022-09-27T10:14:15.521+0200 INFO Secret scanning is enabled
2022-09-27T10:14:15.521+0200 INFO If your scanning is slow, please try '--security-checks vuln' to disable secret scanning
2022-09-27T10:14:15.521+0200 INFO Please see also https://aquasecurity.github.io/trivy/0.30.4/docs/secret/scanning/#recommendation for faster secret detection
2022-09-27T10:14:15.540+0200 INFO Detected OS: alpine
2022-09-27T10:14:15.540+0200 INFO Detecting Alpine vulnerabilities...
2022-09-27T10:14:15.543+0200 INFO Number of language-specific files: 1
2022-09-27T10:14:15.543+0200 INFO Detecting gobinary vulnerabilities...
2022-09-27T10:14:15.545+0200 WARN Error while getting vulnerability details: failed to get the vulnerability "CVE-2021-35940.patch": no vulnerability details for CVE-2021-35940.patch
restic/rest-server:latest (alpine 3.15.0)
Total: 29 (UNKNOWN: 1, LOW: 0, MEDIUM: 6, HIGH: 12, CRITICAL: 10)
βββββββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Library β Vulnerability β Severity β Installed Version β Fixed Version β Title β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β apache2-utils β CVE-2022-22720 β CRITICAL β 2.4.52-r0 β 2.4.53-r0 β httpd: Errors encountered during the discarding of request β
β β β β β β body lead to HTTP... β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-22720 β
β ββββββββββββββββββββββββ€ β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-22721 β β β β httpd: core: Possible buffer overflow with very large or β
β β β β β β unlimited LimitXMLRequestBody β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-22721 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β apache2-utils β CVE-2022-23943 β CRITICAL β 2.4.52-r0 β 2.4.53-r0 β httpd: mod_sed: Read/write beyond bounds β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-23943 β
β ββββββββββββββββββββββββ€ β βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-28615 β β β 2.4.54-r0 β httpd: out-of-bounds read in ap_strcmp_match() β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-28615 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β apache2-utils β CVE-2022-31813 β CRITICAL β 2.4.52-r0 β 2.4.54-r0 β httpd: mod_proxy: X-Forwarded-For dropped by hop-by-hop β
β β β β β β mechanism β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-31813 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β apache2-utils β CVE-2022-22719 β HIGH β 2.4.52-r0 β 2.4.53-r0 β httpd: mod_lua: Use of uninitialized value of in r:parsebody β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-22719 β
β ββββββββββββββββββββββββ€ β βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-26377 β β β 2.4.54-r0 β httpd: mod_proxy_ajp: Possible request smuggling β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-26377 β
β ββββββββββββββββββββββββ€ β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-29404 β β β β httpd: mod_lua: DoS in r:parsebody β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-29404 β
β ββββββββββββββββββββββββ€ β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-30522 β β β β httpd: mod_sed: DoS vulnerability β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-30522 β
β ββββββββββββββββββββββββ€ β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-30556 β β β β httpd: mod_lua: Information disclosure with websockets β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-30556 β
β ββββββββββββββββββββββββΌβββββββββββ€ β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-28330 β MEDIUM β β β httpd: mod_isapi: out-of-bounds read β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-28330 β
β ββββββββββββββββββββββββ€ β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-28614 β β β β httpd: out-of-bounds read via ap_rwrite() β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-28614 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β apr β CVE-2021-35940.patch β UNKNOWN β 1.7.0-r0 β 1.7.0-r1 β β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β busybox β CVE-2022-28391 β HIGH β 1.34.1-r3 β 1.34.1-r5 β busybox: remote attackers may execute arbitrary code if β
β β β β β β netstat is used β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-28391 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β expat β CVE-2022-25235 β CRITICAL β 2.4.4-r0 β 2.4.5-r0 β expat: Malformed 2- and 3-byte UTF-8 sequences can lead to β
β β β β β β arbitrary code... β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-25235 β
β ββββββββββββββββββββββββ€ β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-25236 β β β β expat: Namespace-separator characters in "xmlns[:prefix]" β
β β β β β β attribute values can lead to arbitrary code... β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-25236 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β expat β CVE-2022-25315 β CRITICAL β 2.4.4-r0 β 2.4.5-r0 β expat: Integer overflow in storeRawNames() β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-25315 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β expat β CVE-2022-40674 β CRITICAL β 2.4.4-r0 β 2.4.9-r0 β libexpat before 2.4.9 has a use-after-free in the doContent β
β β β β β β function i ...... β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-40674 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β expat β CVE-2022-25314 β HIGH β 2.4.4-r0 β 2.4.5-r0 β expat: integer overflow in copyString() β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-25314 β
β ββββββββββββββββββββββββΌβββββββββββ€ β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2022-25313 β MEDIUM β β β expat: stack exhaustion in doctype parsing β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-25313 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β libcrypto1.1 β CVE-2022-0778 β HIGH β 1.1.1l-r7 β 1.1.1n-r0 β openssl: Infinite loop in BN_mod_sqrt() reachable when β
β β β β β β parsing certificates β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-0778 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β libcrypto1.1 β CVE-2022-2097 β MEDIUM β 1.1.1l-r7 β 1.1.1q-r0 β openssl: AES OCB fails to encrypt some bytes β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-2097 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β libretls β CVE-2022-0778 β HIGH β 3.3.4-r2 β 3.3.4-r3 β openssl: Infinite loop in BN_mod_sqrt() reachable when β
β β β β β β parsing certificates β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-0778 β
βββββββββββββββββ€ β βββββββββββββββββββββΌββββββββββββββββ€ β
β libssl1.1 β β β 1.1.1l-r7 β 1.1.1n-r0 β β
β β β β β β β
β β β β β β β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β libssl1.1 β CVE-2022-2097 β MEDIUM β 1.1.1l-r7 β 1.1.1q-r0 β openssl: AES OCB fails to encrypt some bytes β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-2097 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β libuuid β CVE-2022-0563 β MEDIUM β 2.37.3-r0 β 2.37.4-r0 β util-linux: partial disclosure of arbitrary files in chfn β
β β β β β β and chsh when compiled... β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-0563 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ssl_client β CVE-2022-28391 β HIGH β 1.34.1-r3 β 1.34.1-r5 β busybox: remote attackers may execute arbitrary code if β
β β β β β β netstat is used β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-28391 β
βββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββΌββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β zlib β CVE-2022-37434 β CRITICAL β 1.2.11-r3 β 1.2.12-r2 β zlib: a heap-based buffer over-read or buffer overflow in β
β β β β β β inflate in inflate.c... β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-37434 β
β ββββββββββββββββββββββββΌβββββββββββ€ βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β CVE-2018-25032 β HIGH β β 1.2.12-r0 β zlib: A flaw found in zlib when compressing (not β
β β β β β β decompressing) certain inputs... β
β β β β β β https://avd.aquasec.com/nvd/cve-2018-25032 β
βββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββ΄ββββββββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
usr/bin/rest-server (gobinary)
Total: 3 (UNKNOWN: 1, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 0)
βββββββββββββββββββββββ¬ββββββββββββββββββββββ¬βββββββββββ¬βββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Library β Vulnerability β Severity β Installed Version β Fixed Version β Title β
βββββββββββββββββββββββΌββββββββββββββββββββββΌβββββββββββΌβββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β golang.org/x/crypto β CVE-2022-27191 β HIGH β v0.0.0-20220208050332-20e1d8d225ab β 0.0.0-20220314234659-1baeb1ce4c0b β golang: crash in a golang.org/x/crypto/ssh server β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-27191 β
βββββββββββββββββββββββΌββββββββββββββββββββββΌβββββββββββΌβββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β golang.org/x/crypto β GHSA-8c26-wmh5-6g9v β UNKNOWN β v0.0.0-20220208050332-20e1d8d225ab β 0.0.0-20220314234659-1baeb1ce4c0b β Attackers can cause a crash in SSH servers when the server β
β β β β β β has... β
β β β β β β https://github.com/advisories/GHSA-8c26-wmh5-6g9v β
βββββββββββββββββββββββΌββββββββββββββββββββββΌβββββββββββΌβββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β golang.org/x/sys β CVE-2022-29526 β MEDIUM β v0.0.0-20220114195835-da31bd327af9 β 0.0.0-20220412211240-33da011f77ad β golang: syscall: faccessat checks wrong group β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-29526 β
βββββββββββββββββββββββ΄ββββββββββββββββββββββ΄βββββββββββ΄βββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Most of the issues can simply be solved by rebuilding the container image:
$ trivy image restic/rest-server:konrad
2022-09-27T10:15:47.989+0200 INFO Vulnerability scanning is enabled
2022-09-27T10:15:47.989+0200 INFO Secret scanning is enabled
2022-09-27T10:15:47.990+0200 INFO If your scanning is slow, please try '--security-checks vuln' to disable secret scanning
2022-09-27T10:15:47.990+0200 INFO Please see also https://aquasecurity.github.io/trivy/0.30.4/docs/secret/scanning/#recommendation for faster secret detection
2022-09-27T10:15:48.009+0200 INFO Detected OS: alpine
2022-09-27T10:15:48.009+0200 INFO Detecting Alpine vulnerabilities...
2022-09-27T10:15:48.010+0200 INFO Number of language-specific files: 1
2022-09-27T10:15:48.010+0200 INFO Detecting gobinary vulnerabilities...
restic/rest-server:konrad (alpine 3.16.2)
Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
usr/bin/rest-server (gobinary)
Total: 3 (UNKNOWN: 1, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 0)
βββββββββββββββββββββββ¬ββββββββββββββββββββββ¬βββββββββββ¬βββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Library β Vulnerability β Severity β Installed Version β Fixed Version β Title β
βββββββββββββββββββββββΌββββββββββββββββββββββΌβββββββββββΌβββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β golang.org/x/crypto β CVE-2022-27191 β HIGH β v0.0.0-20220208050332-20e1d8d225ab β 0.0.0-20220314234659-1baeb1ce4c0b β golang: crash in a golang.org/x/crypto/ssh server β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-27191 β
βββββββββββββββββββββββΌββββββββββββββββββββββΌβββββββββββΌβββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β golang.org/x/crypto β GHSA-8c26-wmh5-6g9v β UNKNOWN β v0.0.0-20220208050332-20e1d8d225ab β 0.0.0-20220314234659-1baeb1ce4c0b β Attackers can cause a crash in SSH servers when the server β
β β β β β β has... β
β β β β β β https://github.com/advisories/GHSA-8c26-wmh5-6g9v β
βββββββββββββββββββββββΌββββββββββββββββββββββΌβββββββββββΌβββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β golang.org/x/sys β CVE-2022-29526 β MEDIUM β v0.0.0-20220114195835-da31bd327af9 β 0.0.0-20220412211240-33da011f77ad β golang: syscall: faccessat checks wrong group β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-29526 β
βββββββββββββββββββββββ΄ββββββββββββββββββββββ΄βββββββββββ΄βββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
I am wondering, if you would be interested in automatic rebuilds of the image.
I could imagine something like a trivy scan workflow which runs daily and checks for security findings. If found, it could try to build the image again and scan if that resolves anything. If that is the case, a push to dockerhub could be performed.
If we would add e.g. Renovate Mend (GitHub - renovatebot/renovate: Universal dependency update tool that fits into your workflows., also available as GitHub App), we could pin docker image digests to automatically get PRs, if e.g. Alpine changes or golang module updates. New PRs could run tests again before they get merged.
A merge to master could publish an updated container image to GitHub.
Dependabot could also be used, but Renovate is OpenSource and I think more flexible when it comes to rules. I am also more familar with Renovate, but have no hard feelings against Dependabot either.
What are your thoughts on this? I guess restic itself could also leverage renovate, but I think for server components it might me more critical for now.
Restic itself is also more up-to-date currently:
$ trivy image restic/restic
2022-09-27T10:22:19.908+0200 INFO Vulnerability scanning is enabled
2022-09-27T10:22:19.908+0200 INFO Secret scanning is enabled
2022-09-27T10:22:19.908+0200 INFO If your scanning is slow, please try '--security-checks vuln' to disable secret scanning
2022-09-27T10:22:19.908+0200 INFO Please see also https://aquasecurity.github.io/trivy/0.30.4/docs/secret/scanning/#recommendation for faster secret detection
2022-09-27T10:22:21.324+0200 INFO Detected OS: alpine
2022-09-27T10:22:21.324+0200 INFO Detecting Alpine vulnerabilities...
2022-09-27T10:22:21.340+0200 INFO Number of language-specific files: 1
2022-09-27T10:22:21.341+0200 INFO Detecting gobinary vulnerabilities...
restic/restic (alpine 3.16.2)
Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
usr/bin/restic (gobinary)
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
ββββββββββββββββββββ¬βββββββββββββββββ¬βββββββββββ¬βββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Library β Vulnerability β Severity β Installed Version β Fixed Version β Title β
ββββββββββββββββββββΌβββββββββββββββββΌβββββββββββΌβββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β golang.org/x/net β CVE-2022-27664 β HIGH β v0.0.0-20220822230855-b0a4917ee28c β 0.0.0-20220906165146-f3363e06e74c β golang: net/http: handle server errors after sending GOAWAY β
β β β β β β https://avd.aquasec.com/nvd/cve-2022-27664 β
ββββββββββββββββββββ΄βββββββββββββββββ΄βββββββββββ΄βββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Thanks
Konrad