Which of the following best explains why Hadoop security is essential for protecting sensitive data?
Think about what happens if anyone can read or change your data without permission.
Hadoop security ensures only authorized users can access or change data, protecting sensitive information from leaks or tampering.
Given the following pseudo-code checking user permissions in Hadoop, what will be the output?
user = 'alice' permissions = {'alice': ['read', 'write'], 'bob': ['read']} if 'write' in permissions.get(user, []): print('Access granted') else: print('Access denied')
Check if 'alice' has 'write' permission in the dictionary.
The user 'alice' has both 'read' and 'write' permissions, so the condition is true and 'Access granted' is printed.
Consider a Hadoop Access Control List (ACL) that allows only users in group 'finance' to read files tagged as 'sensitive'. Given the following data, which files will user 'john' (in group 'finance') see?
files = [
{'name': 'report1.csv', 'tags': ['sensitive']},
{'name': 'report2.csv', 'tags': ['public']},
{'name': 'budget.xlsx', 'tags': ['sensitive']},
{'name': 'notes.txt', 'tags': ['public']}
]
user_groups = {'john': ['finance'], 'mary': ['marketing']}
visible_files = [f['name'] for f in files if ('sensitive' in f['tags'] and 'finance' in user_groups.get('john', [])) or 'public' in f['tags']]
print(visible_files)Remember that 'john' can see sensitive files because he is in 'finance' and all public files.
The code includes files tagged 'sensitive' if the user is in 'finance' and all files tagged 'public'. So 'john' sees all four files.
What error will this Python-like Hadoop encryption code raise?
def encrypt_data(data, key): encrypted = '' for char in data: encrypted += chr(ord(char) + key) return encrypted result = encrypt_data('data', '3') print(result)
Check the types of variables used in arithmetic operations.
The code tries to add an integer (ord(char)) and a string ('3'), causing a TypeError.
Among the following Hadoop security features, which one specifically protects sensitive data stored on disk from unauthorized access?
Think about encryption that happens automatically when data is saved.
Transparent Data Encryption encrypts data stored on disk, protecting it from unauthorized access even if the storage is compromised.