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

[openTelemetry-audit] Adds plugin of OpenTelemetry Audit Logs #556

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

olandr
Copy link
Contributor

@olandr olandr commented Dec 16, 2024

This adds a plugin for OpenTelemetry ingestion of audit relevant signals. This will be a separate plugin from the 'OpenTelemetry' plugin, because it will most likely have different requirements.

This is an initial pull to create the foundation of the plugin.

@olandr olandr changed the title feature/audit otel [open-telemetry-audit] Adds plugin for auditing using open-telemetry Dec 16, 2024
@olandr olandr changed the title [open-telemetry-audit] Adds plugin for auditing using open-telemetry [openTelemetry-audit] Adds plugin for auditing using open-telemetry Dec 16, 2024
This is an initial commit which just copies over the already existing otel plugin.
Simply because the foundation for this otel-audit plugin will be based on the otel plugin.

---------

Signed off by: Simon Olander ([email protected])
@olandr olandr force-pushed the feature/audit-otel branch from 941e4ee to 97213c7 Compare December 19, 2024 15:50
@olandr olandr changed the title [openTelemetry-audit] Adds plugin for auditing using open-telemetry [openTelemetry-audit] Adds plugin of OpenTelemetry Audit Logs Dec 19, 2024
@olandr olandr force-pushed the feature/audit-otel branch 2 times, most recently from 8bd7f02 to 58a1375 Compare December 19, 2024 16:13
…specifics

- Defines a name opentelemetry-audit for the plugin
- Adds the substring 'audit' to various resource to not conflict with other resources.
- Adds architecture diagram

---------

Signed off by: Simon Olander ([email protected])
@olandr olandr force-pushed the feature/audit-otel branch from 58a1375 to 87f627e Compare December 19, 2024 16:15
@olandr olandr marked this pull request as ready for review December 19, 2024 16:16
@olandr olandr requested a review from a team as a code owner December 19, 2024 16:16
metadata:
name: opentelemetry-audit
spec:
version: 0.6.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Start with a new versioning, instead of following the original OTel plugin versioning, the same is true for the helmChart.version

version: 0.6.1
displayName: OpenTelemetry for Audit Logs
description: Audit Logs relevant Observability framework for instrumenting, generating, collecting, and exporting telemetry data such as traces, metrics, and logs.
icon: https://raw.githubusercontent.com/cloudoperators/greenhouse-extensions/main/opentelemetry/logo.png
Copy link
Member

@timojohlo timojohlo Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can change the icon so the difference between the two plugins becomes recognizable? Could be just include a simple writing "audit"

apiVersion: v2
appVersion: v0.114.0
name: opentelemetry-audit-operator
version: 0.6.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as in the PluginDefinition: Start with a new versioning, instead of following the original OTel plugin versioning

apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: metrics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to audit-logs-metrics or something unique


{{/* Generate plugin specific labels */}}
{{- define "plugin.labels" -}}
plugindefinition: opentelemetry
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value should be referring to the audit plugin


{{- if .Values.openTelemetry.metricsCollector.enabled }}
@test "Verify successful deployment and running status of the metrics-collector" {
try "at most 5 times every 10s to get pods named 'metrics-collector' and verify that '.status.phase' is 'running'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment in metrics-collector.yaml: Rename this to audit-logs-metrics or something unique

for: 5m
labels:
severity: warning
runbook_url: https://github.com/cloudoperators/greenhouse-extensions/tree/main/opentelemetry/playbooks/FilelogRefusedLogs.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even if its just a boilerplate for now, you can change it to referring to audit-opentelemetry, same for the other alerts here and in operator-alerts.yaml

@@ -0,0 +1,41 @@
groups:
- name: collector-alerts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename it to audit-collector-alerts

@@ -0,0 +1,28 @@
groups:
- name: operator-alerts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename it to audit-operator-alerts

enabled: false

# Empty variables will fail during rollout
openTelemetry:
Copy link
Member

@timojohlo timojohlo Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to change the name to audit-openTelemetry (or similar) so we can dinstinguish it a bit better. This should then be done for all entries, including the PluginDefinition

apiVersion: greenhouse.sap/v1alpha1
kind: PluginDefinition
metadata:
name: opentelemetry-audit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The directory for this Plugin is called audit-opentelemetry while the Plugin is called opentelemetry-audit. I would suggest to make it consistent and name the directory opentelemetry-audit.

helmChart:
name: opentelemetry-operator
repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts
version: 0.6.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment about versioning

port: prometheus
selector:
matchLabels:
app.kubernetes.io/component: opentelemetry-collector
Copy link
Member

@timojohlo timojohlo Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename it to opentelemetry-audit-collector or similar

Copy link
Member

@timojohlo timojohlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Overall it looks good. Most of the comments are about naming.

I still would prefer to add each component successively when needed but I am fine with this approach as well.

I like the architecture image!

Small addition: You can also include the directory-path here: https://github.com/cloudoperators/greenhouse-extensions/blob/main/.github/licenserc.yaml (as done with opentelemetry). This will then ignore automatically adding license headers and fix the failing check (see below).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants