Skip to content

Audit log in successful connection cases - #1280

Merged
ckoellin merged 14 commits into
ni:mainfrom
ryanwixon-emerson:successLogging
Aug 12, 2026
Merged

Audit log in successful connection cases#1280
ckoellin merged 14 commits into
ni:mainfrom
ryanwixon-emerson:successLogging

Conversation

@ryanwixon-emerson

@ryanwixon-emerson ryanwixon-emerson commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What does this Pull Request accomplish?

This PR adds simple audit logging capabilities to grpc-device. We're using spdlog to log to the Windows Event Log and Syslog.

gRPC includes GlobalCallbacks functionality which allows us to define functions invoked at every RPC call. This allows us to easily log the existence of successfully connected clients.

The current logging functionality in grpc-device provides an API to log to the terminal and a corresponding API to override this function with your own custom option. This applies for all logging. Since overriding with a spdlog API would affect all callers, I've instead opted to add a new log_to_audit_source function which will always use the spdlog sync.

Why should this Pull Request be merged?

Our goal is to add audit logging for the CRA. The server should log a message when clients succeed/fail when authenticating. This PR adds the required framework to make this possible and implements the success scenario.

A future PR to add functionality to log when a client fails to authenticate will follow.

What testing has been done?

I tested this in a Windows -> Windows workflow and confirmed that the audit events appear in Windows Event Log as expected. Due to the difficulty of testing other workflows, I'll wait until this is merged to check Linux workflows.

@ryanwixon-emerson
ryanwixon-emerson marked this pull request as ready for review July 29, 2026 20:08
@ryanwixon-emerson ryanwixon-emerson changed the title Log in successful connection cases Audit log in successful connection cases Jul 29, 2026
@ckoellin
ckoellin self-requested a review July 29, 2026 20:15

@ckoellin ckoellin left a comment

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.

A few things to fix but overall looks good.

Comment thread source/server/client_connection_logger.cpp Outdated
Comment thread CMakeLists.txt
Comment thread source/server/client_connection_logger.cpp
Comment thread .gitmodules
Comment thread source/server/logging.cpp Outdated
Comment thread source/server/logging.cpp Outdated
Comment thread source/server/client_connection_logger.cpp
Comment thread source/server/client_connection_logger.cpp
Comment thread source/server/client_connection_logger.cpp
Comment thread README.md
Comment thread README.md Outdated
Comment thread source/server/client_connection_logger.cpp Outdated
Comment thread source/server/client_connection_logger.h
Comment thread source/server/client_connection_logger.cpp
Comment thread CMakeLists.txt
@ckoellin
ckoellin merged commit 8141a4b into ni:main Aug 12, 2026
9 checks passed
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.

6 participants