-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat: remove shared repo volume between repo-server and cmp-server #8600
Conversation
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
8a74e0a
to
4ad8ba9
Compare
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Codecov Report
@@ Coverage Diff @@
## master #8600 +/- ##
==========================================
+ Coverage 42.66% 42.78% +0.12%
==========================================
Files 184 186 +2
Lines 23130 23300 +170
==========================================
+ Hits 9868 9970 +102
- Misses 11859 11902 +43
- Partials 1403 1428 +25
Continue to review full report at Codecov.
|
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass done! I'll probably return with a closer look soon.
Comments mostly fall into these categories:
- Use UUIDv4 in all temporary paths.
- Return less detail in errors and favor logging instead.
- Set up
defer
functions to close resources before short-cutting it with error checks.
I haven't looked, but I think the CMP docs will need to be updated to remove any references to a shared volume. |
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
@crenshaw-dev I updated the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial second pass. I still need to go over the tar code and its tests again.
I think my biggest concern right now is sanitization of sensitive paths.
Instead of duplicating the repo-server sanitization interceptor in cmp-server, we could just rely on the repo-server's sanitizer, since all cmp-server traffic goes through repo-server. But we'd have to 1) define some unique root path in cmp-server to store all sensitive paths and 2) modify the repo-server sanitizer config to look for that new path.
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The panic -> delete temp dirs security mechanism assumes /tmp isn't mounted as a persistent volume. A lot of CMP users will continue to mount /tmp, just because that's how it was before.
We should:
- nest all temp directories under /tmp/_cmp-server
- clear out that directory on startup
- add a note to the docs that, for security,
/tmp
should no longer be shared with repo-server as of version 2.3.X - this is necessary because, even if we're clearing the tmp directories on startup, it's better to avoid exposing repo-server's persistent git repos to the CMP container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome PR @leoluz . Add one nice to have comment.
LGTM after resolving @crenshaw-dev 's comments.
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…rgoproj#8600) feat: remove shared repo volume between repo-server and cmp-server (argoproj#8600) Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> Signed-off-by: wojtekidd <wojtek.cichon@protonmail.com>
Signed-off-by: Leonardo Luz Almeida leonardo_almeida@intuit.com
Description
This PR removes the shared volume containing all application's repository files between the repo-server and cmp-server. In order to do so, it changes how the repo-server communicates with the cmp-server to generate manifests (
GenerateManifests
) and check if the repo is supported (MatchRepository
) by the plugin.Motivation
Before this PR, cmp-server was expected to have the same repo-server volume mounted containing all files from all cloned repos.
This extends all the security issues recently faced in the repo-server to the cmp-server as well.
Solution
In order to mitigate the problem the following changes are being implemented in this PR:
Checklist