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

Update Go to 1.16 (from official repository), Update Go modules, Update mongo-db-tools #47

Merged
merged 4 commits into from Apr 16, 2021
Merged

Update Go to 1.16 (from official repository), Update Go modules, Update mongo-db-tools #47

merged 4 commits into from Apr 16, 2021

Conversation

padyx
Copy link

@padyx padyx commented Apr 14, 2021

The intention of this MR is to update the image to use newer dependencies to resolve several vulnerabilities in the components contained therein.

  • Change the Build of the backman binary to get the Go installation from the official Go Project repositories (1.16.3) instead from the Ubuntu 20.04 package manager (which currently provides only 1.13.8).
  • Update all Go packages and remove the vendor directory.
    • This resolves several vulnerabilities for the backman binary caused by old packages -- even though it won't resolve it for the whole image.
    • Please check the latter carefully, I tried it, and tests still worked - but I have no clue if there is any side effect of it which I didn't think about.
  • Update mongodb tools to the newest patch version
    • Sadly, this doesn't resolve vulnerabilities, since apparently the tools aren't update to the newest Go mongoDB driver (1.4.3), but still at a vulnerable 1.4.2.

This MR would update several things at once, I'm open to discussion here to split or squash this, if desired.

@padyx padyx marked this pull request as ready for review April 14, 2021 10:58
@JamesClonk
Copy link
Member

@padyx Could you please undo the vendor directory deletion? I have it committed for 100% offline reproducible builds in all my projects. (Storing text files in git is cheap, getting stuck because dependencies changed/disappeared/are offline is not)
From a preliminary look the rest should be fine, I'll have a closer look over the weekend. 👍️

I don't quite understand the vulnerability report on the Go MongoDB drivers, as I'm not using or having them included anywhere at all. Are they just part of mongodb-tools by default and get dragged into the image by them, even though I don't need/use those?

@padyx
Copy link
Author

padyx commented Apr 16, 2021

Thanks for the feedback @JamesClonk
Sure, I had wondered why that directory was present 😀 I've replaced that commit with one that syncs the vendor directory (go mod vendor) with the changes to go.mod

Regarding the Go mongoDB drivers: Yes, they are bundled in the mongodb executables (mongoimport, for example) which are provided from the "mongodb-database-tools" packages (installed as a dependency from the "mongodb-org-tools"). I added my detailed analysis steps below.

padyx@myhost:~$ go version -m mongoimport
mongoimport: go1.15.8
        path    command-line-arguments
        mod     github.com/mongodb/mongo-tools  (devel)
        dep     github.com/aws/aws-sdk-go       v1.34.28
<OMITTED>
        dep     go.mongodb.org/mongo-driver     v1.4.2  <<<<<
<OMITTED>
vcap@d30deeaa1645:~/app$ which mongoimport
/usr/bin/mongoimport

vcap@d30deeaa1645:~/app$ dpkg -S /usr/bin/mongoimport
mongodb-database-tools: /usr/bin/mongoimport

vcap@d30deeaa1645:~/app$ dpkg -s mongodb-database-tools
Package: mongodb-database-tools
Status: install ok installed
Priority: optional
Section: database
Maintainer: MongoDB Connectors Team <database-tools-packaging@mongodb.com>
Architecture: amd64
Version: 100.3.1
Replaces: mongodb-database-tools (<= 100.3.1), mongodb-org-tools (<= 4.3.2), mongodb-org-tools-unstable (<= 4.3.2), mongodb-enterprise-tools (<= 4.3.2), mongodb-enterprise-tools-unstable (<= 4.3.2)
Provides: mongodb-database-tools
Depends: libc6, libgssapi-krb5-2, libkrb5-3, libk5crypto3, libcomerr2, libkrb5support0, libkeyutils1
Breaks: mongodb-org-tools (<= 4.3.2), mongodb-org-tools-unstable (<= 4.3.2), mongodb-enterprise-tools (<= 4.3.2), mongodb-enterprise-tools-unstable (<= 4.3.2)
Conflicts: mongodb-database-tools
Description: <OMITTED>

vcap@d30deeaa1645:~/app$ dpkg -s mongodb-org-tools
Package: mongodb-org-tools
Status: install ok installed
Priority: optional
Section: database
Installed-Size: 8
Maintainer: MongoDB Packaging <packaging@mongodb.com>
Architecture: amd64
Source: mongodb-org
Version: 4.4.5
Depends: mongodb-database-tools, mongodb-org-database-tools-extra
<OMITTED>

@JamesClonk JamesClonk merged commit 7d575d1 into swisscom:master Apr 16, 2021
@JamesClonk
Copy link
Member

Looks good. 👍️
I'll build a new release with the merged updates asap. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants