Skip to content

docker: critical base image vulnerabilities, one critical golang vulnerability #807

@Starttoaster

Description

@Starttoaster
Image

Noticed there hasn't been a release for a while so I suspected something like Trivy would turn up a few vulnerabilities in the latest docker image. Several of them actually have fixes available, just need to update some things to move past them. A lot of the vulnerabilities actually come from the base image. At time of writing, Trivy says there are 4 critical, 13 high, 39 medium, and 61 low tier vulnerabilities in the base image.

I think the base image packs in quite a few utilities that are unnecessary, and it seems to be that some of them are actually used for testing, where a production image could just contain the binary. I'm not sure if you want to package such a production image yourself, or if you'd rather leave that to everyone to maintain their own. But that's exactly what I did here: https://github.com/Starttoaster/pgweb/pulls?q=is%3Apr+is%3Aclosed

In the two PRs (at time of writing there are two anyway) I updated all of the Go dependencies, just running go get -u ./... && go mod tidy. The program seems to still work against my Postgres server. Doesn't seem like a tough upgrade. I also changed the docker image to be a bit more hardened. I ran the resulting image through trivy, which turns up with 0 vulnerabilities.

Let me know if you'd like any help with updating either the Dockerfile or go modules and I can submit a pull request. A lot of my changes were pretty opinionated to how I currently maintain my Go projects. So please tell me what a good contribution would look like if I wanted to iterate on either of those things. I'd love to help release a version of pgweb with fewer CVEs. I was looking through the catalog of Postgres web UIs recently and this one caught my eye, it's a great tool, thank you for making it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions