-
Notifications
You must be signed in to change notification settings - Fork 130
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 connector to listen in all interfaces #84
Conversation
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
@@ -673,7 +673,7 @@ public Thread newThread(Runnable r) { | |||
HttpConfiguration config = connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration(); | |||
// use a bigger buffer as Stapler traces can get pretty large on deeply nested URL | |||
config.setRequestHeaderSize(12 * 1024); | |||
connector.setHost("localhost"); | |||
connector.setHost(System.getProperty("host", "localhost")); |
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.
Seems like this would be bad, it opens up a potentially insecure instance on public interfaces, which is a drive by owning of your machine
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.
Yeah this seems like a bad idea. Either set up Docker routing so that connections seem to come from localhost; or require Jenkins to go into lockdown mode akin to what the Setup Wizard does before serving any content, and then skip the setHost
call entirely.
it is a bad idea if you run it in an open network with 0.0.0.0 |
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.
I looked through the usage from kubernetes
plugin tests. It does use 0.0.0.0 but only from a Jenkinsfile
that presumably is already running in a self-contained environment, and uses a more secure default.
I think this is OK but should be accompanied by a comment warning anyone of the dangers of setting this property, and in particular if set to 0.0.0.0
should log a runtime warning too.
@carlossg please feel free to reopen it if you are still interested |
In the kubernetes plugin we need the server to listen in all interfaces to connect external agents.
Currently working by copying the class https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/test/java/org/jvnet/hudson/test/JenkinsRuleNonLocalhost.java#L83
@reviewbybees