-
Notifications
You must be signed in to change notification settings - Fork 179
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
Allow access to go internal modules #12312
Allow access to go internal modules #12312
Conversation
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.
Can we mount .netrc file always? If user would like to use it, they must copy it from build context to the image $HOME directory. This additional parameter would be not needed then.
In theory yes, but I prefer not. Also putting it always allows malicious actors to get it from any kyma module through PR with a crafted Dockerfile. In the proposed setup only kyma modules which explicitly enabled this option are somehow vulnerable (that reduces the attack surface to mostly or even only modules hosted on internal GitHub). Another option would be to implement the check that will fail the pipeline if . netrc was mentioned with e.g. cat command. |
You're right requiring to explicitly enable access to private modules would be safer. Trying to prevent printing I'm thinking how we can secure the .netrc file further. If we would run |
@dekiel That sounds good to me. I wasn't aware of |
The parameter could stay. This way our private code wont be always accessible in build process and the user will have choice if use a go mod vendor or let go build get modules. I wasn't using go mod vendor much. We can test this approach for scenarios requiring private modules and later consider changing an image builder to always use it. |
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.
Please add test for SetUseGoInternalModules function.
Description
Changes proposed in this pull request: