DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Big Data
  4. Hadoop Clusters from an Audit Perspective

Hadoop Clusters from an Audit Perspective

Along with identification, authentication and authorization functions for users and services, it is with Audit log capabilities that the security ecosystem is complete.

Rupam Bora user avatar by
Rupam Bora
·
Nov. 03, 16 · Opinion
Like (0)
Save
Tweet
Share
4.95K Views

Join the DZone community and get the full member experience.

Join For Free

A fundamental component of Hadoop clusters and security models is Accounting. Along with identification, authentication and authorization functions for users and services, it is with Audit log capabilities that the security ecosystem is complete. Hadoop components handle accounting differently depending on the purpose of the component. Components such as HDFS and HBase are data repositories whereas MapReduce, Hive, Impala are query engines and processing frameworks. So, the auditable events are unique for different elements.

HDFS Audit Logs

HDFS provides 2 different audit logs – hdfs-audit.log is used audit general user activity. SecurityAuth-hdfs.audit is used to audit service-level authorization activity. The setup for these logfiles involves hooking into log4j.category.Securitylogger and log4j.additivity.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit.

Auditable events show various actions performed e.g. listStatus, create, setPermission, rename etc. Also, the logs demonstrate who the user is that the event was for, timestamp, IP address and various other bits of information. Also, all unsuccessful access attempts will be recorded.

MapReduce Audit Logs

MapReduce follows a similar approach, it contains 2 audit log files – mapred-audit.log and SecurityAuth-mapred.audit.

Let’s take an example –

  • User Alice is identified by Kerberos principal alice@wonderland.com and she has successfully used kinit to receive a valid TGT
  • MapReduce service-level authorization is not being used
  • Alice submits a MapReduce job
  • Alice kills the MapReduce job before it finishes

Example 1 (mapred-audit.log)

. . .

2016-10-14 18:11:46, 363 INFO mapred.Auditlogger: USER=alice IP=10.1.1.1

OPERATION=SUBMIT_JOB TARGET=job_201403112320_0001 RESULT=SUCCESS

Example 2 (SecurityAuth-mapred.audit)

. . .

2016-10-14 18:46:25, 200 INFO Securitylogger.org.apache.hadoop.ipc.Server:

Auth successful for alice@wonderland.com (auth:SIMPLE)

2016-10-14 18:46:25,240 INFO Securitylogger.org.apache.hadoop.security.authorize.ServiceAuthorizationManager : Authorization successful for alice@wonderland.com (auth:KERBEROS) for protocol=interface.org.apache.mapred.JobsubmissionProtocol

. . .

2016-10-14 18:47:11, 598 INFO Securitylogger.org.apache.hadoop.ipc.Server:

Auth successful for alice@wonderland.com (auth:SIMPLE)

2016-10-14 18:47:11,667 INFO Securitylogger.org.apache.hadoop.security.authorize.ServiceAuthorizationManager : Authorization successful for alice@wonderland.com (auth:KERBEROS) for protocol=interface.org.apache.mapred.JobsubmissionProtocol

. . .

Example 1 shows Alice performed the operation SUBMIT_JOB which results in MapReduce job id - job_201403112320_0001 along with date time and IP. Example 2 shows Alice authentication to job tracker, authorization and when Alice kills the running job.

YARN Audit Logs

YARN audit log events are scattered among the daemon logfiles. But they are easily identifiable because the class name is logged in the event. For the resource manager, it is org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger; and for the name manager it is org.apache.hadoop.yarn.server.nodemanager.NMAuditLogger. These class names can be used to parse out audit events from normal application logs. For YARN to log audit events, the log4j properties need to be set and the hook to set this up is the log4j.category.SecurityLogger.

HIVE Audit Logs

Hive auditing is like YARN in that it does not have a dedicated audit logfile. Audit events occur inside the actual Hive metastore service log so it can be a bit of a challenge. However, the audit logger class names can be used to identify audit events. Other Hive components, such as Hive-Server 2, do not have explicit auditing, but Audit like information can still be gleaned from the service logs.

The audit events are tagged to org.apache.hadoop.hive.metastore.HiveMetaStore.audit. This makes it easier to search the logs specifically for audit events.

With Hive, only the username is shown instead of the full Kerberos UPN, the action performed by the user is identified by the cmd field.

Cloudera Impala Audit Logs

Impala Audit trails are logged into dedicated audit logs used by each Impala daemon (impalad). The audit log directory is specified using the flag audit_event_log_dir. A typical choice is the directory /var/log/impalad/audits. These logfiles are rolled after they reach a certain “size” dictated by a number of lines, as specified using the flag max_audit_event_log_file_size. A reasonable setting is 5,000 lines.

We will discuss HBase, Accumulo, Sentry and Log Aggregation in the next part.

Conclusion 

As the industry is adopting Hadoop based Data Lakes, security is also maturing to enable CISO/CIO and business information security analysts to do forensics from an Audit perspective. Telecom, BFSI clients are demanding Audit log capabilities with a “boots on the ground” approach. To this effect, a better understanding of Hadoop and its ecosystems is paramount to achieving business objectives. 

hadoop cluster Event

Published at DZone with permission of Rupam Bora, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Top 12 Technical Skills Every Software Tester Must Have
  • Java Development Trends 2023
  • Spring Cloud: How To Deal With Microservice Configuration (Part 1)
  • Streamlining Your Workflow With the Jenkins HTTP Request Plugin: A Guide to Replacing CURL in Scripts

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: