•
floppyfw config •
floppyfw firewall.ini •
remote logging in » Linux •
Windows™ •
Oregon
•
# # Turning on syslogd and klogd. # This is a nice thing but will eat CPU which is why it is turned # off by default. # The firewall.ini file is where you can turn on logging of rejected packages. # USE_SYSLOG=y # Uncomment to log to /dev/vc/4 instead of /var/log/messages # which aren't exactly a good idea on a ramdisk. SYSLOG_TTY="-O $DEBUG_LOG" # Or the another virtual console than the other messages: SYSLOG_TTY="-O /dev/vc/4" # Uncomment to log to network. host:port SYSLOG_NET="-R 10.42.42.2:514" # Uncomment to not print a mark SYSLOG_MARK="-m 0" [ "$SYSLOG_TTY" -a "$SYSLOG_NET" ] && SYSLOG_BOTH="-L" SYSLOG_FLAGS="$SYSLOG_MARK $SYSLOG_TTY $SYSLOG_NET $SYSLOG_BOTH"
•
floppyfw config •
floppyfw firewall.ini •
remote logging in » Linux •
Windows™ •
Oregon
•
#
# Policy for chains DROP everything
#
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
# LOG Chains
iptables -N SynfloodLOG
iptables -A SynfloodLOG -m limit -j LOG --log-prefix "Syn-flood DROP [-]: "
iptables -A SynfloodLOG -j DROP
#
iptables -N NewnotsynLOG
iptables -A NewnotsynLOG -m limit -j LOG --log-prefix "Newnotsyn DROP [-]: "
iptables -A NewnotsynLOG -j DROP
#
iptables -N StateLOG
iptables -A StateLOG -j LOG --log-prefix "State DROP [-]: "
iptables -A StateLOG -j DROP
#
iptables -N ap113LOG
iptables -A ap113LOG -m limit -j LOG --log-prefix "ap113LOG RET [-]: "
iptables -A ap113LOG -j RETURN
#
# SYN-Flooding protection
# Looks good and nicked from a firewall script mentioned on floppyfw.something.
# Didn't work that well..
#
iptables -N syn-flood
iptables -A INPUT -i ${OUTSIDE_DEVICE} -p tcp --syn -j syn-flood
iptables -A syn-flood -m limit --limit 1/s --limit-burst 4 -j RETURN
# iptables -A syn-flood -j DROP
iptables -A syn-flood -j SynfloodLOG
# Make sure NEW tcp connections are SYN packets
# iptables -A INPUT -i ${OUTSIDE_DEVICE} -p tcp ! --syn -m state --state NEW -j DROP
iptables -A INPUT -i ${OUTSIDE_DEVICE} -p tcp ! --syn -m state --state NEW -j \
NewnotsynLOG
#
# Keep state and open up for outgoing connections.
#
iptables -A FORWARD -m state --state NEW -i ${INSIDE_DEVICE} -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -A FORWARD -m state --state NEW,INVALID -i ${OUTSIDE_DEVICE} -j DROP
iptables -A FORWARD -m state --state NEW,INVALID -i ${OUTSIDE_DEVICE} -j StateLOG
#
# If the user wants to have the fake identd running, the identd has to
# be able to answer.
#
if [ ${FAKEIDENT} ]
then
iptables -A INPUT -p TCP --dport 113 -i ${OUTSIDE_DEVICE} -j ACCEPT
else
iptables -A INPUT -p TCP --dport 113 -i ${OUTSIDE_DEVICE} -j ap113LOG
iptables -A INPUT -p TCP --dport 113 -i ${OUTSIDE_DEVICE} -j REJECT \
--reject-with tcp-reset
fi
•
floppyfw config •
floppyfw firewall.ini •
remote logging in » Linux •
Windows™ •
Oregon
•
fedora core 5 file: /etc/sysconfig/syslog # Options to syslogd # -m 0 disables 'MARK' messages. # -r enables logging from remote machines # -x disables DNS lookups on messages recieved with -r # See syslogd(8) for more details SYSLOGD_OPTIONS="-m 0 -r" • • •
fedora core 5 file: /etc/rc.d/init.d/syslog (symlinked as /etc/init.d/syslog) #!/bin/bash # # syslog Starts syslogd/klogd. # # # chkconfig: 2345 12 88 # description: Syslog is the facility by which many daemons use to log \ # messages to various system log files. It is a good idea to always \ # run syslog. ### BEGIN INIT INFO # Provides: $syslog ### END INIT INFO # Source function library. . /etc/init.d/functions [ -f /sbin/syslogd ] || exit 0 [ -f /sbin/klogd ] || exit 0 # Source config if [ -f /etc/sysconfig/syslog ] ; then . /etc/sysconfig/syslog else SYSLOGD_OPTIONS="-m 0 -r" KLOGD_OPTIONS="-2" fi • • •
fedora core 5 file: /etc/syslog.conf
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages
# The authpriv file has restricted access.
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* -/var/log/maillog
# Log cron stuff
cron.* /var/log/cron
# Everybody gets emergency messages
*.emerg *
# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler
# Save boot messages also to boot.log
local7.* /var/log/boot.log
"Kiwi Syslog Daemon is designed to be as flexible and as easy to use as possible. For this reason it is extremely easy to initially setup. To setup Kiwi Syslog Daemon all you need to do is install the application in the desired location on your system. By default it will listen for syslog messages that are sent to UDP port 514. For the basic configuration no further setup is required. To have Kiwi Syslog Daemon receive syslog messages you will need to configure your sending network devices to send their information to the IP address of the system that Kiwi Syslog Daemon is installed on. "
•
floppyfw config •
floppyfw firewall.ini •
remote logging in » Linux •
Windows™ •
Oregon
•
Some useful references:
floppyfw
iptables-tutorial
sans.org paper1529.pdf