0
0
Hadoopdata~10 mins

Audit logging in Hadoop - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Afalse
Btrue
Cenabled
Don
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.
2fill in blank
medium

Complete 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'
A/tmp/hadoop/audit
B/etc/hadoop/audit
C/var/log/hadoop/audit
D/home/hadoop/audit
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.
3fill in blank
hard

Fix 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'
Atrue
Byes
Cenable
D1
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.
4fill in blank
hard

Fill 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'
Atrue
Bfalse
Caudit.log
Dnamenode.log
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.
5fill in blank
hard

Fill 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'
A:
B>
C'AUDIT'
D==
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.