nodetool disableauditlog
Disables audit logging on the node.
Synopsis
Section titled “Synopsis”nodetool [connection_options] disableauditlogSee connection options for connection options.
Description
Section titled “Description”nodetool disableauditlog deactivates the audit logging feature on a Cassandra node. When disabled, the node stops recording audit events for authentication, authorization, and CQL operations.
Non-Persistent Setting
This setting is applied at runtime only and does not persist across node restarts. After a restart, audit logging reverts to the configuration in cassandra.yaml:
audit_logging_options: enabled: true # or false logger: - class_name: BinAuditLogger included_keyspaces: excluded_keyspaces: system,system_schema,system_virtual_schema included_categories: excluded_categories:To permanently disable audit logging, set enabled: false in the audit_logging_options section of cassandra.yaml.
Compliance Impact
Disabling audit logging may violate regulatory compliance requirements. Ensure appropriate approvals before disabling in production environments subject to SOX, HIPAA, PCI-DSS, or similar regulations.
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool disableauditlogDisable and Verify
Section titled “Disable and Verify”nodetool disableauditlognodetool getauditlog# Expected: enabled: falseBehavior
Section titled “Behavior”When audit logging is disabled:
- No new audit events are recorded
- Existing audit logs remain on disk
- Audit log archival continues for existing files
- Performance overhead from auditing is eliminated
What Continues
Section titled “What Continues”| Feature | Status |
|---|---|
| Existing audit logs | Preserved |
| Log archival | Continues for existing logs |
| All database operations | Continue normally |
What Stops
Section titled “What Stops”| Feature | Status |
|---|---|
| New audit event recording | Stops |
| Audit log growth | Stops |
| Audit-related disk I/O | Stops |
When to Use
Section titled “When to Use”Emergency Performance Recovery
Section titled “Emergency Performance Recovery”If audit logging is causing performance issues:
# Check current impactnodetool tpstats
# Disable audit loggingnodetool disableauditlog
# Verify performance improvementnodetool tpstatsAfter Troubleshooting Session
Section titled “After Troubleshooting Session”When temporary auditing is no longer needed:
# Investigation completenodetool disableauditlog
# Verify disablednodetool getauditlogDisk Space Emergency
Section titled “Disk Space Emergency”If audit logs are consuming too much disk:
# 1. Disable new audit loggingnodetool disableauditlog
# 2. Archive or remove old audit logsmv /var/log/cassandra/audit/* /archive/
# 3. Verify disk space freeddf -h /var/log/cassandra/Before Maintenance
Section titled “Before Maintenance”Temporarily disable during maintenance to reduce overhead:
# Before maintenancenodetool disableauditlog
# Perform maintenance...
# After maintenance (if compliance requires)nodetool enableauditlog --included-categories AUTH,DML,DDL,DCLImpact Assessment
Section titled “Impact Assessment”Immediate Effects
Section titled “Immediate Effects”| Aspect | Impact |
|---|---|
| Audit event recording | Stops immediately |
| Disk I/O from auditing | Eliminated |
| Operation latency | May decrease slightly |
| Compliance coverage | Gaps in audit trail |
Compliance Implications
Section titled “Compliance Implications”| Scenario | Impact |
|---|---|
| Operations during disabled period | Not recorded |
| Security incidents | No audit trail |
| Access reviews | Incomplete data |
| Regulatory audits | Potential gap findings |
Audit Trail Gap
While audit logging is disabled, there is no record of database access. This creates a gap in the audit trail that may need to be documented and explained during compliance reviews.
Workflow: Controlled Disable/Enable
Section titled “Workflow: Controlled Disable/Enable”#!/bin/bashecho "=== Audit Logging Control ==="echo "WARNING: Disabling audit logging creates compliance gaps!"echo ""
# 1. Document current stateecho "1. Current audit configuration:"nodetool getauditlog
# 2. Log the disable actionecho ""echo "2. Logging disable action..."echo "$(date): Audit logging disabled by $(whoami) - Reason: [DOCUMENT REASON]" >> /var/log/cassandra/audit_changes.log
# 3. Disable audit loggingecho ""echo "3. Disabling audit logging..."nodetool disableauditlog
# 4. Verify disabledecho ""echo "4. Verification:"nodetool getauditlog
echo ""echo "IMPORTANT: Document the duration audit logging is disabled."echo "Remember to re-enable: nodetool enableauditlog"Cluster-Wide Operations
Section titled “Cluster-Wide Operations”Disable on All Nodes
Section titled “Disable on All Nodes”#!/bin/bashecho "WARNING: Disabling audit logging cluster-wide!"echo "This will create gaps in the audit trail."echo ""
# Log the actionecho "$(date): Cluster-wide audit disable initiated by $(whoami)" >> /var/log/audit_changes.log
# Get list of node IPs from local nodetool statusnodes=$(nodetool status | grep "^UN" | awk '{print $2}')
for node in $nodes; do echo -n "$node: " ssh "$node" "nodetool disableauditlog" 2>/dev/null && echo "disabled" || echo "FAILED"done
echo ""echo "Verification:"for node in $nodes; do echo -n "$node: " ssh "$node" "nodetool getauditlog" 2>/dev/null | grep "enabled"doneManaging Existing Audit Logs
Section titled “Managing Existing Audit Logs”Preserve Existing Logs
Section titled “Preserve Existing Logs”# After disabling, audit logs remainls -la /var/log/cassandra/audit/
# Archive existing logstar -czf audit_logs_$(date +%Y%m%d).tar.gz /var/log/cassandra/audit/Clean Up Audit Logs
Section titled “Clean Up Audit Logs”# After disabling, if cleanup is needed# CAUTION: Ensure logs are archived first if required for compliance
# Remove old audit logsrm -rf /var/log/cassandra/audit/*.cq4
# Or remove all audit logsrm -rf /var/log/cassandra/audit/*Archive Before Cleanup
Section titled “Archive Before Cleanup”#!/bin/bashAUDIT_DIR="/var/log/cassandra/audit"ARCHIVE_DIR="/archive/cassandra/audit"
# 1. Create archivetimestamp=$(date +%Y%m%d_%H%M%S)archive_file="${ARCHIVE_DIR}/audit_${timestamp}.tar.gz"
echo "Archiving audit logs to $archive_file..."tar -czf $archive_file $AUDIT_DIR/
# 2. Verify archiveif [ -f "$archive_file" ]; then echo "Archive created successfully: $(ls -lh $archive_file)"
# 3. Clean up source echo "Cleaning up source directory..." rm -rf ${AUDIT_DIR}/*
echo "Cleanup complete."else echo "ERROR: Archive creation failed!" exit 1fiTroubleshooting
Section titled “Troubleshooting”Cannot Disable
Section titled “Cannot Disable”# Check JMX connectivitynodetool info
# Check for errorsgrep -i "audit" /var/log/cassandra/system.log | tail -20Audit Logs Still Growing After Disable
Section titled “Audit Logs Still Growing After Disable”# Verify disablednodetool getauditlog
# If still showing enabled, retrynodetool disableauditlog
# Check for configuration overridegrep -i "audit" /etc/cassandra/cassandra.yamlPerformance Not Improved After Disable
Section titled “Performance Not Improved After Disable”# Verify audit logging is truly disablednodetool getauditlog | grep enabled
# Check for other I/O sourcesiostat -x 1
# Audit logging may not have been the causenodetool compactionstatsnodetool tpstatsRe-enabling Audit Logging
Section titled “Re-enabling Audit Logging”After investigation or maintenance, re-enable with appropriate settings:
# Re-enable with previous settingsnodetool enableauditlog \ --included-categories AUTH,DML,DDL,DCL \ --excluded-keyspaces system,system_schema
# Verify enablednodetool getauditlog
# Log the re-enable actionecho "$(date): Audit logging re-enabled by $(whoami)" >> /var/log/cassandra/audit_changes.logCompliance Documentation
Section titled “Compliance Documentation”When disabling audit logging, maintain documentation:
#!/bin/bash# Document audit logging changes
COMPLIANCE_LOG="/var/log/cassandra/compliance_audit.log"
# Log format: timestamp | action | user | reason | durationlog_entry() { echo "$(date -Iseconds) | $1 | $(whoami) | $2 | $3" >> $COMPLIANCE_LOG}
# Example: Disable with documentationlog_entry "DISABLE" "Performance emergency - ticket INC12345" "Expected 2 hours"nodetool disableauditlog
# Example: Re-enable with documentationnodetool enableauditlog --included-categories AUTH,DML,DDL,DCLlog_entry "ENABLE" "Performance issue resolved - ticket INC12345" "N/A"Best Practices
Section titled “Best Practices”Disable Guidelines
- Document the reason - Record why auditing was disabled
- Get approval - Ensure appropriate authorization
- Minimize duration - Re-enable as soon as possible
- Archive first - Preserve existing logs before any cleanup
- Monitor impact - Verify expected performance improvement
- Plan re-enablement - Schedule when to re-enable
Compliance Warning
- Disabling audit logging creates gaps in the audit trail
- May violate regulatory requirements
- Document all periods when auditing was disabled
- Consider this a temporary measure only
- Review with compliance/security team before disabling
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| enableauditlog | Enable audit logging |
| getauditlog | View audit log configuration |
| enablefullquerylog | Enable full query logging |
| disablefullquerylog | Disable full query logging |