Skip to content

feat: add vault audit tcp protocol support#26

Merged
ncode merged 4 commits intomainfrom
juliano/tcp_support
Feb 13, 2026
Merged

feat: add vault audit tcp protocol support#26
ncode merged 4 commits intomainfrom
juliano/tcp_support

Conversation

@ncode
Copy link
Owner

@ncode ncode commented Feb 13, 2026

This pull request introduces support for TCP as an alternative protocol for Vault audit log delivery, alongside UDP. It updates configuration options, command-line flags, and documentation to allow users to select between UDP and TCP for audit log transport. The implementation includes validation of the protocol, ensures proper propagation throughout the setup and server commands, and adds comprehensive tests for both protocols. Additionally, integration test infrastructure is updated to facilitate TCP testing with Vault running in Docker.

Protocol support and configuration:

  • Added vault.audit_protocol option (default: udp) to configuration, command-line flags, and environment variables, allowing users to specify either udp or tcp for audit log delivery. Validation ensures only supported values are accepted. (cmd/root.go, README.md, cmd/root_test.go) (F82499c3L68R68, F82499c3L96R96, F82499c3L112R112, [1] [2] [3] F95df156L67R67)
  • Updated setup and auditServer commands to use the selected protocol in Vault audit device configuration and server listening address. (cmd/setup.go, cmd/auditServer.go) [1] [2] [3] [4]

Testing and validation:

  • Added unit tests for protocol validation and listen address generation; extended setup tests to cover both UDP and TCP, and added error handling for invalid protocol values. (cmd/root_test.go, cmd/setup_test.go, cmd/auditServer_test.go) (F95df156L67R67, [1] [2] [3] Fc6ad765L64R64)
  • Introduced a new integration test for TCP audit log delivery, including helper functions to determine the correct audit address for Docker environments. (integration_test.go, Makefile, docker-compose.yml) [1] [2] [3] [4]

Documentation updates:

  • Revised README.md to document the new protocol option, usage instructions, and Docker integration test requirements. (README.md) [1] [2] [3] [4] [5]

Spec tracking:

  • Added an OpenSpec change archive entry for the protocol addition. (openspec/changes/archive/2026-02-13-add-tcp-audit-protocol/.openspec.yaml)

@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.07%. Comparing base (6fdd99c) to head (3ca7608).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   95.64%   96.07%   +0.42%     
==========================================
  Files          10       10              
  Lines         551      611      +60     
==========================================
+ Hits          527      587      +60     
  Misses         19       19              
  Partials        5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ncode ncode merged commit b2bcdbc into main Feb 13, 2026
5 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.

2 participants

Comments