Skip to content

Commit

Permalink
Bind Kibana server to localhost
Browse files Browse the repository at this point in the history
This is a breaking change. The default behaviour will now be that
connections from remote users will be rejected.
  • Loading branch information
thomasneirynck committed Aug 25, 2016
1 parent bfb81ef commit 549293d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions config/kibana.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Kibana is served by a back end server. This setting specifies the port to use.
# server.port: 5601

# This setting specifies the IP address of the back end server.
# server.host: "0.0.0.0"
# Specifies the public host name to which the Kibana server will bind.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to IP or the DNS-name of the machine that is running Kibana.
# server.host: "localhost"

# Enables you to specify a path to mount Kibana at if you are running behind a proxy. This setting
# cannot end in a slash.
Expand Down
2 changes: 1 addition & 1 deletion docs/kibana-yml.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.Kibana Configuration Settings
[horizontal]
`server.port:`:: *Default: 5601* Kibana is served by a back end server. This setting specifies the port to use.
`server.host:`:: *Default: "0.0.0.0"* This setting specifies the IP address of the back end server.
`server.host:`:: *Default: "localhost"* This setting specifies the host of the back end server.
`server.basePath:`:: Enables you to specify a path to mount Kibana at if you are running behind a proxy. This setting
cannot end in a slash (`/`).
`server.maxPayloadBytes:`:: *Default: 1048576* The maximum payload size in bytes for incoming server requests.
Expand Down
2 changes: 1 addition & 1 deletion docs/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ deprecated[4.2, The names of several Kibana server properties changed in the 4.2
+
*alias*: `host` deprecated[4.2]
+
*default*: `"0.0.0.0"`
*default*: `"localhost"`
`elasticsearch.url` added[4.2]:: The Elasticsearch instance where the indices you want to query reside.
+
Expand Down
2 changes: 1 addition & 1 deletion src/server/config/__tests__/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('lib/config/config', function () {
it('should allow keys in the schema', function () {
let config = new Config(schema);
let run = function () {
config.set('test.client.host', 'http://0.0.0.0');
config.set('test.client.host', 'http://localhost');
};
expect(run).to.not.throwException();
});
Expand Down
2 changes: 1 addition & 1 deletion src/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = () => Joi.object({

server: Joi.object({
name: Joi.string().default(os.hostname()),
host: Joi.string().hostname().default('0.0.0.0'),
host: Joi.string().hostname().default('localhost'),
port: Joi.number().default(5601),
maxPayloadBytes: Joi.number().default(1048576),
autoListen: Joi.boolean().default(true),
Expand Down

5 comments on commit 549293d

@curry684
Copy link

@curry684 curry684 commented on 549293d Oct 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love how this breaking change isn't documented anywhere at all, like for example the release notes. Just upgraded to Docker image 5.0.0-rc1 and wasted an hour debugging my entire application stack before I eventually installed netstat in the container and saw the wrong binding.

The coolest part is of course that this makes the 5.0 Docker image completely unusable out of the box as the localhost binding is inaccessible within the complete stack.

@thomasneirynck
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@curry684 My apologies for your troubles. That corresponding PR (#8013) is labeled as breaking, but it seems that information did not flow to the release note page. This is an RC still, but this lack of documentation should definitely be resolved by the final. Thank you for bringing this to our attention, and sorry again for the issues it caused.

@thomasneirynck
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this a little further. This change was listed already listed in the breaking changes page: https://www.elastic.co/guide/en/kibana/5.0/breaking-changes-5.0.html

We'll need to ensure that the release notes and breaking changes pages are linking to each other so they are more easily discovered. I initially looked over the breaking changes page too.

@curry684
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick and professional response. About the second part: you are aware that the Docker image is now practically unusable as it's only binding inside its container? I think its default config should be changed to 0.0.0.0 as that's what makes sense. Otherwise the Docker Hub documentation should reflect the required steps to use the container.

@thomasneirynck
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this change indeed can affect your docker images.

If you are using the Kibana Docker Image that is hosted and maintained by Elastic (https://github.com/elastic/kibana-docker), this change should have been applied already by 5.0RC1. If you are still experiencing issues related to this change with that image, please do not hesitate to submit a trouble ticket.

There are other Kibana docker images out there (notably on Docker Hub), but we do not maintain those. It is possible that those have not been updated yet to take this change into account.

Please sign in to comment.