-
Notifications
You must be signed in to change notification settings - Fork 5k
Limit env variables propagated #13922
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
Conversation
@bot-gradle test QF |
OK, I've already triggered QuickFeedback build for you. |
5abd10c
to
bf2bd3e
Compare
@bot-gradle test QF |
Sorry some internal error occurs, please contact the administrator @blindpirate |
OK, I've already cancelled the old build and triggered a new QuickFeedback build for you. |
buildSrc/subprojects/jvm/src/main/kotlin/gradlebuild/propagated-env-variables.kt
Outdated
Show resolved
Hide resolved
buildSrc/subprojects/jvm/src/main/kotlin/gradlebuild/propagated-env-variables.kt
Outdated
Show resolved
Hide resolved
buildSrc/subprojects/jvm/src/main/kotlin/gradlebuild/propagated-env-variables.kt
Outdated
Show resolved
Hide resolved
bf2bd3e
to
8f44394
Compare
@bot-gradle test QF |
OK, I've already triggered QuickFeedback build for you. |
8f44394
to
9995e10
Compare
@bot-gradle test QF |
OK, I've already cancelled the old build and triggered a new QuickFeedback build for you. |
7ed8b95
to
7cbcc1a
Compare
buildSrc/subprojects/jvm/src/main/kotlin/gradlebuild/propagated-env-variables.kt
Outdated
Show resolved
Hide resolved
buildSrc/subprojects/jvm/src/main/kotlin/gradlebuild/propagated-env-variables.kt
Outdated
Show resolved
Hide resolved
32cf9d1
to
2e65f1f
Compare
@bot-gradle test RFN |
OK, I've already triggered ReadyForNightly build for you. |
|
||
fun Test.configurePropagatedEnvVariables() { | ||
if (BuildEnvironment.isCiServer) { | ||
environment = System.getenv().entries.mapNotNull(::sanitize).toMap() |
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 also have something that looks at the propagated environment variables and does a sanity check for "bad words"?
e.g., things like BUILD_CACHE_PASSWORD
and TEAMCITY_TOKEN
would make it through our filter, so I think we should make it so the build fails at this point if any env var contains (case insensitive) "password" or "token" so we're forced to pick a different name.
The failures at the test level below are OK, but it's too late at that point.
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.
A few candidates to blacklist:
- apikey
- secret
- auth
- credential
buildSrc/subprojects/jvm/src/main/kotlin/gradlebuild/propagated-env-variables.kt
Outdated
Show resolved
Hide resolved
|
||
|
||
fun Test.configurePropagatedEnvVariables() { | ||
if (BuildEnvironment.isCiServer) { |
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.
❌ Local builds might also leak credentials. I think we should filter env vars for all builds.
@bot-gradle test RFN |
No description provided.