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

Remove administrative API from binding to all interfaces #3016

Closed
wants to merge 8 commits into from

Conversation

pduldig-at-tw
Copy link
Contributor

As discussed in #3012 the admin API exposes some sensitive information, and it should not bind to all interfaces by default.

I feel that it is not appropriate to ship products with admin interfaces (esp with no password) open by default. This was a lesson learned by Mongo, Couchbase and ElasticSearch -- these products shipped with open defaults and data was exposed.

As issue 3012 indicated, there were over 700 exposed admin interfaces for Kong on the public internet. Lets change the defaults to prevent more from appearing.

@thibaultcha
Copy link
Member

This definitely resonates to me and seems like a much saner default 👍🏻

We were planning on making this change already, thanks for taking care of it.

@pduldig-at-tw
Copy link
Contributor Author

Ahh unit tests failing. Ill try fix this too

# an entrypoint to the Admin API.
# This API lets you configure and manage Kong,
# and should be kept private and secured.

#admin_listen_ssl = 0.0.0.0:8444 # Address and port on which Kong will accept
#admin_listen_ssl = 127.0.0.1:8444 # Address and port on which Kong will accept
Copy link
Member

Choose a reason for hiding this comment

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

while waiting for CI to complete, can you fix the comment alignment? 👍

@pduldig-at-tw
Copy link
Contributor Author

w00t tests pass now!

@p0pr0ck5
Copy link
Contributor

p0pr0ck5 commented Nov 6, 2017

I like!

@Tieske
Copy link
Member

Tieske commented Nov 7, 2017

just wondering: is this for next minor (master branch) or for next major (next branch)?

first thought: next as it might have some breaking side effects on docker and the likes

@thibaultcha @p0pr0ck5 thoughts?

@thibaultcha
Copy link
Member

This will certainly go into next once we have a closer look. Currently traveling so I haven’t had time to do so yet.

Copy link
Member

@thibaultcha thibaultcha left a comment

Choose a reason for hiding this comment

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

Everything looks good to me here except for that configuration file thing.Very much of a user-facing file, this one, so we do try to keep it neat and tidy - and consistent. Thanks for your understanding.

Another thing: would you mind rebasing this on top of the next branch? We will then schedule this for our 0.12 release. We will also update the base branch to next once that is done :)

Thank you!

#admin_listen_ssl = 0.0.0.0:8444 # Address and port on which Kong will accept
# HTTPS requests to the admin API, if
# `admin_ssl` is enabled.
#admin_listen_ssl = 127.0.0.1:8444 # Address and port on which Kong will accept
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, this update makes this line go over our 80 characters limit we try to respect for this file. For this particular case, it should be easy enough to simply move "accept" down a line (and ensure subsequent lines aren't over 80 char as well). Would you mind taking care of that? Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problems, Ill reformat that conf so its <80 wide.

Github q -- do i need to raise a new PR for a rebase against next?
Im fork I clone next branch from this repo, generate a diff from this PR, apply diff to forked branch, submit new PR?

Copy link
Member

Choose a reason for hiding this comment

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

@pduldig-at-tw what should work is doing a git rebase next on this branch

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 added the upstream branch, then rebased it against kong/next, but it seems to have brought in all the other commits. Have I broken this PR?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@pduldig-at-tw I fixed your branch with git rebase origin/next -i (then dropped the incorrect commits via the interactive editor-based interface) and git push --force.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you hisham! Most appreciated! I am still getting used to GH workflows here so thank you for your explanation too!

@thibaultcha thibaultcha added the pr/changes requested Changes were requested to this PR by a maintainer. Please address them and ping back once done. label Nov 8, 2017
@pduldig-at-tw pduldig-at-tw changed the base branch from master to next November 8, 2017 16:23
Fixes insecure default of binding admin to external
To match lua configuration files
Change test to reflect 127.0.0.1 as default admin binding
make it look neater
change to admin 127.0.01
Update new default IP
@p0pr0ck5
Copy link
Contributor

p0pr0ck5 commented Dec 5, 2017

Apart from cleaning up commit history, are we missing anything here? Would definitely love to see this merged 👍

thibaultcha pushed a commit that referenced this pull request Dec 5, 2017
Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>

A rationale to follow best security practises by default is here
enforced by updating the default `admin_listen` property, so that it
does not bind to all interfaces, but instead the local one only.

As the Admin API exposes configuration data, secrets, SSL certificates
and the likes, we want to prevent users from deploying Kong instances
and exposing this data to the public out of negligence.

Fix #3012
From #3016
@thibaultcha
Copy link
Member

Merged to next with some squashing and git commit message additions. Thank you @pduldig-at-tw! We'll include this in our next major release as we consider it a breaking change (but a good one!)

@thibaultcha thibaultcha closed this Dec 5, 2017
@pduldig-at-tw pduldig-at-tw deleted the patch-1 branch December 7, 2017 18:35
thibaultcha pushed a commit that referenced this pull request Jan 16, 2018
Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>

A rationale to follow best security practises by default is here
enforced by updating the default `admin_listen` property, so that it
does not bind to all interfaces, but instead the local one only.

As the Admin API exposes configuration data, secrets, SSL certificates
and the likes, we want to prevent users from deploying Kong instances
and exposing this data to the public out of negligence.

Fix #3012
From #3016
thibaultcha pushed a commit that referenced this pull request Jan 19, 2018
Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>

A rationale to follow best security practises by default is here
enforced by updating the default `admin_listen` property, so that it
does not bind to all interfaces, but instead the local one only.

As the Admin API exposes configuration data, secrets, SSL certificates
and the likes, we want to prevent users from deploying Kong instances
and exposing this data to the public out of negligence.

Fix #3012
From #3016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/changes requested Changes were requested to this PR by a maintainer. Please address them and ping back once done.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants