0
0
Hadoopdata~10 mins

Audit logging in Hadoop - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Audit logging
User Action Initiated
Hadoop Service Receives Request
Audit Logger Captures Event Details
Write Event to Audit Log File
Log Entry Stored with Timestamp, User, Action
Audit Log Available for Review or Analysis
This flow shows how a user action in Hadoop triggers audit logging, capturing details and storing them for later review.
Execution Sample
Hadoop
hadoop.security.authorization.enabled=true
hadoop.security.audit.logger=org.apache.hadoop.security.authorize.AuditLogger
# User 'alice' reads file /data/file1
This config enables audit logging in Hadoop and logs a user reading a file.
Execution Table
StepActionEvent CapturedLog Entry ContentResult
1User 'alice' requests to read /data/file1User, Action, Resourcealice READ /data/file1Audit logger triggered
2Audit logger formats log entryTimestamp, User, Action, Resource2024-06-01T10:00:00Z alice READ /data/file1Log entry ready
3Write log entry to audit log fileLog entry2024-06-01T10:00:00Z alice READ /data/file1Entry stored in audit log
4Audit log file updatedFile size increasedAudit log file contains new entryAudit log ready for review
5No further actionsN/AN/AEnd of audit logging for this event
💡 Audit log entry created and stored successfully for the user action
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
User ActionNonealice reads /data/file1alice reads /data/file1alice reads /data/file1alice reads /data/file1
Log EntryEmptyEmpty2024-06-01T10:00:00Z alice READ /data/file12024-06-01T10:00:00Z alice READ /data/file1Stored in audit log file
Key Moments - 2 Insights
Why does the audit logger capture the event before writing to the log file?
The audit logger first formats and captures all event details (Step 2) to ensure the log entry is complete and accurate before writing it to the file (Step 3).
What information is always included in an audit log entry?
Each audit log entry includes a timestamp, the user who performed the action, the action type, and the resource involved, as shown in Step 2 and Step 3.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the log entry content at Step 2?
AUser 'alice' requests to read /data/file1
Balice READ /data/file1
C2024-06-01T10:00:00Z alice READ /data/file1
DAudit log file contains new entry
💡 Hint
Check the 'Log Entry Content' column at Step 2 in the execution table.
At which step is the audit log file actually updated with the new entry?
AStep 1
BStep 4
CStep 2
DStep 3
💡 Hint
Look for the step where the 'Audit log file updated' action occurs in the execution table.
If the user action was 'write' instead of 'read', how would the log entry change at Step 2?
ATimestamp alice WRITE /data/file1
BTimestamp alice READ /data/file1
Calice WRITE /data/file1
DUser 'alice' writes to /data/file1
💡 Hint
Refer to the pattern of log entries in Step 2 and replace the action accordingly.
Concept Snapshot
Audit logging in Hadoop captures user actions like reads or writes.
It records details: timestamp, user, action, and resource.
Logs are stored in files for security and review.
Enable audit logging via configuration settings.
Each user action triggers a log entry creation and storage.
Full Transcript
Audit logging in Hadoop works by capturing user actions such as reading or writing files. When a user performs an action, the Hadoop service receives the request and the audit logger captures the event details including the user name, action type, and resource accessed. This information is formatted into a log entry with a timestamp. The log entry is then written to an audit log file. This file grows as more actions are logged and can be reviewed later for security or troubleshooting. The process ensures every important user action is recorded reliably.