Skip to content

[doc] MACsec: add MKA operational state and key rotation HLD - #2545

Open
liamkearney-msft wants to merge 5 commits into
sonic-net:masterfrom
liamkearney-msft:liamkearney-msft-macsec-mka-state-hld
Open

liamkearney-msft wants to merge 5 commits into
sonic-net:masterfrom
liamkearney-msft:liamkearney-msft-macsec-mka-state-hld

Conversation

@liamkearney-msft

@liamkearney-msft liamkearney-msft commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Define the final SONiC-side design for publishing MKA operational state, validating safe primary/fallback CAK rotation, and displaying that state through show macsec --mka.

The design:

  • assigns sole ownership of namespace-local MACSEC_MKA_SESSION_TABLE and MACSEC_MKA_PARTICIPANT_TABLE publication to macsecmgrd;
  • performs a sequential full sweep of configured MACsec ports every 20 seconds, with a hard two-second deadline per macsec_mka_list query and per-port failure isolation;
  • stores independent last_updated, query_status, config_status, and optional redacted config_error values, while deriving freshness only at consumption time;
  • defines healthy protected Controlled Port operation as kay_status=active, authenticated=false, secured=true, and failed=false—the WPA Authenticated field indicates authenticated-only, unprotected mode rather than successful MKA authentication;
  • requires the protected state above, query health, config consistency, age no greater than 60 seconds, correct participant roles, active state, and a live alternate CA before rollover;
  • requires macsecmgrd to revalidate immediately before remove-old/add-new actioning;
  • defines compact show macsec --mka output with natural interface sorting, a separate Secured column, and Status derived only from query/config/age health;
  • derives one detailed Controlled port mode value from the raw KaY fields: secured, authenticated-only, failed, inactive, inconsistent, or unknown; and
  • keeps existing APP_DB/ASIC programming tables, MACsecOrch, SAI, and WPA supplicant behavior unchanged.

Companion implementation

Scope

Documentation only. The HLD covers SONiC-side schema ownership, status collection, safe rotation preflight/actioning, failure reconciliation, namespace behavior, CLI presentation, and validation. WPA fallback behavior and control/status interfaces are consumed as the existing companion dependency.

Validation

  • Markdown table of contents, code fences, and sequential test-plan numbering validated.
  • Scheduler, deadline, freshness, failure-isolation, Controlled Port semantics, and Status/Age wording checked consistently across requirements, schemas, algorithms, examples, repository impact, and test plan.
  • Safe rotation requires authenticated=false,secured=true; authenticated-only or contradictory Controlled Port combinations are explicitly rejected.
  • Compact Status is limited to query health, configuration consistency, and age; Secured remains the separate compact protected/unprotected indication.
  • Detailed output derives Controlled port mode through an ordered mapping while preserving the raw STATE_DB fields and rotation-safety tuple.
  • No stale five-second, 15-second, concurrent scheduler, or stored-freshness wording remains.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 15, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: liamkearney-msft / name: Liam Kearney (8731fb4)

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Add the SONiC-side design for publishing MKA operational state, validating safe primary and fallback CAK rotation, actioning remove-then-add rollover, and exposing the state through show macsec --mka.

Signed-off-by: Liam Kearney <liamkearney@microsoft.com>
@liamkearney-msft
liamkearney-msft force-pushed the liamkearney-msft-macsec-mka-state-hld branch from 2c3be17 to 8731fb4 Compare September 15, 2026 11:17
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@rlhui

rlhui commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

can we add the PRs needed for this feature? thanks

Document the final namespace-local collection schedule, query deadlines, freshness threshold, compact Status/Age output, and companion implementation pull requests.

Signed-off-by: Liam Kearney <liamkearney@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Define healthy protected operation as authenticated false and secured true, reject authenticated-only or inconsistent states during rotation, and clarify operator-facing status labels.

Signed-off-by: Liam Kearney <liamkearney@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Keep compact Status limited to query health, configuration consistency, and age while presenting Controlled Port protection through Secured and detailed diagnostics.

Signed-off-by: Liam Kearney <liamkearney@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Present the raw KaY Controlled Port fields as one ordered detailed mode while preserving raw STATE_DB values, rotation predicates, and compact Secured output.

Signed-off-by: Liam Kearney <liamkearney@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants