-
Notifications
You must be signed in to change notification settings - Fork 210
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
Add default TLS client cert and key paths for Prometheus input and receiver #1510
base: main
Are you sure you want to change the base?
Conversation
var DEFAULT_TLS_CA_FILE_PATH = filepath.Join("/etc", "amazon-cloudwatch-observability-agent-cert", "tls-ca.crt") | ||
var ( | ||
DefaultTLSCaFilePath = filepath.Join("/etc", "amazon-cloudwatch-observability-agent-cert", "tls-ca.crt") | ||
DefaultTLSCertFilePath = filepath.Join("/etc", "amazon-cloudwatch-observability-agent-outbound-cert", "client.crt") |
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 know that we already have amazon-cloudwatch-observability-agent-cert
used in a couple of places. Is the outbound-cert new? Is it only for TA?
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.
The outbound-cert
is only for when the agent behaves as a client in mTLS. Right now, it's only being used for when the agent acts as a client to the TA server, but it could be used against other servers too.
amazon-cloudwatch-observability-agent-client-cert
-> client cert and key for fluent-bitamazon-cloudwatch-observability-agent-server-cert
-> server cert and key for agent (technically can be used in this place, but avoided due to separation of concerns)amazon-cloudwatch-observability-agent-cert
-> server cert and key for dcgm, neuron, and taamazon-cloudwatch-observability-agent-outbound-cert
-> client cert and key for agent
Description of the issue
The Prometheus input and receiver within the CloudWatch Agent do not have default TLS client certificate and key file paths set. Without these default paths, the agent does not know which certificate to use for mutual TLS authentication with the Target Allocator server. This prevents the agent from properly connecting to the Target Allocator, as the agent cannot locate the required TLS certificates.
Description of changes
Important
Co-PRs: 1) aws-observability/helm-charts#163; 2) aws/amazon-cloudwatch-agent-operator#284
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
helm upgrade --install --debug amazon-cloudwatch-observability helm-charts/charts/amazon-cloudwatch-observability --set clusterName=<cluster_name> --set region=us-west-2 --namespace amazon-cloudwatch --create-namespace
with custom helm charts (Implement mTLS resources for CloudWatch Agent client aws-observability/helm-charts#163) and editedvalues.yaml
with a custom agent and prometheus configuration.Requirements
Before commit the code, please do the following steps.
make fmt
andmake fmt-sh
make lint