Centralized System Logging With A Database Manitoba UNIX User Group Kevin McGregor February 13, 2007.

Slides:



Advertisements
Similar presentations
Everything under control ©ANT Group 2008 Garda System.
Advertisements

iRequestManager for MediMizer X3
Managing logs with syslog-ng and SWATCH AfNOG 11, Kigali/Rwanda.
ActiveXperts Network Monitor Monitors servers, workstations and devices for availability Alerts and corrects.
Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning Last updated
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Lesson 22 – Introduction to Linux Systems Administration.
Security SIG: Introduction to Tripwire Chris Harwood John Ives.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 8 Introduction to Printers in a Windows Server 2008 Network.
 Proxy Servers are software that act as intermediaries between client and servers on the Internet.  They help users on private networks get information.
Pro Exchange SPAM Filter An Exchange 2000 based spam filtering solution.
AfChix 2011 Blantyre, Malawi Log management. Log management and monitoring ■ What is log management and monitoring ? ● It's about keeping your logs in.
Lecture slides prepared for “Business Data Communications”, 7/e, by William Stallings and Tom Case, Chapter 8 “TCP/IP”.
Securing LAMP: Linux, Apache, MySQL and PHP Track 2 Workshop PacNOG 7 July 1, 2010 Pago Pago, American Samoa.
SYST Web Technologies SYST Web Technologies Installing a Web Server (XAMPP)
Linux Operations and Administration
Overview What is SQL Server? Creating databases Administration Security Backup.
Va-scanCopyright 2002, Marchany Securing Solaris Servers Randy Marchany.
Guide to Operating System Security Chapter 9 Web, Remote Access, and VPN Security.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Database Lecture # 1 By Ubaid Ullah.
Introduction to SQL Server 2000 Security Dave Watts CTO, Fig Leaf Software
1 Web Server Administration Chapter 1 The Basics of Server and Web Server Administration.
Copyright ®xSpring Pte Ltd, All rights reserved Versions DateVersionDescriptionAuthor May First version. Modified from Enterprise edition.NBL.
Mastering Windows Network Forensics and Investigation Chapter 11: Text-Based Logs.
EGI-InSPIRE RI EGI-InSPIRE EGI-InSPIRE RI Pakiti.
Drupal Jumpstart Information Systems 337 Prof. Harry Plantinga.
baltrad node installation for beginners On Ubuntu Jesper Ellerbæk Nielsen Aalborg University, DK.
TEAM Basic TotalElectrostatic ManagementAwareness&
SQL Queries Relational database and SQL MySQL LAMP SQL queries A MySQL Tutorial and applications Database Building Assignment.
SSL, Single Sign On, and External Authentication Presented By Jeff Kelley April 12, 2005.
CENT 305 Information Systems Security Overview of System Logging syslog 1.
A powerful network monitoring system
4BP1 Electronic & Computer Engineering Paul Gildea th Year Interim Project Presentation.
Presentation Overview 1.Creating VMware Virtual Machine 2. Installing Red Hat Enterprise Linux 5 on VMvare 3. Configuring Linux for Oracle 11gR2 installation.
Guide to MCSE , Second Edition, Enhanced1 The Windows XP Security Model User must logon with: Valid user ID Password User receives access token Access.
Mobile IP Outline Intro to mobile IP Operation Problems with mobility.
Intrusion Intrusion Detection Systems with Snort Hailun Yan 564-project.
Experiment Management System CSE 423 Aaron Kloc Jordan Harstad Robert Sorensen Robert Trevino Nicolas Tjioe Status Report Presentation Industry Mentor:
Permissions Lesson 13. Skills Matrix Security Modes Maintaining data integrity involves creating users, controlling their access and limiting their ability.
Linux Services Configuration
The Diagnostic Pathfinder System Introduction Getting Started.
RADIUS What it is Remote Authentication Dial-In User Service
PHP Introduction PHP is a server-side scripting language.
SQL Server 2005 Implementation and Maintenance Chapter 6: Security and SQL Server 2005.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Day 15 Apache. Being a web server Once your system is correctly connected to the network, you could be a web server. –When you go to a web site such as.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
IDS And Tripwire Rayhan Mir COSC 356. What is IDS IDS - Intrusion detection system Primary function – To monitor network or host resources to detect intrusions.
WARCS (Wide Area Remote Control for SPring-8)‏ A. Yamashita and Y.Furukawa SPring-8, Japan Control System Cyber-Security Workshop (CS)2/HEP Oct
Architecture Review 10/11/2004
CS320 Web and Internet Programming SQL and MySQL
Client/Server Databases and the Oracle 10g Relational Database
ITIS 3110 IT Infrastructure II
Introduction to SQL Server 2000 Security
Lab 1 introduction, debrief
Working at a Small-to-Medium Business or ISP – Chapter 7
PostgreSQL Database and C++ Interface (and Midterm Topics)
Working at a Small-to-Medium Business or ISP – Chapter 7
IS3440 Linux Security Unit 6 Using Layered Security for Access Control
Database Driven Websites
Utilize Group Policy Terminal Server Settings
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Topic 5: Communication and the Internet
Working at a Small-to-Medium Business or ISP – Chapter 7
Cloud computing mechanisms
Chapter 15 – Part 2 Networks The Internal Operating System
REDCap and Data Governance
Presentation transcript:

