Skip to content

Support audit log #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

flpanbin
Copy link

@flpanbin flpanbin commented Jun 30, 2025

Summary

This PR introduces an audit logging feature to ttyd, allowing the recording of user input commands for security and compliance purposes. The following new command-line options are added:

  • --audit-enable: Enable command audit logging.
  • --audit-log-file <path>: Specify the audit log file path (default: /var/log/ttyd/audit.log).
  • --audit-field <key=value>: Add custom fields to each audit log entry. This option can be used multiple times to include additional metadata.

Features

  • Audit Logging: When enabled, ttyd records all user input commands to the specified log file.
  • Custom Fields: Users can add custom key-value fields to each log entry for enhanced traceability.
  • Log Rotation: The audit log supports automatic rotation based on file size (default size is 10MB), ensuring logs do not grow indefinitely.

Usage:

ttyd --audit-enable --audit-log-file /var/log/ttyd/audit-tmp.log --audit-field=cluster=cluster1 --audit-field=namespace=ns3 --audit-field=username=user1

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.

1 participant