Skip to content

Commit 1cb0218

Browse files
committed
feat(audit-logs): adds otel-collector for auditing purposes, initial version
This adds an audit-logs otel-collector for the purpose of audit logs. At this point in time only 'audit-poller' information is ingested and sent to OpenSearch. --------- on-behalf-of: @SAP Simon Olander (simon.olander@sap.com)
1 parent aa75697 commit 1cb0218

22 files changed

+1006
-0
lines changed

system/audit-logs-otel/Chart.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
dependencies:
2+
- name: audit-logs-otel
3+
repository: file://../../../extensions-greenhouse/audit-logs-otel/charts
4+
version: 0.0.2
5+
- name: audit-poller
6+
repository: file://vendor/audit-poller
7+
version: 0.0.38
8+
- name: owner-info
9+
repository: oci://keppel.eu-de-1.cloud.sap/ccloud-helm
10+
version: 1.0.0
11+
- name: linkerd-support
12+
repository: oci://keppel.eu-de-1.cloud.sap/ccloud-helm
13+
version: 0.1.3
14+
digest: sha256:43eb7fd718df96936780697d4b9fe5c2f13915bc41a576b6e23627155899141e
15+
generated: "2025-08-18T16:02:41.96179+02:00"

system/audit-logs-otel/Chart.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: v2
5+
name: audit-logs-otel
6+
description: OpenTelemetry Collector Helm chart for audit-logs
7+
icon: https://raw.githubusercontent.com/cncf/artwork/a718fa97fffec1b9fd14147682e9e3ac0c8817cb/projects/opentelemetry/icon/color/opentelemetry-icon-color.png
8+
type: application
9+
version: 0.0.2
10+
appVersion: "v0.121.0"
11+
maintainers:
12+
- name: olandr
13+
- name: kuckkuck
14+
- name: timojohlo
15+
sources:
16+
- https://github.com/cloudoperators/greenhouse-extensions
17+
dependencies:
18+
- name: audit-logs-otel
19+
alias: openTelemetryPlugin
20+
#repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts
21+
repository: file://../../../extensions-greenhouse/audit-logs-otel/charts
22+
version: 0.0.2
23+
condition: openTelemetry.enabled
24+
25+
- name: audit-poller
26+
alias: auditPoller
27+
repository: file://vendor/audit-poller
28+
version: 0.0.38
29+
condition: auditPoller.enabled
30+
31+
- name: owner-info
32+
repository: oci://keppel.eu-de-1.cloud.sap/ccloud-helm
33+
version: 1.0.0
34+
35+
- name: linkerd-support
36+
repository: oci://keppel.eu-de-1.cloud.sap/ccloud-helm
37+
version: 0.1.3
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
auditLogs:
5+
openSearchLogs:
6+
failover_username_a: testusera
7+
failover_password_a: passworda
8+
failover_username_b: testuserb
9+
failover_password_b: passwordb
10+
endpoint: test-endpoint
11+
index: test
12+
cluster: test
13+
region: test

system/audit-logs-otel/logo.png

23.1 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{- define "auditpoller.receiver" }}
2+
filelog/auditpoller:
3+
include_file_path: true
4+
include: [ /audit/*.log ]
5+
exclude: [ /audit/*.pos ]
6+
{{ end }}
7+
8+
{{- define "auditpoller.processors" }}
9+
10+
transform/auditpoller:
11+
error_mode: ignore
12+
log_statements:
13+
- context: log
14+
statements:
15+
- set(log.time_unix_nano, log.observed_time_unix_nano)
16+
- merge_maps(log.attributes, ParseJSON(log.body), "upsert") where IsMatch(log.body, "^\\{")
17+
18+
attributes/auditpoller:
19+
actions:
20+
- action: insert
21+
key: log.type
22+
value: "auditpoller"
23+
- action: insert
24+
key: audit.source
25+
value: "ias-auditlog"
26+
{{ end }}
27+
28+
{{- define "auditpoller.pipelines" }}
29+
logs/auditpoller_logs:
30+
receivers: [filelog/auditpoller]
31+
processors: [transform/auditpoller,attributes/auditpoller,k8sattributes,attributes/cluster]
32+
exporters: [forward]
33+
{{- end }}
34+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- define "failover.attributes" }}
2+
attributes/failover_username_b:
3+
actions:
4+
- action: insert
5+
key: failover_username_opensearch
6+
value: ${failover_username_b}
7+
{{- end }}
8+
9+
{{- define "failover.exporter" }}
10+
opensearch/failover_b:
11+
http:
12+
auth:
13+
authenticator: basicauth/failover_b
14+
endpoint: {{ .Values.openTelemetryPlugin.auditLogs.openSearchLogs.endpoint }}
15+
logs_index: ${index}-datastream
16+
{{- end }}
17+
18+
{{- define "failover.extension" }}
19+
basicauth/failover_b:
20+
client_auth:
21+
username: ${failover_username_b}
22+
password: ${failover_password_b}
23+
{{- end }}
24+
25+
{{- define "failover.pipeline" }}
26+
logs/failover_b:
27+
receivers: [failover]
28+
processors: [attributes/failover_username_b]
29+
exporters: [opensearch/failover_b]
30+
{{- end }}

0 commit comments

Comments
 (0)