Centralized System Logging With A Database Manitoba UNIX User Group Kevin McGregor February 13, 2007

The Situation Multiple hosts and devices are logging stuff Log files are scattered Reports and analyses are being requested

Requirements And Constraints I’d prefer free software (gratis/libre) Open standards Must work with available equipment

My Solution Send information from all syslog devices to a syslog server, which stores the logs in a database for future reporting Servers run Ubuntu Server LTS PostgreSQL 8.1 Syslog-ng

What Is syslog? Three things, really:  A method of general system logging on UNIX via system calls  A log format  A network log transmission mechanism with three roles: syslog device  A source of syslog messages syslog relay  Relays some or all messages to a syslog server syslog server  Final destination of syslog messages  Note: Many ways to structure the three roles

Why syslog-ng? Use TCP along with UDP Filtering based on message content Support for encryption, tunneling, firewalls Can run in chroot environment

Which Databases Can We Use? Using this method, any database with a Linux client:  MySQL  PostgreSQL  SQL Server  Sybase ASE  Oracle  DB2  Others

Set Up A Test Machine For Windows XP, get and install Kiwi SyslogGen for testing, pgAdmin for general database management (both free) For this demo, add to c:\windows\system32\drivers\etc\hosts: loghost db

Loghost Configuration (1 of 3) Install syslog-ng, postgresql-client-8.1, openssh-server, openntp Check logs (/var/log/{daemon.log,syslog}) Create pipe (“ mkfifo /var/run/pgsql.pipe ” or “ mknod /var/run/pgsql.pipe p ”) chmod 700 /var/run/pgsql.pipe

Loghost Configuration (2 of 3) Add to /etc/syslog-ng/syslog-ng.conf: source s_net { udp(); }; destination dp_pgsql { pipe( “/var/run/pgsql.pipe” template(“INSERT INTO logs (rcvd,sent,fac,lev,pri,tag,host,sourceip,program,msg) VALUES( ‘$R_ISODATE’, ’$S_ISODATE’, ’$FACILITY’, ’$LEVEL’, ’$PRI’, ’$TAG’, ’$HOST’, ’$SOURCEIP’, ’$PROGRAM’, ’$MSGONLY’ );\n”) template_escape(yes) ); }; log { source(s_net); destination(dp_pgsql); };

Loghost Configuration (3 of 3) Signal syslog-ng to re-read syslog-ng.conf  kill –HUP Check pipe contents:  cat </var/run/pgsql.pipe Send a test log message to loghost with SyslogGen

Database Host Configuration (1 of 2) Install the necessary software apt-get install postgresql-8.1 openssh-server openntp Configure PostgreSQL: Add to /etc/postgresql/8.1/main/pg_hba.conf: host syslogdemo sysloguser /24 trust host all postgres /24 trust Change in /etc/postgresql/8.1/main/postgresql.conf: listen addresses = ‘*’

Database Host Configuration (2 of 2) Set up the database, user, table and permissions: su postgres createdb syslogdemo psql –d syslogdemo create role sysloguser login; CREATE TABLE logs ( rcvd timestamp with time zone, sent timestamp with time zone, fac character varying(10), lev character varying(10), pri integer, tag character(2), host character varying(32), sourceip inet, program text, msg text, entry serial NOT NULL, PRIMARY KEY (entry) ) ; ALTER TABLE logs OWNER TO postgres; GRANT ALL ON TABLE logs TO postgres; GRANT INSERT ON TABLE logs TO sysloguser; GRANT UPDATE ON SEQUENCE logs_entry_seq TO sysloguser;

Back To Loghost Add to inittab: sl:2345:respawn:/usr/local/bin/syslog-ng-pgsql-pipe.sh Create /usr/local/bin/syslog-ng-pgsql-pipe.sh: [[ -p /var/run/pgsql.pipe ]] || /bin/mknod /var/run/pgsql.pipe p exec /usr/bin/psql –U sysloguser –d syslogdemo –h db </var/run/pgsql.pipe Don’t forget to chmod 700 /usr/local/bin/syslog-ng-pgsql-pipe.sh Add to loghost’s /etc/hosts: db Then ‘telinit q’ to have init re-read inittab and start everything going.

Issues, Concerns, Enhancements Database security (Research this) Database structure/design (See links) Database optimization (PostgreSQL defaults not good for large number of records) Web reporting (Probably Apache/PHP) Log Squid-cache, Apache (Large amount of data!)

Links Syslog-ng ( PostgreSQL ( Ubuntu ( Kiwi Logger ( Snare EventLog Agent for Windows ( pgAdmin ( VMware ( RFC 3164 ( Some sites you’d find via Google anyway: