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
Here's how to avoid taxes on Roth IRA conversions
Bitcoin Halving, Mining Profitability, and Speculation: Understanding their relationships
Average Jonas Wife
#ridwork guides | fountainpenguin
Is Sam's Club Plus worth it? What to know about the premium warehouse membership before you sign up
Miss Carramello
How To Get Free Credits On Smartjailmail
Marist Dining Hall Menu
Athletic Squad With Poles Crossword
Ribbit Woodbine
Best Cav Commanders Rok
Olivia Ponton On Pride, Her Collection With AE & Accidentally Coming Out On TikTok
Knaben Pirate Download
Brutál jó vegán torta! – Kókusz-málna-csoki trió
Hmr Properties
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
This Modern World Daily Kos
Non Sequitur
Available Training - Acadis® Portal
7543460065
Conscious Cloud Dispensary Photos
065106619
Espn Horse Racing Results
Ruben van Bommel: diepgang en doelgerichtheid als wapens, maar (nog) te weinig rendement
Hdmovie2 Sbs
Craigslist Lewes Delaware
Integer Division Matlab
Medline Industries, LP hiring Warehouse Operator - Salt Lake City in Salt Lake City, UT | LinkedIn
Tinyzonehd
Tim Steele Taylorsville Nc
My Reading Manga Gay
Ice Dodo Unblocked 76
United E Gift Card
Rlcraft Toolbelt
Grandstand 13 Fenway
Sun-Tattler from Hollywood, Florida
Rust Belt Revival Auctions
Www Violationinfo Com Login New Orleans
Appraisalport Com Dashboard /# Orders
Personalised Handmade 50th, 60th, 70th, 80th Birthday Card, Sister, Mum, Friend | eBay
Giantess Feet Deviantart
Cl Bellingham
Weather Underground Bonita Springs
Restored Republic May 14 2023
Express Employment Sign In
'The Night Agent' Star Luciane Buchanan's Dating Life Is a Mystery
Ehome America Coupon Code
Goats For Sale On Craigslist
Craigslist Sparta Nj
Metra Union Pacific West Schedule
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.