Skip to content

Audit Logging signal#5059

Closed
hilmarf wants to merge 18 commits into
open-telemetry:mainfrom
apeirora:upstream
Closed

Audit Logging signal#5059
hilmarf wants to merge 18 commits into
open-telemetry:mainfrom
apeirora:upstream

Conversation

@hilmarf

@hilmarf hilmarf commented Apr 28, 2026

Copy link
Copy Markdown

Overview

This pull request introduces a new Audit Logging signal to OpenTelemetry—a purpose-built observability pipeline for security-relevant events that satisfies compliance requirements such as ISO 27001, SOC 2, PCI-DSS, and HIPAA.

Motivation

The existing OpenTelemetry Logs signal is designed for general-purpose observability and intentionally permits sampling, back-pressure shedding, and record transformation. These behaviors are incompatible with audit logging, where:

  • Every record MUST be delivered without loss or modification to the designated audit sink
  • Records MUST NOT be sampled or dropped for any reason
  • Integrity verification is mandatory for tamper-evidence

A dedicated Audit Logging signal provides:

  • A purpose-built SDK pipeline with no sampling and at-least-once delivery semantics
  • A distinct OTLP endpoint (/v1/audit) for network-level isolation from observability backends
  • A dedicated data model with mandatory integrity fields and optional digital signatures
  • Clear separation of audit records from operational logs

SIG request

open-telemetry/community#2409

Changes

This PR adds comprehensive specification documentation and establishes the complete audit logging framework:

New Documents

  • OTEP 0267 – Complete Audit Logging Signal proposal (motivations, design rationale, trade-offs)
  • README.md – Introduction and signal overview
  • api.md – Audit Logging API specification (AuditProvider, AuditLogger, emit semantics)
  • data-model.md – AuditRecord and AuditReceipt data models with detailed field specifications
  • sdk.md – SDK implementation requirements (queuing, processors, exporters, failure handling)
  • collector.md – Tier-2 Collector specification for enterprise multi-sink deployments

Key Features

Guaranteed Delivery – At-least-once delivery with durable (disk-backed) queuing
Integrity Protection – Optional asymmetric signatures or symmetric HMACs for tamper-evidence
No Partial Success – OTLP receivers reject entire batches if any record fails
Clock Skew Detection – Dual timestamps (event vs. observed) enable clock synchronization verification
Idempotency – RecordId as idempotency key prevents duplicate audit entries on retries
Hash-Chain Support – Optional SequenceNo and PrevHash fields for ordered stream integrity
Compliance Ready – ISO 27001 Annex A requirements built into the core design

Data Model Highlights

AuditRecord – Mandatory fields:

  • RecordId, Timestamp, ObservedTimestamp, EventName
  • Actor, ActorType, Action, Outcome
  • Optional: TargetResource, SourceIP, Signature, Algorithm, Certificate, Hmac, SequenceNo, PrevHash

AuditReceipt – Proof-of-delivery returned by sink:

  • RecordId (echoed), IntegrityHash (SHA-256), SinkTimestamp

Specification Status

  • Status: Development
  • Prototype Implementations: Planned for Java and Go SDKs
  • OTLP Transport: Uses standard LogRecord protobuf with audit=true flag; dedicated /v1/audit endpoint

References

  • Implements compliance requirements from ISO 27001 Annex A, SOC 2, PCI-DSS, HIPAA
  • Extends OTEP 0092 (Logs Vision) and OTEP 0202 (Events and Logs API) patterns
  • Reuses OTLP LogRecord as transport container for efficiency

@hilmarf

hilmarf commented Apr 28, 2026

Copy link
Copy Markdown
Author

apeirora#6

Comment thread oteps/0267-audit-logging.md Outdated
Comment on lines +128 to +129
| `Algorithm` | `string` | Algorithm used for the digital signature (e.g., `RS256`, `ES256`). |
| `Certificate` | `bytes` | Digital public certificate used for the signature verification. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To increase efficiency wouldn't this make sense to be captured at a higher level ie instrumentation scope?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

As far as I know instrumentation scopes do not allow additional attributes. But you are right, we can move it to the resource entity.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instrumentation scopes do allow attributes https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/common/v1/common.proto

I was more thinking of making them first class fields.

Comment thread oteps/0267-audit-logging.md Outdated
| `Outcome` | `enum` | `SUCCESS`, `FAILURE`, `UNKNOWN`. MUST be set. |
| `Resource` | `AnyValue` | The target resource (file, endpoint, table, …). SHOULD be set. |
| `Action` | `string` | Verb describing what was done (e.g. `READ`, `WRITE`, `DELETE`, `LOGIN`). MUST be set. |
| `SourceIP` | `string` | Source network address, if applicable. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not just use the attribute?

