Skip to content

Conversation

@stuartnelson3
Copy link
Contributor

this was prompted by a security warning for mongo-driver in apm-server. after bumping the version, tests seem to be passing, so maybe it was as simple as the below command. I checked the dependency graph and upgraded to the latest strfmt:

# go mod graph | grep mongo
github.com/elastic/elastic-package go.mongodb.org/mongo-driver@v1.1.2
github.com/go-openapi/strfmt@v0.19.6 go.mongodb.org/mongo-driver@v1.0.3
# go get github.com/go-openapi/strfmt@v0.21.0

after upgrade:

# go mod graph | grep mongo
github.com/elastic/elastic-package go.mongodb.org/mongo-driver@v1.7.3
github.com/go-openapi/strfmt@v0.21.0 go.mongodb.org/mongo-driver@v1.7.3
go.mongodb.org/mongo-driver@v1.7.3 github.com/go-stack/stack@v1.8.0
go.mongodb.org/mongo-driver@v1.7.3 github.com/gobuffalo/genny@v0.1.1
go.mongodb.org/mongo-driver@v1.7.3 github.com/gobuffalo/gogen@v0.1.1
go.mongodb.org/mongo-driver@v1.7.3 github.com/gobuffalo/packr/v2@v2.2.0
go.mongodb.org/mongo-driver@v1.7.3 github.com/golang/snappy@v0.0.1
go.mongodb.org/mongo-driver@v1.7.3 github.com/google/go-cmp@v0.5.2
go.mongodb.org/mongo-driver@v1.7.3 github.com/karrick/godirwalk@v1.10.3
go.mongodb.org/mongo-driver@v1.7.3 github.com/klauspost/compress@v1.13.6
go.mongodb.org/mongo-driver@v1.7.3 github.com/kr/pretty@v0.1.0
go.mongodb.org/mongo-driver@v1.7.3 github.com/montanaflynn/stats@v0.0.0-20171201202039-1bf9dbcd8cbe
go.mongodb.org/mongo-driver@v1.7.3 github.com/pelletier/go-toml@v1.7.0
go.mongodb.org/mongo-driver@v1.7.3 github.com/pkg/errors@v0.9.1
go.mongodb.org/mongo-driver@v1.7.3 github.com/sirupsen/logrus@v1.4.2
go.mongodb.org/mongo-driver@v1.7.3 github.com/stretchr/testify@v1.6.1
go.mongodb.org/mongo-driver@v1.7.3 github.com/tidwall/pretty@v1.0.0
go.mongodb.org/mongo-driver@v1.7.3 github.com/xdg-go/scram@v1.0.2
go.mongodb.org/mongo-driver@v1.7.3 github.com/xdg-go/stringprep@v1.0.2
go.mongodb.org/mongo-driver@v1.7.3 github.com/youmark/pkcs8@v0.0.0-20181117223130-1be2e3e5546d
go.mongodb.org/mongo-driver@v1.7.3 golang.org/x/crypto@v0.0.0-20200302210943-78000ba7a073
go.mongodb.org/mongo-driver@v1.7.3 golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e
go.mongodb.org/mongo-driver@v1.7.3 golang.org/x/sys@v0.0.0-20190531175056-4c3a928424d2
go.mongodb.org/mongo-driver@v1.7.3 golang.org/x/tools@v0.0.0-20190531172133-b3315ee88b7d

closes #564

need to upgrade strfmt to upgrade mongo-driver,
which has an open CVE for the version used
test folder wasn't being created if absent
@stuartnelson3 stuartnelson3 requested a review from mtojek November 1, 2021 16:50
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 1, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-02T07:50:24.885+0000

  • Duration: 35 min 1 sec

  • Commit: f1f1755

Test stats 🧪

Test Results
Failed 0
Passed 438
Skipped 4
Total 442

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more like a formal action that fixing a real issue. We don't use mongo libraries, it's just a transitive dependency as you noticed.

Makefile Outdated
update: update-readme

test-go:
$(CODE_COVERAGE_REPORT_NAME_UNIT):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is about upgrading the mongo-driver as there is a moderate security alert, but I'm having hard times understanding all other changes in Makefile. Could you please explain why did you introduce this? Did you face any issue around these? The CODE_COVERAGE_REPORT_NAME_UNIT directory is created by the tool.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this deeper and agree that there is an issue. Would you mind extracting it to a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I encountered this while running the tests. I'll open a separate PR.

This reverts commit 5e2a348.
@stuartnelson3
Copy link
Contributor Author

This is more like a formal action that fixing a real issue. We don't use mongo libraries, it's just a transitive dependency as you noticed.

this is true. still, it removes a moderate security alert for both elastic-package and any repo depending on it.

@mtojek mtojek self-requested a review November 2, 2021 08:30
Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we're good to merge this one.

@mtojek mtojek merged commit 2c33147 into elastic:master Nov 2, 2021
@stuartnelson3 stuartnelson3 deleted the upgrade-mongo-driver branch November 2, 2021 08:45
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.

upgrade mongo-driver dependency

3 participants