-
Notifications
You must be signed in to change notification settings - Fork 87
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 support for elasticSearch typeless API #387
Add support for elasticSearch typeless API #387
Conversation
Signed-off-by: guipal <[email protected]>
c821e0f
to
bfadc55
Compare
Hello fjogeleit another minor change for elasticSearch compatibility. Not bumping helm chart just in case you wanna include something else. Thankyou! |
Hey @guipal, thanks for the contribution. I will check and the missing bump is fine. |
@@ -30,13 +30,14 @@ elasticsearch: | |||
skipTLS: {{ .Values.target.elasticsearch.skipTLS }} | |||
username: {{ .Values.target.elasticsearch.username | quote }} | |||
password: {{ .Values.target.elasticsearch.password | quote }} | |||
apiKey: {{ .Values.target.elasticsearch.password | quote }} | |||
apiKey: {{ .Values.target.elasticsearch.apiKey | quote }} |
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.
good catch 👍
@@ -76,12 +88,16 @@ func (e *client) Send(result v1alpha2.PolicyReportResult) { | |||
return | |||
} | |||
|
|||
zap.L().Info("ElasticSearch ApiKey" + e.apiKey) |
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 this was for debugging and should be removed now
if e.username != "" { | ||
req.SetBasicAuth(e.username, e.password) | ||
} else if e.apiKey != "" { | ||
req.Header.Add("Authorization", "ApiKey "+e.apiKey) | ||
} | ||
|
||
zap.L().Info("ElasticSearch Authorization Header" + req.Header.Get("Authorization")) |
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.
Same here
Signed-off-by: guipal <[email protected]>
Support for elastic search typeless API
Problem
As described in elastic docs. Starting from elastic version 8.0 APIs that accept types are removed and a new endpoint needs to be called.
Proposed Solution
Introduce a new configuration variable to enable usage of new endpoint to send data when using ES>8.0