-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Graphite output plugin: Enable secure connection #2602
Graphite output plugin: Enable secure connection #2602
Conversation
False failure can someone rebuild it please. |
@dheerajdwivedi can you write some tests so we can support this long term. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current test situation is fine for this one.
plugins/outputs/graphite/graphite.go
Outdated
@@ -34,6 +50,16 @@ var sampleConfig = ` | |||
template = "host.tags.measurement.field" | |||
## timeout in seconds for the write connection to graphite | |||
timeout = 2 | |||
|
|||
## Enable secure tunnel | |||
ssl_enabled = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need this option, enabling a secure connection can be based on the tlsConfig being nil or not.
plugins/outputs/graphite/graphite.go
Outdated
# ssl_cert = "/etc/telegraf/cert.pem" | ||
# ssl_key = "/etc/telegraf/key.pem" | ||
## Use SSL but skip chain & host verification | ||
# insecure_skip_verify = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent this section to 2 spaces
plugins/outputs/graphite/graphite.go
Outdated
var conn net.Conn | ||
if g.SSLEnabled { | ||
// If ssl is enabled make secure tcp connection | ||
conn, err = tls.Dial("tcp", server, g.tlsConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to use timeout with tls connections. Should be able to do this using tls.DialWithDialer.
I think its possible to just use a nil tls.Config to do a insecure connection, but not sure. This way you don't need the branch.
plugins/outputs/graphite/graphite.go
Outdated
if err == nil { | ||
// Append successful connections |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
Removing ssl enabled flag
Fix code formating
Thanks! Will be included in 1.4.0. |
Hello, The current configuration to establish an TLS/SSL connection between Telegraf and Graphite is made via the output plugin, setting these options in Telegraf:
However, on Graphite side, it doesn't seem so clear how to set it up. I assume it is possible (or at least it was at the time you added this option). Could you please tell me how was the setup with Graphite you used to test the TLS/SSL connection between Telegraf and Graphite, at the time you added these options? Thanks a lot |
Feature Request
Proposal:
We are looking to use hosted solution for graphite.
Since the communication is over internet it needs to be secure.
Hence the support for tls over tcp is required.
Current behavior:
Insecure communication between telegraf client and server
Desired behavior:
Secure the communication between client and server
Use case:
Graphite hosted solutions where data flows over internet.
To avoid middleman attack, hence secure the auth credentials and metrics data between client and server