Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

[kibana] optionally disable SA token automount #1301

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

jonkerj
Copy link
Contributor

@jonkerj jonkerj commented Jul 20, 2021

Benefits

By disabling the automount, potential attackers cannot access the Kubernetes API on behalf/through the pod.

Possible drawbacks

If anyone is using some sidecar or plugin to access the Kubernetes API, they will have to explicitly enable (--set automountToken=true) the automount of the SA token in the values.

Applicable issues

#1330

  • Chart version not bumped (the versions are all bumped and released at the same time)
  • README.md updated with any new values or changes
  • Updated template tests in ${CHART}/tests/*.py
  • Updated integration tests in ${CHART}/examples/*/test/goss.yaml

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@jonkerj
Copy link
Contributor Author

jonkerj commented Aug 16, 2021

Hi devs, is there anything I can do to get this ball rolling?

@jonkerj
Copy link
Contributor Author

jonkerj commented Aug 27, 2021

Rebased/cherry-picked to 7.14

@jonkerj
Copy link
Contributor Author

jonkerj commented Sep 2, 2021

Hi devs, I'd really like someone to take a look at this security fix. Is there anything I can do to get this fixed?

@jonkerj
Copy link
Contributor Author

jonkerj commented Sep 13, 2021

@jmlrt any chance you could take a look at this PR? Looks like you are an active dev here, and I'd really like this feature at least considered 😉

Copy link
Member

@jmlrt jmlrt left a comment

Choose a reason for hiding this comment

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

Hi @jonkerj, sorry for the late answer.
This PR makes sense, however I have a few comments:

  • unless cases where a change is only valid for a specific version, PR should be opened to master branch then Elastic handle the backport to the other branches
  • the default value should be True to avoid a breaking change

Also I don't know if we should migrate the way we configure service accounts to be like elasticsearch chart with a rbac value before this change. I would to think about it.

@jmlrt jmlrt added enhancement New feature or request kibana labels Sep 16, 2021
@jonkerj jonkerj force-pushed the kibana-opt-mount-sa-token branch from 70803f2 to a438600 Compare September 20, 2021 08:39
@cla-checker-service
Copy link

cla-checker-service bot commented Sep 20, 2021

💚 CLA has been signed

@jonkerj jonkerj changed the base branch from 7.14 to master September 20, 2021 08:46
@jonkerj
Copy link
Contributor Author

jonkerj commented Sep 20, 2021

Hi there, same here: I've (re)signed the CLA, rebased and changed the default. Should be good now

@jonkerj jonkerj force-pushed the kibana-opt-mount-sa-token branch from a438600 to 44b4c5c Compare September 20, 2021 08:49
@jonkerj jonkerj changed the title [kibana] optionally enable SA token automount [kibana] optionally disable SA token automount Sep 20, 2021
Copy link
Member

@jmlrt jmlrt left a comment

Choose a reason for hiding this comment

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

LGTM⛴

@jmlrt
Copy link
Member

jmlrt commented Sep 20, 2021

jenkins test this please

Copy link
Member

@jmlrt jmlrt left a comment

Choose a reason for hiding this comment

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

Some changes are required to make Black formatter happy in elastic+helm-charts+pull-request+lint-python/1092.

Can you run black kibana/tests/kibana_test.py?

Kibana has no direct interaction with the Kubernetes API, and as such,
it does not need a mounted service account token in its pods. By
disabling this automount, potential attackers cannot access the API on
behalf/through the Pod.

This commit allows users to opt out on SA token automount, but leaves
leaves current behaviour untouched to avoid breaking things.

Signed-off-by: Jorik Jonker <jorik.jonker@eu.equinix.com>
@jonkerj jonkerj force-pushed the kibana-opt-mount-sa-token branch from 44b4c5c to b2dbad1 Compare September 20, 2021 12:59
@jonkerj
Copy link
Contributor Author

jonkerj commented Sep 20, 2021

done

@jmlrt
Copy link
Member

jmlrt commented Sep 20, 2021

jenkins test this please

@jonkerj
Copy link
Contributor Author

jonkerj commented Oct 1, 2021

@jmlrt : is there anything else I can do?

@jmlrt
Copy link
Member

jmlrt commented Oct 1, 2021

Hi @jonkerj, sorry the PR is approved but CI tests are broken for now.
I'll admin-merge it because I don't have time to fix the jobs for now.

@jmlrt jmlrt merged commit a5fdd4f into elastic:master Oct 12, 2021
@jmlrt jmlrt removed the v7.16.0 label Dec 13, 2021
jmlrt pushed a commit to jmlrt/helm-charts that referenced this pull request Dec 14, 2021
Kibana has no direct interaction with the Kubernetes API, and as such,
it does not need a mounted service account token in its pods. By
disabling this automount, potential attackers cannot access the API on
behalf/through the Pod.

This commit allows users to opt out on SA token automount, but leaves
leaves current behaviour untouched to avoid breaking things.

Signed-off-by: Jorik Jonker <jorik.jonker@eu.equinix.com>
jmlrt pushed a commit to jmlrt/helm-charts that referenced this pull request Dec 14, 2021
Kibana has no direct interaction with the Kubernetes API, and as such,
it does not need a mounted service account token in its pods. By
disabling this automount, potential attackers cannot access the API on
behalf/through the Pod.

This commit allows users to opt out on SA token automount, but leaves
leaves current behaviour untouched to avoid breaking things.

Signed-off-by: Jorik Jonker <jorik.jonker@eu.equinix.com>
jmlrt added a commit that referenced this pull request Dec 14, 2021
Kibana has no direct interaction with the Kubernetes API, and as such,
it does not need a mounted service account token in its pods. By
disabling this automount, potential attackers cannot access the API on
behalf/through the Pod.

This commit allows users to opt out on SA token automount, but leaves
leaves current behaviour untouched to avoid breaking things.

Signed-off-by: Jorik Jonker <jorik.jonker@eu.equinix.com>

Co-authored-by: Jorik Jonker <jorik@kippendief.biz>
jmlrt added a commit that referenced this pull request Dec 14, 2021
Kibana has no direct interaction with the Kubernetes API, and as such,
it does not need a mounted service account token in its pods. By
disabling this automount, potential attackers cannot access the API on
behalf/through the Pod.

This commit allows users to opt out on SA token automount, but leaves
leaves current behaviour untouched to avoid breaking things.

Signed-off-by: Jorik Jonker <jorik.jonker@eu.equinix.com>

Co-authored-by: Jorik Jonker <jorik@kippendief.biz>
@jmlrt jmlrt mentioned this pull request Mar 8, 2022
@jmlrt jmlrt mentioned this pull request Apr 21, 2022
This was referenced Sep 14, 2022
@cospeedster
Copy link
Contributor

Also I don't know if we should migrate the way we configure service accounts to be like elasticsearch chart with a rbac value before this change. I would to think about it.

@jmlrt I opened #1713 to do so and added serviceaccount creation like in elasticsearch except rolebindings and roles.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants