Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to enable audit logging in Hadoop's core-site.xml.
Hadoop
<configuration>
<property>
<name>hadoop.security.authorization</name>
<value>[1]</value>
</property>
</configuration> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the value to 'false' disables audit logging.
Using 'enabled' or 'on' are not valid values for this property.
✗ Incorrect
Setting 'hadoop.security.authorization' to 'true' enables authorization checks and audit logging in Hadoop.
2fill in blank
mediumComplete the code to specify the audit log directory in hdfs-site.xml.
Hadoop
<configuration>
<property>
<name>dfs.namenode.audit.log.dir</name>
<value>[1]</value>
</property>
</configuration> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '/tmp' or '/home' directories which are not suitable for persistent logs.
Choosing configuration directories like '/etc' which are not meant for logs.
✗ Incorrect
The audit logs are typically stored in '/var/log/hadoop/audit' directory for proper log management.
3fill in blank
hardFix the error in the audit logging configuration snippet to enable audit logging.
Hadoop
<configuration>
<property>
<name>hadoop.security.audit.log.enabled</name>
<value>[1]</value>
</property>
</configuration> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' or 'yes' which are not recognized boolean values.
Using '1' which is not accepted as a boolean string in Hadoop configs.
✗ Incorrect
The correct value to enable audit logging is 'true'. Other values like 'enable', 'yes', or '1' are invalid and cause errors.
4fill in blank
hardFill both blanks to configure audit logging for the NameNode and specify the log file name.
Hadoop
<configuration>
<property>
<name>dfs.namenode.audit.log.enabled</name>
<value>[1]</value>
</property>
<property>
<name>dfs.namenode.audit.log.filename</name>
<value>[2]</value>
</property>
</configuration> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Disabling audit logging by setting the first property to 'false'.
Using generic log filenames like 'namenode.log' which may mix audit logs with other logs.
✗ Incorrect
Setting 'dfs.namenode.audit.log.enabled' to 'true' enables audit logging, and 'audit.log' is a common filename for audit logs.
5fill in blank
hardFill both blanks to create a dictionary comprehension that filters audit events with severity greater than INFO.
Hadoop
audit_events = {event: event['severity'] {BLANK_2}} 'INFO' for event in events if event['type'] == {{BLANK_2}} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of ':' in dictionary comprehension syntax.
Using '==' instead of '>' for severity comparison.
Filtering wrong event types or missing quotes around string literals.
✗ Incorrect
The dictionary comprehension uses ':' to map keys to values, '>' to filter severity greater than 'INFO', and filters events of type 'AUDIT'.