Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

syslog-ng.conf v3 and the Gentoo Security Handbook

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
rpmohn
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 116
Joined: Tue Aug 26, 2003 3:59 pm
Location: Vermont
Contact:
Contact rpmohn
Website

syslog-ng.conf v3 and the Gentoo Security Handbook

  • Quote

Post by rpmohn » Thu Nov 19, 2009 10:06 pm

I've been using the recommended /etc/syslog-ng/syslog-ng.conf file from code listing 4.1 of the Gentoo Security Handbook, but that file no longer works since upgrading to syslog-ng v3.0.4. There are apparently several significant syntax changes to the conf file format. I know I could RTFM, but would somebody please throw me a bone on this one? ;-)

Thanks in advance! -Ross
Top
cookiecrusher
n00b
n00b
User avatar
Posts: 23
Joined: Tue Jun 10, 2008 12:19 pm

  • Quote

Post by cookiecrusher » Fri Nov 20, 2009 8:54 am

Posting some extracts of mine, maybe you're recognizing, what you need to change :>
(Hint: first line, destinations and statements)

Code: Select all

[~]% cat /etc/syslog-ng/syslog-ng.conf
@version: 3.0
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.3.0,v 1.7 2007/08/02 04:52:18 mr_bones_ Exp $
#
# Syslog-ng default configuration file for Gentoo Linux
# contributed by Michael Sterrett
#################################################
#
## Some global options
#
options { 
	chain_hostnames(no); 
	flush_lines(0);
	stats_freq(43200); 
	mark_freq(43200);
  time_reopen (10);
  log_fifo_size (1000);
  long_hostnames(off);
  use_dns (no);
  use_fqdn (no);
  create_dirs (no);
  keep_hostname (yes);
  perm(0640);
};

#################################################

source src {
    unix-stream("/dev/log" max-connections(256));
    internal();
    file("/proc/kmsg");
};

#################################################

#
## Some destinations
#

destination d_authlog { file("/var/log/sys/auth.log"); };
destination d_syslog { file("/var/log/sys/syslog"); };
#
## This files are the log come from the mail subsystem.
#
destination d_mail { file("/var/log/mail/mail.log"); };

#
## Logging to tty12.
#
destination console_all { file("/dev/tty12"); };

#
## Some filter
#
filter f_authpriv { facility(auth, authpriv); };
filter f_syslog { not facility(auth, authpriv) and not facility(mail); };
filter f_mail { facility(mail); };

#################################################

#
## Log statements send logs somewhere, files, across the network, etc.
#

log { source(src); filter(f_authpriv); destination(d_authlog); };
log { source(src); destination(console_all); };
~ If love can kill people, surely hatred can save them ~
Noir - Altena, Ep 26
Top
xtz
Apprentice
Apprentice
User avatar
Posts: 181
Joined: Mon Oct 29, 2007 12:23 pm
Location: Singapore

  • Quote

Post by xtz » Fri Nov 20, 2009 10:18 am

It is the config from the Gentoo Security Handbook, modified for syslog-ng 3.x. I have changed a few things, mainly about the e-mail logging, the rest is unchanged.

Code: Select all

xtz@DeathStar ~ $ cat /etc/syslog-ng/syslog-ng.conf
@version: 3.0
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.3.0,v 1.1 2009/05/25 20:07:21 mr_bones_ Exp $
#
# Syslog-ng customized configuration file for Gentoo Linux

options {
        chain_hostnames(no);

        # The default action of syslog-ng is to log a STATS line
        # to the file every 10 minutes.  That's pretty ugly after a while.
        # Change it to every 12 hours so you get a nice daily update of
        # how many messages syslog-ng missed (0).
        stats_freq(43200);
};

source src {
    unix-stream("/dev/log" max-connections(256));
    internal();
};

source kernsrc { file("/proc/kmsg"); };

#define destinations
destination authlog { file("/var/log/auth.log"); };
destination cron { file("/var/log/cron.log"); };
destination daemon { file("/var/log/daemon.log"); };
destination kern { file("/var/log/kern.log"); };
destination user { file("/var/log/user.log"); };
destination mail { file("/var/log/mail.log"); };

destination debug { file("/var/log/debug"); };
destination messages { file("/var/log/messages"); };
destination console { usertty("root"); };

# By default messages are logged to tty12...
destination console_all { file("/dev/tty12"); };
# ...if you intend to use /dev/console for programs like xconsole
# you can comment out the destination line above that references /dev/tty12
# and uncomment the line below.
#destination console_all { file("/dev/console"); };

#create filters
filter f_authpriv { facility(auth, authpriv); };
filter f_cron { facility(cron); };
filter f_daemon { facility(daemon); };
filter f_kern { facility(kern); };
filter f_mail { facility(mail); };
filter f_user { facility(user); };
filter f_debug { not facility(auth, authpriv, news, mail); };
filter f_messages { level(info..warn)
        and not facility(auth, authpriv, cron, mail, news); };
filter f_emergency { level(emerg); };

filter f_notice { level(notice); };
filter f_crit { level(crit); };
filter f_failed { message("failed"); };
filter f_denied { message("denied"); };


#connect filter and destination
log { source(src); filter(f_authpriv); destination(authlog); };
log { source(src); filter(f_cron); destination(cron); };
log { source(src); filter(f_daemon); destination(daemon); };
log { source(kernsrc); filter(f_kern); destination(kern); };
log { source(src); filter(f_mail); destination(mail); };
log { source(src); filter(f_user); destination(user); };

log { source(src); filter(f_debug); destination(debug); };
log { source(src); filter(f_messages); destination(messages); };
log { source(src); filter(f_emergency); destination(console); };

#default log
log { source(src); destination(console_all); };
Top
rpmohn
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 116
Joined: Tue Aug 26, 2003 3:59 pm
Location: Vermont
Contact:
Contact rpmohn
Website

  • Quote

Post by rpmohn » Fri Nov 20, 2009 7:36 pm

Thanks much! Cheers -Ross
Top
hoyanf
Tux's lil' helper
Tux's lil' helper
Posts: 80
Joined: Sat Aug 27, 2005 10:30 pm
Location: Malaysia

Revised version

  • Quote

Post by hoyanf » Fri Apr 02, 2010 6:33 am

I'd think the site admin should update the site for current configs...

Regards,
hoyanf
WorkPC -> Xeon x3440 | Gigabyte P55-UD6 | 16GB DDR3 | HDD1 - 600GB | HDD2 - 500 GB | HDD3 - 1TB
HomePC -> Xeon x3320 | Gigabyte GA-EP45-UD3P | 8GB DDR2 | HDD1 - 500GB | HDD2 - 1TB
Top
mimosinnet
l33t
l33t
User avatar
Posts: 720
Joined: Thu Aug 10, 2006 4:20 pm
Location: Barcelona, Spain
Contact:
Contact mimosinnet
Website

Re: Revised version

  • Quote

Post by mimosinnet » Sat Apr 03, 2010 8:35 pm

hoyanf wrote:I'd think the site admin should update the site for current configs...
I often look at the gentoo wiki after reading the official documentation in case there are any updates.

Cheers!
Top
likewhoa
l33t
l33t
Posts: 778
Joined: Wed Oct 04, 2006 12:28 pm
Location: Brooklyn, New York
Contact:
Contact likewhoa
Website

Re: Revised version

  • Quote

Post by likewhoa » Thu Dec 30, 2010 10:11 pm

mimosinnet wrote:
hoyanf wrote:I'd think the site admin should update the site for current configs...
I often look at the gentoo wiki after reading the official documentation in case there are any updates.

Cheers!
the wiki is outdated since v3
Top
Post Reply

7 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic