Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to enable HDFS encryption zone creation.
Hadoop
hdfs crypto -createZone -keyName [1] -path /encrypted_data Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a key name that does not exist in the KMS.
Forgetting to specify the path for the encryption zone.
✗ Incorrect
The default key is typically used to create an encryption zone unless a custom key is specified.
2fill in blank
mediumComplete the command to list all encryption zones in HDFS.
Hadoop
hdfs crypto -listZones | grep [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using grep with a keyword not present in the output.
Not using the crypto command before listZones.
✗ Incorrect
Listing encryption zones shows their paths, so filtering by 'path' helps identify zones.
3fill in blank
hardFix the error in the command to create a new encryption key in KMS.
Hadoop
hadoop key [1] create -size 128 -description "Data encryption key"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'key' instead of 'keyadmin' causes command not found errors.
Incorrect subcommand syntax.
✗ Incorrect
The correct subcommand to manage keys in Hadoop KMS is 'keyadmin'.
4fill in blank
hardFill both blanks to create a dictionary comprehension that maps file paths to their encryption status.
Hadoop
encryption_status = {file: [1] for file in files if files[file] [2] True} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' causes wrong filtering.
Using a literal 'True' instead of accessing dictionary value.
✗ Incorrect
We map each file to its encryption status by accessing files[file] and filter where status equals True.
5fill in blank
hardFill both blanks to create a dictionary of keys and their creation dates filtered by date.
Hadoop
filtered_keys = { for {BLANK_2}}, [2] in keys.items() if {{BLANK_3}} > '2023-01-01' Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the opening or closing braces.
Using wrong variable names in the loop.
✗ Incorrect
We create a dictionary comprehension starting with '{', iterate over keys and dates, and filter dates after 2023-01-01.