Comment thread oteps/0267-audit-logging.md Outdated
| `Timestamp` | `fixed64` | Nanoseconds since UNIX epoch (UTC). MUST be set. `<= ObservedTimestamp <= now(UTC)` |
| `ObservedTimestamp` | `fixed64` | Nanoseconds since UNIX epoch when the SDK observed the event. Used for clock skew detection. MUST be set. `>= Timestamp <= now(UTC)` |
| `EventName` | `string` | Semantic name of the audit event (e.g. `user.login.success`). MUST be set. |
| `Actor` | `AnyValue` | Identity that performed the action (user ID, service account, …). MUST be set. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would this be better as a map?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Would this be better as a map?

Why? I do understand the attribute thing (above), but don't get your idea behind why this should be a map?

@thompson-tomo thompson-tomo Apr 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If it was a map, it would behave like attributes & enable us to define more structure to it while we enabling linking etc. Alternatively they just end as attributes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ok, gotcha - now it's an attribute combination: audit.actor.type + audit.actor.id

Comment thread oteps/0267-audit-logging.md Outdated
| `Actor` | `AnyValue` | Identity that performed the action (user ID, service account, …). MUST be set. |
| `ActorType` | `enum` | `USER`, `SERVICE`, `SYSTEM`. MUST be set. |
| `Outcome` | `enum` | `SUCCESS`, `FAILURE`, `UNKNOWN`. MUST be set. |
| `Resource` | `AnyValue` | The target resource (file, endpoint, table, …). SHOULD be set. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could attributes make more sense so it can be correlated with semconv attributes & other signals?

| SHA-256 receipt requires a round-trip to the sink | The receipt is optional for callers that do not need proof-of-delivery; a fire-and-forget async mode MAY omit it. |
| Disk-backed queue introduces a dependency on localStorage | This is opt-in; the default is an in-memory queue with blocking back-pressure. |

## Prior art and alternatives

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Has it been considered adding an additional event_kind property to the log record and having dedicated queues based on event kind that way we don't need new api but rather just new method/parameter. This would address queue overflow.

We could extend exporters to only process the defined event_kind that way we could have different endpoints based on event_kind.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, we have evaluated the option to just add one 'flag': open-telemetry/semantic-conventions#3469

We could extend exporters to only process the defined event_kind that way we could have different endpoints based on event_kind.

Could you elaborate on this a bit more? Would this different endpoint allow us to get the AuditReceipt? How would the receiver (e.g. in OTel Collector) look like?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Alternative 1 is the only documented similiar approach however it differs significantly. Difference being rather than using a single shared queue and being at risk of overflow, the queue is split based on event_kind hence removes that risk.

Audit Receipt is something that could be added as an additional field to the current log response. This field would only be sent if requested via the request.

For the collector if the event_kind is audit, then it should either not allow processing or only a simplified processor which can only add attributes.

@pellared

This comment was marked as resolved.

@hilmarf

hilmarf commented Apr 29, 2026

Copy link
Copy Markdown
Author

Thanks a lot @thompson-tomo for all your early inputs!

@hilmarf

This comment was marked as outdated.

@pellared

This comment was marked as outdated.

hilmarf added 16 commits April 29, 2026 14:48
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Durability at the sink is out of scope

Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
#2

Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
replaces #1

Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
This reverts commit f7f5dd7.
This reverts commit a5550bc.
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
... that uses the standard dedicated
`LogRecord` fields for universal concepts and carries all
audit-specific data as `Attributes` following the `audit.*` semantic
convention namespace

Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
hilmarf added 2 commits April 29, 2026 15:04
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
@reyang

reyang commented Apr 29, 2026

Copy link
Copy Markdown
Member

Hi @hilmarf, thank you for pushing on this!

I have a stepping back question - since this PR is trying to expand the scope of the OpenTelemetry project, we need to agree on the direction first. Do you have updates on open-telemetry/community#2409, do we see more demands to make it a priority for OpenTelemetry? I don't think we can accept this PR before the project proposal is accepted.

@github-actions

Copy link
Copy Markdown

This PR was marked stale. It will be closed in 14 days without additional activity.

@github-actions github-actions Bot added the Stale label May 14, 2026
@github-actions

Copy link
Copy Markdown

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions Bot closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants