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] Agent authentication model #14486

Closed
6 tasks
ph opened this issue Nov 12, 2019 · 6 comments
Closed
6 tasks

[Fleet] Agent authentication model #14486

ph opened this issue Nov 12, 2019 · 6 comments
Assignees
Labels
Dependency:Endpoint discuss Issue needs further discussion.

Comments

@ph
Copy link
Contributor

ph commented Nov 12, 2019

Context

When trust is important:

  • At enroll, when the agent initially communicate to Fleet to receives the API KEY (which is both the Fleet key and the Elasticsearch key), the key is used to uniquely identify an Agent.

  • At checkin, when the agent posts status and events and retrieves policies and actions.

  • For the elasticsearch output and monitoring: when Events from Beats are sent to Elasticsearch.

Enroll

We will change the behavior to use certificate pinning to establish the initial trust, the agent will receive both an enrollment key and a certificate hash encoded using sha256. The agent will retrieve the remote certificate and compare the hash. If it matches we can trust the remote server and continue with the enroll.

Note: Due to how TLS termination and re-encryption is handled in Cloud we will need to add a new setting to Kibana to allow to specify what hash to use for the certificate verification.

As part of the enroll response, Fleet will need to send back in the payload the certificate authorities (CA) that the agent and the other processes managed by the agent can use to verify the authenticity of the Elasticsearch cluster used by the output or the monitoring endpoint. The Agent will need to persist that CA locally.

Checkin

The Agent will not use any locally defined CA to verify the remotes Elasticsearch cluster instead it will use the CA received when enrolling to identify the remote clusters.

Output and Monitoring

The Agent will not use any locally defined CA to verify the remotes Elasticsearch cluster instead it will use the CA received when enrolling to identify the remote clusters.

Changed needed

Fleet

  • Make sure Fleet can return the Hash
  • Make Fleet's enroll return the CA.

Agent

  • Add options for Agent's enroll subcommand to specify a hash.
  • Change behavior in the TLS handling of libbeat to support Certificate pinning
  • Allow the agent to securely the CA on disk.
  • Allow Libbeat Elasticsearch client to receive a CA in bytes and not only a file on disk.
@ph ph added discuss Issue needs further discussion. fleet labels Nov 12, 2019
@ph
Copy link
Contributor Author

ph commented Nov 12, 2019

cc @mattapperson and @clintongormley This is the current plan for trust?

@ph ph changed the title [Fleet] Agent's initial trust at enrollment and following calls [Fleet] Agent authentication model Nov 13, 2019
@nchaulet
Copy link
Member

@ph How do we plane to manage certificate expiration/rotation?

@scunningham
Copy link

@nchaulet You mean when the CA expires? That's going to be a pain. We'll have to build some mechanism that allows a CA swap out when we get within N days of the CA expiring. Ideally we have some kind of trusted time source as well. We'd have to defend an attacker tricking the system into swapping out the root of trust with a counterfeit.

Perhaps we could punt on this problem short term, and enforce a CA with an expiration of 2+ years. Maybe more if we can get away with it.

@ph
Copy link
Contributor Author

ph commented Nov 13, 2019

I think we can skip that for v1, and enforce 2+ sound like a good idea.

@ph
Copy link
Contributor Author

ph commented Feb 18, 2020

Going to close this and link all the related issues.

Opened related issues based on the conclusion above:

@ph ph closed this as completed Feb 18, 2020
@ph
Copy link
Contributor Author

ph commented Feb 18, 2020

Note only the kibana issue are still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependency:Endpoint discuss Issue needs further discussion.
Projects
None yet
Development

No branches or pull requests

5 participants