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

Agent/ca sha256 #16217

Merged
merged 2 commits into from
Feb 12, 2020
Merged

Agent/ca sha256 #16217

merged 2 commits into from
Feb 12, 2020

Conversation

ph
Copy link
Contributor

@ph ph commented Feb 10, 2020

When you enroll an agent you can specify the certificate_authorities,
but when you fall back on the OS trust store you may want to be able to
check which CA was used to validate the remote server chain this PR
allow defining a CASHA256 to validate the remote server.

Based on work from #16019

The enrollment command will look like this.

agent enroll --ca_sha256 <ca_sha256pin> --certificate_authorities /etc/pki/root.ca https://localhost:5601 <enroll_api_key>

Fixes: #15718
Fixes: #15716

@ph ph added in progress Pull request is currently in progress. [zube]: In Progress Project:fleet labels Feb 10, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest (Project:fleet)

@ph ph self-assigned this Feb 10, 2020
@ph ph changed the title [WIP] Agent/ca sha256 Agent/ca sha256 Feb 10, 2020
@ph
Copy link
Contributor Author

ph commented Feb 10, 2020

jenkins test this please

When you enroll an agent you can specify the `certificate_authorities`,
but when you fallback on the OS trust store you may want to be able to
check which CA was used to validate the remote server chain this PR
allow to define a CASHA256 to validate the remote server.

Based on work from elastic#16019
@ph ph added review [zube]: In Review and removed in progress Pull request is currently in progress. labels Feb 12, 2020
@ph
Copy link
Contributor Author

ph commented Feb 12, 2020

@ruflin fyi look at the enrolment command in the description, this is what it will look like.

@ph
Copy link
Contributor Author

ph commented Feb 12, 2020

@michalpristas ready for review.

Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -97,12 +97,6 @@ func NewConfigFromURL(kURL string, CAs []string) (*Config, error) {
c.Username = username
c.Password = password

if len(CAs) > 0 {
c.TLS = &tlscommon.Config{
CAs: CAs,
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this option now? we use this to pass CAs as a root CAs to the client. but without having anything to pass i think we can remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are some case that we will still need to support passing a CAs, but this can done by altering the TLS field after.

@ph ph merged commit 02c6156 into elastic:fleet Feb 12, 2020
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
* Allow to use a ca_sha256 when enroll an Agent

When you enroll an agent you can specify the `certificate_authorities`,
but when you fallback on the OS trust store you may want to be able to
check which CA was used to validate the remote server chain this PR
allow to define a CASHA256 to validate the remote server.

Based on work from elastic#16019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants