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] Allow CA cert pinning on the Elasticsearch output or any code that user tlscommon.TLSConfig builder. #16019

Merged
merged 11 commits into from
Feb 10, 2020

Commits on Feb 7, 2020

  1. Add a sha256 pin for the CA Certificate

    When multiples CA are presents on the system we cannot ensure that a
    specific one was used to validates the chains exposer by the server.
    This PRs adds a `ca_sha256` option to the `tlscommon.TLSConfig` that is used by all
    the code that has to create a TCP client with TLS support.
    
    When the option is set, it will hook a new callback in the validation
    chains that will inspect the verified and validated chains by Go to
    ensure that a lets a certificate in the chains match the provided
    sha256.
    
    Usage example for the Elasticsearch output.
    
    ```
    output.elasticsearch:
      hosts: [127.0.0.1:9200]
      ssl.ca_sha256: <base64_encoded_sha1>
    ```
    
    You can generate the pin using the **openssl** binary with the
    following command:
    
    ```
    openssl x509 -in ca.crt -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
    ```
    
    OpenSSL's [documentation](https://www.openssl.org/docs/manmaster/man1/dgst.html)
    
    You will need to start Elasticsearch with the following options
    
    ```yaml
    xpack.security.enabled: true
    indices.id_field_data.enabled: true
    xpack.license.self_generated.type: trial
    xpack.security.http.ssl.enabled: true
    xpack.security.http.ssl.key: /etc/pki/localhost/localhost.key"
    xpack.security.http.ssl.certificate: /etc/pki/localhost/localhost.crt"
    xpack.security.http.ssl.certificate_authorities: /etc/pki/ca/ca.crt"
    ```
    
    This pull request also include a new service in the docker-compose.yml
    that will start a new Elasticsearch server with TLS and security
    configured.
    ph committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    550e747 View commit details
    Browse the repository at this point in the history
  2. Small blurps from testing.

    ph committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    73d4b3e View commit details
    Browse the repository at this point in the history
  3. Adjust comments

    ph committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    c265e50 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8f6ef0e View commit details
    Browse the repository at this point in the history
  5. changelog

    ph committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    2dcd55f View commit details
    Browse the repository at this point in the history
  6. Rename Err.

    ph committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    d2a3407 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    529c475 View commit details
    Browse the repository at this point in the history
  8. adding docs concerning insecure

    ph committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    b50df90 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    59e075c View commit details
    Browse the repository at this point in the history
  10. Make the CI happy.

    ph committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    59ff4d0 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2020

  1. Update CHANGELOG.next.asciidoc

    ph committed Feb 10, 2020
    Configuration menu
    Copy the full SHA
    e9604d2 View commit details
    Browse the repository at this point in the history