Complete the code to start the Apache Ranger service.
sudo systemctl [1] ranger-adminThe command sudo systemctl start ranger-admin starts the Apache Ranger admin service.
Complete the code to list all Ranger policies using the REST API with curl.
curl -u admin:admin123 -X GET http://localhost:[1]/service/public/v2/api/policyApache Ranger admin REST API typically runs on port 6080.
Fix the error in the Ranger policy JSON to allow access to the 'data_lake' resource.
{
"policyName": "AccessDataLake",
"service": "hdfs",
"resources": {
"path": {
"values": ["[1]"],
"isExcludes": false,
"isRecursive": true
}
},
"policyItems": []
}The path resource in Ranger policies requires the full absolute path starting with a slash.
Fill both blanks to create a Ranger policy that grants 'read' access to user 'alice' on the '/reports' path.
{
"policyName": "ReadReports",
"service": "hdfs",
"resources": {
"path": {
"values": ["[1]"],
"isExcludes": false,
"isRecursive": false
}
},
"policyItems": [
{
"users": ["[2]"],
"accesses": [
{"type": "read", "isAllowed": true}
]
}
]
}The path must be '/reports' and the user must be 'alice' to grant read access correctly.
Fill all three blanks to create a Ranger policy dictionary in Python that maps user 'bob' to 'write' access on '/projects'.
policy = {
'[1]': 'WriteProjects',
'[2]': 'hdfs',
'resources': {
'path': {
'values': ['/projects'],
'isExcludes': False,
'isRecursive': False
}
},
'policyItems': [
{
'users': ['[3]'],
'accesses': [{'type': 'write', 'isAllowed': True}]
}
]
}The keys 'policyName' and 'service' define the policy name and service type. The user is 'bob' for write access.