Skip to content

E07: Structured Data #9

@DavidCozens

Description

@DavidCozens

Standard IANA-registered structured data per RFC 5424, targeting IEC 62443 SL 2
compliance. Replaces the hardcoded NILVALUE - with real SD-ELEMENTs.

RFC: https://datatracker.ietf.org/doc/html/rfc5424 (sections 6.3, 7.1–7.3, 9)

Design

SD objects are injected at logger creation, following the existing config injection
pattern. Each SD object owns its own state — e.g. the sequenceId object owns an
atomic counter. SD is formatted once per message at Log time.

Per-instance SD (timeQuality, origin) is pre-formatted at Create and stamped into
every message. sequenceId increments its counter on each format call.

In future, the sequenceId counter may need to be initialisable from stored data
to support persistent buffering (E05).

Stories

Story Title Status
S07.01 (#65) sequenceId — injectable SD object with atomic counter, replaces NILVALUE - Done
S07.02 (#66) timeQuality — injected via config, reflects clock sync state Done
S07.03 (#67) origin — software, swVersion, enterpriseId injected via config Done
S07.04 (#68) SD escaping and validation — ", \, ] escaping, PRINTUSASCII enforcement on SD-ID/SD-PARAM names Todo
S07.05 (#75) origin — enterpriseId and ip parameters Todo
S07.06 (#193) meta — sysUpTime and language parameters Needs refinement

BDD woven into each story. S07.01 drives the SD serialisation infrastructure.
S07.02–S07.03 are incremental additions. S07.04 hardens escaping and character validation.
S07.05 adds optional origin parameters deferred from S07.03.
S07.06 adds the remaining meta parameters (sysUpTime, language) to complete RFC 5424 IANA SD coverage — open for refinement before pulling in.

Research: standards context

IEC 62443 does not name RFC 5424 SD-IDs directly, but its requirements create
strong implied needs at SL 2+:

SD-ID Standard basis Rationale
meta.sequenceId SR 2.9 (Audit Storage Protection) Gap detection in audit trails
timeQuality SR 2.11 (Timestamps) SL 2+ requires demonstrating clock synchronisation
origin CR 2.8 (Auditable Events) Audit records must identify the source component

IANA-registered SD-ID details

timeQuality (RFC 5424 §7.1): tzKnown (0/1), isSynced (0/1),
syncAccuracy (microseconds). Per-instance — clock properties are system-level.

origin (RFC 5424 §7.2): ip, enterpriseId, software, swVersion.
Per-instance — fixed for the lifetime of a logger.

meta (RFC 5424 §7.3): sequenceId (monotonic counter), sysUpTime,
language. sequenceId is per-message; others are per-instance.

Out of scope

  • Custom/enterprise SD-IDs (per-message, caller-built) — deferred to E14 (E14: Custom Structured Data #64)
  • ssign / ssign-cert (RFC 5848 message signing) — complex, potentially its own epic

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicEpic issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions