How to enable and configure Auditd on CentOS 7 | TechRepublic (2024)

If you use CentOS 7 in your data center, you probably assume it an impeccably secure platform. For the most part, that assumption is on the money. However, there are things you can do to make the platform even more secure. One such task is to enable the auditd system.

What is the auditd system? Auditd is part of the Linux Auditing System, and it is responsible for writing audit records to disk. With auditd, you can configure audit rules, view logs, and customize it based on specific requirements. With the help of Auditd, you can gain valuable insights about your server performance and activity. Out of the box, you should have auditd installed on your CentOS 7 server. On the off-chance it’s not, we’ll install it.

Let’s take care of that.

SEE: Information security policy template download (Tech Pro Research)

Installing Auditd

Audit system comes in the form of two packages: Audit and audit-libs. Let’s check to see if these are installed with the command:

sudo yum list audit audit-libs

If you see those packages listed (Figure A), everything is ready.

How to enable and configure Auditd on CentOS 7 | TechRepublic (1)

If you don’t see the packages listed, install them with the command:

sudo yum install audit audit-libs

Next, we need to start and enable Auditd with the commands:

sudo systemctl start auditd
sudo systemctl enable auditd

At this point, Auditd is running and writing records to /var/log/audit/audit.log. You can issue the command:

tail -f /var/log/audit/audit.log

The above command will follow anything written to the Auditd log, so you can view it in real time.

Configuring Auditd

In order to configure Auditd, we must first change to the root user with the command su. Once you’ve done that, issue the command:

nano /etc/audit/auditd.conf

In this file (Figure B), you can configure the Auditd daemon.

How to enable and configure Auditd on CentOS 7 | TechRepublic (2)

What you want to focus your time on is the Auditd rules. Issue the command:

nano /etc/audit/audit.rules

Let’s say you want to configure Auditd to watch a particular directory … say, /etc/hosts. In the audit.rules file, add the following:

-w /etc/hosts -p wa -k hosts_file_change

Where:

  • -w is the location to watch.
  • -p is the permissions (in accordance to standard UNIX permissions).
  • -k is the key name (an optional string to help identify, which rule or a set of rules has generated a particular log entry).

Save and close that file. After adding the rule, run the tail command (from above) and edit the /etc/hosts file. You should see an entry tagged with the key configured in the rules entry (Figure C).

How to enable and configure Auditd on CentOS 7 | TechRepublic (3)

And that’s all there is to enabling Auditd and adding a new rule to the system. This is a great way to keep track of what’s going on with your CentOS 7 server.

How to enable and configure Auditd on CentOS 7 | TechRepublic (4)

Subscribe to the Cybersecurity Insider Newsletter

Strengthen your organization's IT security defenses by keeping abreast of the latest cybersecurity news, solutions, and best practices. Delivered every Monday, Tuesday and Thursday

Subscribe to the Cybersecurity Insider Newsletter

Strengthen your organization's IT security defenses by keeping abreast of the latest cybersecurity news, solutions, and best practices. Delivered every Monday, Tuesday and Thursday

How to enable and configure Auditd on CentOS 7 | TechRepublic (2024)
Top Articles
7 Low-Fee Fidelity Mutual Funds
The Jammu & Kashmir Bank Ltd. Share Price Today, Market Cap, Price Chart, Balance Sheet
Scheelzien, volwassenen - Alrijne Ziekenhuis
Exclusive: Baby Alien Fan Bus Leaked - Get the Inside Scoop! - Nick Lachey
Ffxiv Palm Chippings
Chatiw.ib
Don Wallence Auto Sales Vehicles
South Park Season 26 Kisscartoon
Costco The Dalles Or
1movierulzhd.fun Reviews | scam, legit or safe check | Scamadviser
Blairsville Online Yard Sale
Comenity Credit Card Guide 2024: Things To Know And Alternatives
Obituary Times Herald Record
Delectable Birthday Dyes
Valentina Gonzalez Leak
Check From Po Box 1111 Charlotte Nc 28201
Katherine Croan Ewald
Spider-Man: Across The Spider-Verse Showtimes Near Marcus Bay Park Cinema
The best TV and film to watch this week - A Very Royal Scandal to Tulsa King
Zack Fairhurst Snapchat
Missed Connections Inland Empire
12 Top-Rated Things to Do in Muskegon, MI
Evil Dead Rise Showtimes Near Regal Sawgrass & Imax
Yosemite Sam Hood Ornament
Costco Gas Hours St Cloud Mn
Black Panther 2 Showtimes Near Epic Theatres Of Palm Coast
Sinfuldeed Leaked
How often should you visit your Barber?
Broken Gphone X Tarkov
Boneyard Barbers
Mrstryst
Frommer's Belgium, Holland and Luxembourg (Frommer's Complete Guides) - PDF Free Download
Murphy Funeral Home & Florist Inc. Obituaries
The Bold And The Beautiful Recaps Soap Central
Rage Of Harrogath Bugged
15 Best Things to Do in Roseville (CA) - The Crazy Tourist
Infinite Campus Farmingdale
R: Getting Help with R
Is Ameriprise A Pyramid Scheme
Nimbleaf Evolution
Swsnj Warehousing Inc
Large Pawn Shops Near Me
Hillsborough County Florida Recorder Of Deeds
Keci News
Lesson 5 Homework 4.5 Answer Key
antelope valley for sale "lancaster ca" - craigslist
Uno Grade Scale
The Missile Is Eepy Origin
Supervisor-Managing Your Teams Risk – 3455 questions with correct answers
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 6537

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.