Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

carlossg
Copy link
Contributor

@carlossg carlossg commented Nov 8, 2017

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

@ghost
Copy link

ghost commented Nov 8, 2017

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"));
Copy link
Member

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

@jtnord jtnord requested a review from jglick November 10, 2017 12:13
Copy link
Member

@jglick jglick left a 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.

@carlossg
Copy link
Contributor Author

it is a bad idea if you run it in an open network with 0.0.0.0
I'm not saying set is as the default but at least make it configurable for anybody that knows what they are doing

Copy link
Member

@jglick jglick left a 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.

@oleg-nenashev
Copy link
Member

@carlossg please feel free to reopen it if you are still interested

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.

5 participants