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

[Metricbeat] module HTTP server: Add TLS #11457

Closed
xeraa opened this issue Mar 26, 2019 · 7 comments
Closed

[Metricbeat] module HTTP server: Add TLS #11457

xeraa opened this issue Mar 26, 2019 · 7 comments
Labels
enhancement good first issue Indicates a good issue for first-time contributors Metricbeat Metricbeat module Team:Integrations Label for the Integrations team

Comments

@xeraa
Copy link

xeraa commented Mar 26, 2019

Describe the enhancement:

The Metricbeat module for HTTP server currently doesn't support TLS. This is less of an issue for connections on the same host, but to be able to collect data over the network this would be a good improvement.

Describe a specific use case for the enhancement or feature:

Logstash has an HTTP input that supports TLS. To be a lightweight alternative the Metricbeat module would need to add TLS, otherwise it's mainly useful on localhost. This started off from a discussion with @loekvangool.

@jsoriano jsoriano added enhancement Metricbeat Metricbeat module Team:Integrations Label for the Integrations team good first issue Indicates a good issue for first-time contributors labels Mar 26, 2019
@leopucci
Copy link
Contributor

go net/http already have https. it is just a matter of adjusting it.

Let me grab a coffee and play with this one :)

@andrewkroh
Copy link
Member

@leopucci Take a look at tlscommon.ServerConfig and how it's used. I think some of this can be reused.

TLS *tlscommon.ServerConfig `config:"ssl"`

@leopucci
Copy link
Contributor

@andrewkroh HttpHelper already have it! Thanks for the tip!

@leopucci
Copy link
Contributor

@andrewkroh, ListenAndServeTLS dos not acept certificate object, only certificate path... i will not be able to reuse config:ssl.... it was so beautiful
giphy (3)

@leopucci
Copy link
Contributor

Tadah!

capture-26

@leopucci
Copy link
Contributor

How to use:
add ssl config on http.yml

- module: http
  metricsets:
    - server
  host: "localhost"
  port: "8080"
  enabled: true
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
  ssl.certificate: "/etc/pki/client/cert.pem"
  ssl.key: "/etc/pki/client/cert.key"
  paths:
    - path: "/foo"
      namespace: "foo"
  #    fields: # added to the the response in root. overwrites existing fields
  #      key: "value"

@leopucci
Copy link
Contributor

@andrewkroh any bugs that i can help today? nice work btw https://github.com/andrewkroh/gvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Indicates a good issue for first-time contributors Metricbeat Metricbeat module Team:Integrations Label for the Integrations team
Projects
None yet
Development

No branches or pull requests

6 participants