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

[Fleet] Enforce production mode #63637

Closed
nchaulet opened this issue Apr 15, 2020 · 8 comments · Fixed by #65027
Closed

[Fleet] Enforce production mode #63637

nchaulet opened this issue Apr 15, 2020 · 8 comments · Fixed by #65027
Assignees
Labels
Ingest Management:alpha1 Group issues for ingest management alpha1 Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@nchaulet
Copy link
Member

Description

When running Kibana in production mode we should ensure:

  • Kibana has security enabled
  • Kibana is using TLS, in case of cloud we should add a config flag to disable that check
  • API keys are enabled (should be checked in dev too)

If any of this conditions are not true we should not allow the user to use fleet and display an error message, and how to resolve it.

@elastic/kibana-security what is the best way to check if kibana is using TLS?

@nchaulet nchaulet added Team:Fleet Team label for Observability Data Collection Fleet team Ingest Management:alpha1 Group issues for ingest management alpha1 labels Apr 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@legrego
Copy link
Member

legrego commented Apr 15, 2020

@elastic/kibana-security what is the best way to check if kibana is using TLS?

On which interface? Browser <--> Kibana, or Kibana <--> Elasticsearch?

It's tricky because there could be TLS terminating proxies in place for either interface in on-prem setups too, which Kibana would have no way of verifying.

@nchaulet
Copy link
Member Author

@legrego for the interface Browser <--> Kibana, yes for the case where kibana is running behind a proxy that terminate tls we could expose a config variable so the user can disable that check. ( I image it's going to be the case for cloud users)

@legrego
Copy link
Member

legrego commented Apr 15, 2020

It's not entirely straightforward to determine this today. For this interface, you'll need to inspect the following kibana.yml options:

  • server.ssl.enabled must be set to true
    AND
    • server.ssl.certificate AND server.ssl.key are both set
      OR
    • server.ssl.keystore.path is set

The status of TLS on this interface might be something that @elastic/kibana-platform would want to expose as a single boolean flag though as part of its core contract.

Kibana has security enabled

This is rather complicated too. Kibana can have its security plugin enabled, but the security features themselves are mostly determined by Elasticsearch, and could change at any time. The security plugin exposes this today, but it's not something you can check once and cache.

API keys are enabled (should be checked in dev too)

I have a PR opened which will make this much easier to do. Similar to the previous answer, this could change at any time, so the result can't be cached for all that long: #63454

@pgayvallet
Copy link
Contributor

pgayvallet commented Apr 16, 2020

The status of TLS on this interface might be something that @elastic/kibana-platform would want to expose as a single boolean flag though as part of its core contract.

Already is (even if not a boolean)

coreSetup.http.getServerInfo().protocol === 'https'. This one is based on the underlying hapi protocol, so having the https value should be sufficient to assume TLS is enabled on the server(?)

There is also coreSetup.http.isTlsEnabled but the only check for that is config.ssl.enabled === true

@mshustov
Copy link
Contributor

mshustov commented Apr 16, 2020

There is also coreSetup.http.isTlsEnabled but the only check for that is config.ssl.enabled === true

other requirements that @legrego mentioned are validated in SSL config, so it suffices I believe

if (ssl.enabled && (!ssl.key || !ssl.certificate) && !ssl.keystore.path) {
return 'must specify [certificate] and [key] -- or [keystore.path] -- when ssl is enabled';
}

@legrego
Copy link
Member

legrego commented Apr 16, 2020

As usual, you’re already a step ahead of me - Thanks @restrry & @pgayvallet !

@nchaulet
Copy link
Member Author

@hbharding Any idea on how to display that? fleet could be not usable because:

  • API keys are not enabled
  • TLS is not enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ingest Management:alpha1 Group issues for ingest management alpha1 Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants