homepage
Menu
Open menu
  • Training
    Go one level top Back

    Training

    • Courses

      Build cyber prowess with training from renowned experts

    • Hands-On Simulations

      Hands-on learning exercises keep you at the top of your cyber game

    • Certifications

      Demonstrate cybersecurity expertise with GIAC certifications

    • Ways to Train

      Multiple training options to best fit your schedule and preferred learning style

    • Training Events & Summits

      Expert-led training at locations around the world

    • Free Training Events

      Upcoming workshops, webinars and local events

    • Security Awareness

      Harden enterprise security with end-user and role-based training

    Featured

    Get a Free Hour of SANS Training

    Free Course Demos

    Can't find what you are looking for?

    Let us help.
    Contact us
  • Learning Paths
    Go one level top Back

    Learning Paths

    • By Focus Area

      Chart your path to job-specific training courses

    • By NICE Framework

      Navigate cybersecurity training through NICE framework roles

    • DoDD 8140 Work Roles

      US DoD 8140 Directive Frameworks

    • By European Skills Framework

      Align your enterprise cyber skills with ECSF profiles

    • By Skills Roadmap

      Find the right training path based on critical skills

    • New to Cyber

      Give your cybersecurity career the right foundation for success

    • Leadership

      Training designed to help security leaders reduce organizational risk

    • Degree and Certificate Programs

      Gain the skills, certifications, and confidence to launch or advance your cybersecurity career.

    Featured: Solutions for Emerging Risks

    New to Cyber resources

    Start your career
  • Community Resources
    Go one level top Back

    Community Resources

    Watch & Listen

    • Webinars
    • Live Streams
    • Podcasts

    Read

    • Blog
    • Newsletters
    • White Papers
    • Internet Storm Center

    Download

    • Open Source Tools
    • Posters & Cheat Sheets
    • Policy Templates
    • Summit Presentations
    • SANS Community Benefits

      Connect, learn, and share with other cybersecurity professionals

    • CISO Network

      Engage, challenge, and network with fellow CISOs in this exclusive community of security leaders

  • For Organizations
    Go one level top Back

    For Organizations

    Team Development

    • Why Partner with SANS
    • Group Purchasing
    • Skills & Talent Assessments
    • Private & Custom Training

    Leadership Development

    • Leadership Courses & Accreditation
    • Executive Cybersecurity Exercises
    • CISO Network

    Security Awareness

    • End-User Training
    • Phishing Simulation
    • Specialized Role-Based Training
    • Risk Assessments
    • Public Sector Partnerships

      Explore industry-specific programming and customized training solutions

    • Sponsorship Opportunities

      Sponsor a SANS event or research paper

    Interested in developing a training plan to fit your organization’s needs?

    We're here to help.
    Contact us
  • Talk with an expert
  • Log In
  • Join - it's free
  • Account
    • Account Dashboard
    • Log Out
  1. Home >
  2. Blog >
  3. Linux Incident Response - A Guide to syslog-ng
Taz Wake
Tarot (Taz) Wake

Linux Incident Response - A Guide to syslog-ng

Syslog-ng stands as a sophisticated evolution of the syslog protocol, designed to offer advanced logging capabilities within Linux systems.

November 26, 2023

Understanding Syslog-ng in Linux Environments

Syslog-ng stands as a sophisticated evolution of the syslog protocol, designed to offer advanced logging capabilities within Linux systems. Its enhanced functionalities are crucial in managing the complex log data prevalent in modern IT infrastructures.

Core Operations of Syslog-ng

The primary role of Syslog-ng is to collect, process, and forward log messages from diverse sources. Utilising Linux syscalls such as open(), read(), write(), and socket(), it efficiently manages file operations and network communications, making it a versatile tool for log data management.

File Writing and Data Management

Syslog-ng excels in writing logs to various file formats, including text, binary, and structured formats like JSON. Logs are typically stored in directories like /var/log/messages or /var/log/syslog, containing detailed information such as timestamps, hostnames, program identifiers, and the log messages themselves. This wealth of data is pivotal for a comprehensive understanding of system activities.

Syslog-ng and the Systemd Journal

Interfacing seamlessly with the Systemd Journal, Syslog-ng can access logs centralised in this journaling system used by many Linux distributions. While it doesn’t write directly to the journal, Syslog-ng can effectively reroute these entries, integrating them with other log sources for in-depth analysis.

Configurational Flexibility of Syslog-ng

The configuration possibilities in Syslog-ng are extensive, offering granular control over log management. It allows for defining sources, applying filters based on content or metadata, and choosing from various output destinations. This configurational depth is key to customising log management to suit specific organisational needs.

Comparison with Rsyslog

In the realm of log management tools, Syslog-ng and Rsyslog both stand out, each with distinct advantages. Syslog-ng is particularly noted for its ease of configuration, especially when it comes to forwarding log data to remote servers. Its user-friendly setup and powerful filtering capabilities make it a preferred choice for scenarios where straightforward and customisable log management is crucial. This ease of configuration can significantly reduce the time and complexity involved in setting up remote log forwarding, making Syslog-ng an attractive option for environments where quick deployment and ease of use are priorities.

While Rsyslog is celebrated for its high performance and ability to handle high volumes of log data efficiently, Syslog-ng often becomes the go-to for its more intuitive setup. For those seeking a balance between functionality and simplicity, particularly in scenarios involving the forwarding of logs to remote servers, Syslog-ng often emerges as the preferred choice. This preference is further reinforced when the specific filtering needs, or the requirement for an easy-to-navigate configuration, outweighs the high-volume processing capabilities offered by Rsyslog.

Integration with SIEM Systems

Syslog-ng, as a versatile log management solution, plays an integral role in strengthening security infrastructures. It achieves this by efficiently forwarding log data to Security Information and Event Management (SIEM) systems and centralised log collectors. This functionality is fundamental for the real-time monitoring and alerting capabilities crucial in modern security operations centres (SOCs).

The software supports a range of transmission protocols to cater to different security and operational needs. For instance, it can transmit logs over TCP (Transmission Control Protocol), offering a reliable, connection-oriented communication. This ensures that log data is not only sent but also acknowledged, making it suitable for environments where loss of log data is unacceptable. UDP (User Datagram Protocol) is also supported, which, while less reliable than TCP, offers faster transmission, beneficial in high-volume log environments where speed is a priority. Additionally, Syslog-ng can secure log data in transit using SSL/TLS (Secure Sockets Layer/Transport Layer Security), ensuring confidentiality and integrity, which is critical in protecting sensitive log information.

The message format in Syslog-ng is another key aspect. It adheres to standard syslog formats, typically comprising a priority value, a timestamp, the hostname or IP address, the application or process name, and the actual log message. This structured format is pivotal for SIEM systems and log collectors, as it aids in the accurate parsing, categorisation, and analysis of log data. Syslog-ng can be configured to include additional metadata or use custom formatting if required by specific SIEM systems or logging policies. The flexibility in configuring message formats and the support for secure and reliable transmission protocols make Syslog-ng a critical component in the architecture of log management and security event monitoring systems.

Understanding Severity and Facility Codes

In compliance with the syslog protocol, Syslog-ng employs a dual coding system comprising severity and facility codes to efficiently categorise and manage log messages. This system is particularly beneficial for incident responders, as it allows for the prioritisation and rapid identification of logs based on their nature and source.

Severity codes in Syslog-ng range from 'Emergency' to 'Debug', offering a granular view of the urgency and nature of each log entry. For instance, a severity level of 'Emergency' (code 0) indicates a system-wide critical condition, whereas 'Debug' (code 7) represents detailed developmental messages that are typically used during troubleshooting or debugging processes. Understanding these severity levels enables incident responders to quickly assess the criticality of events and allocate resources accordingly.

The severity codes are as follows:

  • Code 0: Emergency - System is unusable.
  • Code 1: Alert - Immediate action needed.
  • Code 2: Critical - Critical conditions.
  • Code 3: Error - Error conditions.
  • Code 4: Warning - Warning conditions.
  • Code 5: Notice - Normal but significant condition.
  • Code 6: Informational - Informational messages.
  • Code 7: Debug - Debug-level messages.

Facility codes, on the other hand, indicate the system or application that generated the log. For example, 'kern' (code 0) is used for kernel messages, while 'mail' (code 2) pertains to the mail system. This categorisation aids incident responders in quickly pinpointing the source of an issue, allowing for more efficient problem-solving and analysis.

The facility codes include:

  • Code 0: kern - Kernel messages.
  • Code 1: user - User-level messages.
  • Code 2: mail - Mail system.
  • Code 3: daemon - System daemons.
  • Code 4: auth - Security/authentication messages.
  • Code 5: syslog - Messages generated internally by syslogd.
  • Code 6: lpr - Line printer subsystem.
  • Code 7: news - Network news subsystem.
  • Code 8: uucp - UUCP subsystem.
  • Code 9: cron - Cron subsystem.
  • Code 10: authpriv - Security/authentication messages.
  • Code 11: ftp - FTP daemon.
  • Code 12: ntp - NTP subsystem.
  • Code 13: security - Log audit.
  • Code 14: console - Log alert.
  • Code 15: solaris-cron - Scheduling daemon.
  • Codes 16–23: local0 – local7 - Locally used facilities.

For an incident responder, the comprehension of these codes is invaluable. They not only provide immediate insight into the nature and origin of a log entry but also assist in filtering and analysing log data effectively, making Syslog-ng a powerful tool in the arsenal of cybersecurity professionals.

Performance and Scalability

Syslog-ng is designed to handle large volumes of data efficiently, incorporating features like log buffering, flow control, and multi-threading. These features ensure that it remains effective even in demanding, high-volume environments.

Real-world Configuration Scenario

A practical configuration in Syslog-ng might involve collecting system logs, filtering for SSH-related messages, and storing them in a specific file. This setup can be invaluable for a Security Operations Centre (SOC) analyst focusing on potential security breaches or irregularities in SSH traffic.

source s_system { system(); };
filter f_ssh { programme("sshd"); };
destination d_ssh_logs { file("/var/log/ssh.log"); };
log { source(s_system); filter(f_ssh); destination(d_ssh_logs); };

Importance for Incident Responders

Syslog-ng is an indispensable asset for cybersecurity professionals, particularly in the realms of incident response and forensic investigations. Its ability to generate detailed logs is crucial in providing deep insights into various aspects of system operations, including but not limited to unauthorised access attempts, operational irregularities, and general system behaviour. These logs serve as a rich source of data for understanding the sequence of events leading up to, during, and after a security incident.

The logs generated by Syslog-ng are replete with critical information that can be instrumental in identifying and mitigating security threats. They record a comprehensive range of events, from system errors and service interruptions to suspicious activities and breach attempts. This granularity not only aids in pinpointing the exact nature and source of an issue but also provides a chronological trail of events, which is vital for understanding the scope and impact of a security incident.

For incident responders, the speed at which they can detect and respond to an issue is often as important as the response itself. Syslog-ng's structured and categorised logging, enhanced by severity and facility codes, allows for quick parsing and identification of critical issues. This immediacy in recognising potential threats enables responders to take swift action, potentially mitigating harmful effects before they escalate.

In terms of investigation, the logs from Syslog-ng can be found in various standard locations on a Linux system, typically in the /var/log directory. However, Syslog-ng also offers the flexibility to configure custom logging paths, which can be tailored to suit the specific needs of an organisation’s security infrastructure.

Analysing the data from Syslog-ng efficiently requires the use of specialised tools. Popular choices among cybersecurity professionals include log management and analysis software like Splunk, LogRhythm, or Elasticsearch with Kibana. These tools not only facilitate the aggregation and indexing of log data for easier access but also provide advanced search capabilities, data visualisation, and alerting mechanisms. This enhances the ability of incident responders to swiftly sift through vast amounts of log data and extract actionable insights.

Moreover, Syslog-ng’s compatibility with various SIEM (Security Information and Event Management) systems further bolsters its utility in cybersecurity contexts. By integrating Syslog-ng with a SIEM system, organisations can centralise their monitoring and analysis efforts, creating a more cohesive and effective security posture. This integration allows for real-time analysis of log data, automated alerting of suspicious activities, and aids in compliance with various regulatory standards that mandate the collection and analysis of log data.

Summary

Syslog-ng stands out as an essential log management tool in Linux environments. Its advanced functionalities, coupled with extensive configurational options and robust integration capabilities with SIEM systems, make it an indispensable asset in effective log management and cybersecurity operations.

If you want to know more about Linux Incident Response in general, as well as analysing the log files and being able to practice responding to a realistic Linux-based intrusion, have a look at FOR577 (Linux Incident Response and Threat Hunting) from the SANS Institute. You can find out more at http://sans.org/for577.

Share:
TwitterLinkedInFacebook
Copy url Url was copied to clipboard
Subscribe to SANS Newsletters
Receive curated news, vulnerabilities, & security awareness tips
United States
Canada
United Kingdom
Spain
Belgium
Denmark
Norway
Netherlands
Australia
India
Japan
Singapore
Afghanistan
Aland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire, Sint Eustatius, and Saba
Bosnia And Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Cook Islands
Costa Rica
Cote D'ivoire
Croatia (Local Name: Hrvatska)
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Djibouti
Dominica
Dominican Republic
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Eswatini
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard And McDonald Islands
Honduras
Hong Kong
Hungary
Iceland
Indonesia
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Republic Of
Kosovo
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Liechtenstein
Lithuania
Luxembourg
Macau
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States Of
Moldova, Republic Of
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Macedonia
Northern Mariana Islands
Oman
Pakistan
Palau
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Bartholemy
Saint Kitts And Nevis
Saint Lucia
Saint Martin
Saint Vincent And The Grenadines
Samoa
San Marino
Sao Tome And Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia
Slovenia
Solomon Islands
South Africa
South Georgia and the South Sandwich Islands
South Sudan
Sri Lanka
St. Helena
St. Pierre And Miquelon
Suriname
Svalbard And Jan Mayen Islands
Sweden
Switzerland
Taiwan
Tajikistan
Tanzania, United Republic Of
Thailand
Togo
Tokelau
Tonga
Trinidad And Tobago
Tunisia
Turkey
Turkmenistan
Turks And Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Vatican City State
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis And Futuna Islands
Western Sahara
Yemen
Zambia
Zimbabwe

By providing this information, you agree to the processing of your personal data by SANS as described in our Privacy Policy.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Recommended Training

  • FOR572: Advanced Network Forensics: Threat Hunting, Analysis, and Incident Response™
  • FOR508: Advanced Incident Response, Threat Hunting, and Digital Forensics
  • FOR589: Cybercrime Investigations

Tags:
  • Digital Forensics, Incident Response & Threat Hunting

Related Content

Blog
DFIR blog image.png
Digital Forensics, Incident Response & Threat Hunting
August 22, 2024
A Visual Summary of SANS DFIR Summit 2024
Check out these graphic recordings created in real-time throughout the event for SANS DFIR Summit 2024
No Headshot Available
Alison Kim
read more
Blog
Spring 2024 Update FOR585 Smartphone Forensic Analysis In Depth
Digital Forensics, Incident Response & Threat Hunting
April 26, 2024
Spring 2024 Update: Explore the Latest Enhancements to SANS FOR585: Smartphone Forensic Analysis In-Depth
We are excited to announce the latest update to the SANS Institute's FOR585: Smartphone Forensic Analysis In-Depth!
Heather_Mahalik_370x370.png
Heather Barnhart
read more
Blog
Blog: Google Chrome Platform Notification Analysis
Digital Forensics, Incident Response & Threat Hunting
February 29, 2024
Google Chrome Platform Notification Analysis
In this post, Chad Tilbury uses the new Arsenal Recon LevelDB Recon tool to examine the Chrome Platform Notifications database.
370x370_Chad-Tilbury.jpg
Chad Tilbury
read more
  • Company
  • Mission
  • Instructors
  • About
  • FAQ
  • Press
  • Contact Us
  • Careers
  • Policies
  • Training Programs
  • Work Study
  • Academies & Scholarships
  • Public Sector Partnerships
  • Law Enforcement
  • SkillsFuture Singapore
  • Degree Programs
  • Get Involved
  • Join the Community
  • Become an Instructor
  • Become a Sponsor
  • Speak at a Summit
  • Join the CISO Network
  • Award Programs
  • Partner Portal
Subscribe to SANS Newsletters
Receive curated news, vulnerabilities, & security awareness tips
United States
Canada
United Kingdom
Spain
Belgium
Denmark
Norway
Netherlands
Australia
India
Japan
Singapore
Afghanistan
Aland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire, Sint Eustatius, and Saba
Bosnia And Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Cook Islands
Costa Rica
Cote D'ivoire
Croatia (Local Name: Hrvatska)
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Djibouti
Dominica
Dominican Republic
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Eswatini
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard And McDonald Islands
Honduras
Hong Kong
Hungary
Iceland
Indonesia
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Republic Of
Kosovo
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Liechtenstein
Lithuania
Luxembourg
Macau
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States Of
Moldova, Republic Of
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Macedonia
Northern Mariana Islands
Oman
Pakistan
Palau
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Bartholemy
Saint Kitts And Nevis
Saint Lucia
Saint Martin
Saint Vincent And The Grenadines
Samoa
San Marino
Sao Tome And Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia
Slovenia
Solomon Islands
South Africa
South Georgia and the South Sandwich Islands
South Sudan
Sri Lanka
St. Helena
St. Pierre And Miquelon
Suriname
Svalbard And Jan Mayen Islands
Sweden
Switzerland
Taiwan
Tajikistan
Tanzania, United Republic Of
Thailand
Togo
Tokelau
Tonga
Trinidad And Tobago
Tunisia
Turkey
Turkmenistan
Turks And Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Vatican City State
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis And Futuna Islands
Western Sahara
Yemen
Zambia
Zimbabwe

By providing this information, you agree to the processing of your personal data by SANS as described in our Privacy Policy.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
  • Privacy Policy
  • Terms and Conditions
  • Do Not Sell/Share My Personal Information
  • Contact
  • Careers
© 2025 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute. Our Terms and Conditions detail our trademark and copyright rights. Any unauthorized use is expressly prohibited.
  • Twitter
  • Facebook
  • Youtube
  • LinkedIn