Skip to content

HLD - Audit Logging daemon for command tracking and RADIUS accounting#2448

Open
rsh2prasad wants to merge 3 commits into
sonic-net:masterfrom
rsh2prasad:rakprasa/radius_aaa_hld
Open

HLD - Audit Logging daemon for command tracking and RADIUS accounting#2448
rsh2prasad wants to merge 3 commits into
sonic-net:masterfrom
rsh2prasad:rakprasa/radius_aaa_hld

Conversation

@rsh2prasad

@rsh2prasad rsh2prasad commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • Adds a SONiC HLD for auditlogd, a new sonic-host-services daemon that streams every command executed on the switch to configured RADIUS servers as RFC 2866 Accounting-Requests, providing a central, tamper-resistant audit trail of privileged actions.
  • Covers daemon architecture and threading model (main thread + monitor thread, with per-server worker threads for RADIUS delivery), the four internal roles (daemon controller, audit-event monitor, audit logger, RADIUS accounting client), consumption of the existing RADIUS_SERVER / MGMT_INTERFACE / DEVICE_METADATA tables (including per-server timeout and retransmit), RFC 2865 / 2866 retransmit behavior (same packet reused across retries so servers can dedupe), NETLINK_AUDIT consumption with multi-record event reassembly, per-server health tracking with a global back-pressure loop that pauses consumption when no RADIUS server is reachable, feedback-loop prevention (kernel-level PID exclusion plus user-space filtering of audit tooling), and systemd integration.

Motivation

SONiC currently has no built-in way to produce a centralized, RADIUS-based audit trail of privileged commands executed on a switch. auditlogd fills that gap by consuming kernel audit events over NETLINK_AUDIT and emitting one RFC 2866 Accounting-Request per command to the RADIUS servers already configured in CONFIG_DB. The daemon is a pure consumer: it does not authenticate users, does not change how SONiC does RADIUS auth today, has no dependency on 802.1x/PAC, and introduces no new CONFIG_DB tables or fields. Accounting is best-effort by design — during sustained RADIUS outages the daemon pauses cleanly rather than growing memory or blocking user commands.

Test plan

  • Documentation review by SONiC community / security WG
  • Unit tests under tests/auditlogd/
  • Follow-up implementation PRs in sonic-host-services per this HLD

Related work

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@rsh2prasad rsh2prasad changed the title Radius AAA Authentication & Accounting HLD HLD - Audit Logging daemon for command tracking and RADIUS accounting Jul 7, 2026
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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


## 2. Scope

This document describes the high-level design of `auditlogd`, a new host-level daemon in `sonic-host-services` that streams every command executed on a SONiC switch to configured RADIUS servers as an RFC 2866 **Accounting-Request**, providing operators with a central, tamper-resistant audit trail of privileged actions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why introduce a standalone auditlogd instead of leveraging the existing Linux auditd plugin framework?

1. Must consume kernel audit events promptly to avoid `ENOBUFS` from the kernel.
2. A slow or unresponsive RADIUS server must not block delivery to other servers or audit-event consumption.
3. The daemon must run as root (required for netlink audit and audit-rule management).
4. Restart must be capped by systemd to prevent crash-loops.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How are audit events handled when auditlogd crashes, restarts, or the Netlink receive queue overflows?

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.

4 participants