Benches macOS

7

ipfw not logging, is the local1 facility …

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi,

I'm using, on OSX 10.6.4, ipfw with a personal set of rules, while keeping the appfirewall inactive.

My syslog.conf file is the standard one (or so I think) from Apple and it includes the line:

local1.* /var/log/ipfw.log

I get all the ipfw related messages in /var/log/kernel.log but nothing in ipfw.log

Nothing either in appfirewall.log

I have tried setting up net.inet.ip.fw.verbose to 1 and 2 via sysctl, but no change: appfirewall.log and ipfw.log remain empty and kernel.log receives all the ipfw messages.

My question is: is there a way to log ipfw messages to either ipfw.log (preferably) or (at least) to appfirewall.log

Thank you!

Miguel

7 replies

Sign in or join Beachball Help to reply.

  1. 0

    doug pennington

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Not running Snow Leopard, but

    sudo sysctl -w net.inet.ip.fw.verbose: 1

    maybe?
    and what does


    sudo sysctl net.inet.ip.fw

    show?

    Message was edited by: doug pennington

  2. 0

    ibdeno

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    doug pennington wrote:

    Not running Snow Leopard, but

    sudo sysctl -w net.inet.ip.fw.verbose: 1

    maybe?

    Not... The only difference between net.inet.ip.fw.verbose=2 and =1 is that in the former case nothing gets logged (contrary to what Apple's "Snow Leopard Security Config" brochure states, namely, that both appfirewall and ipfw would send their messages to appfirewall.log) whereas net.inet.ip.fw.verbose=1 sends ipfw messages to kernel.log (but not to ipfw.log)

    and what does


    sudo sysctl net.inet.ip.fw

    show?

    At the moment:

    net.inet.ip.fw.enable: 1

    net.inet.ip.fw.autoinc_step: 100

    net.inet.ip.fw.one_pass: 0

    net.inet.ip.fw.debug: 0

    net.inet.ip.fw.verbose: 1

    net.inet.ip.fw.verbose_limit: 65535

    net.inet.ip.fw.dyn_buckets: 256

    net.inet.ip.fw.curr
    dynbuckets: 256

    net.inet.ip.fw.dyn_count: 284

    net.inet.ip.fw.dyn_max: 4096

    net.inet.ip.fw.static_count: 43

    net.inet.ip.fw.dyn
    acklifetime: 300

    net.inet.ip.fw.dyn
    synlifetime: 20

    net.inet.ip.fw.dyn
    finlifetime: 1

    net.inet.ip.fw.dyn
    rstlifetime: 1

    net.inet.ip.fw.dyn
    udplifetime: 10

    net.inet.ip.fw.dyn
    shortlifetime: 5

    net.inet.ip.fw.dyn_keepalive: 1

    Thanks for the suggestions!

    Miguel

  3. 0

    Clea Rees

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I don't suppose this is helpful since so much changed between Tiger and Leopard regarding the firewall(s) and I've never used Leopard or later. However, this is what I used to get ipfw to log to ipfw.log on Tiger. According to my script, this was based on a hint from macoxhints.com to get the firewall logging and directing stuff correctly (so I'm assuming I had trouble, too).


    /usr/sbin/sysctl -w net.inet.ip.fw.verbose=2
    pid=`ps ax | awk '{if (match($5, ".*/ipfwloggerd$") || $5 == "ipfwloggerd") print $1}'`
    if test "x$pid" != x; then
    ConsoleMessage -v "ipfwloggerd is logging."
    else
    ConsoleMessage -v "Starting ipfwloggerd."
    /usr/libexec/ipfwloggerd
    fi

    If you know how to get ipfw6 to log to anything but system.log, I'd be
    very pleased to hear it!

    - cfr

  4. 0

    Clea Rees

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I should, perhaps, have added that what works for me contradicts the man page for ipfw. According the the manual page, net.inet.ip.fw.verbose must be 1 for logging to occur. I can only say that the code I posted definitely works - I do not have an empty ipfw.log!

    Do you have an executable
    /usr/libexec/ipfwloggerd on your system?

  5. 0

    ibdeno

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Clea Rees wrote:

    Do you have an executable
    /usr/libexec/ipfwloggerd on your system?

    Hi Clea,

    Thank you!

    No, unfortunately ipfwloggerd seems to have disappeared from Snow Leopard. I activated appfwloggerd, but it does not log ipfw messages...

    The "Snow Leopard Security Config" manual suggests that when net.inet.ip.fw.verbose=2 ipfw messages are logged in /var/log/ipfw.log. Sadly, it is not true (or not as easy as presented there) I was hoping that someone from Apple would drop a word here...

  6. 0

    earthsound

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Unfortunately, I can't confirm the default 10.6.x syslog facility code for the firewall, as I'm running 10.4.11 Server (there, local0 is the facility for firewall messages).

    However, have you tried using either WaterRoof or NoobProof?

    http://www.hanynet.com/comparison.html

  7. 0

    KXsig

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi there,

    As I was getting less log messages that I wanted I made some changes to my syslog.conf and asl.conf.

    If you make any changes don't forget to kill syslogd so that it reads the new settings.

    Here's what I did to syslog.conf:

    *.crit;auth.info /var/log/anycritical
    eauthinfo.log (specify the name you want)

    kern.notice /var/log/kernel.log

    . /var/log/system.log (this I added today as this file stopped growing)

    # Send messages normally sent to the console also to the serial port.

    # To stop messages from being sent out the serial port, comment out this line.

    *.crit macbookpro,root

    *.err /dev/console

    (these two lines above are going down soon, I'll add facilities here because there are many messages being flushed to my term window)

    # The authpriv log file should be restricted access; these

    # messages shouldn't go to terminals or publically-readable

    # files.

    auth.info /var/log/secure.log

    lpr.err /var/log/lpr.log

    mail.debug /var/log/mail.log

    user.notice /var/log/usernotice.log

    daemon.err /var/log/daemonerr.log

    syslog.crit /var/log/syslogcrit.log

    news.notice /var/log/news_usenet.log

    uucp.warning /var/log/unixtounixcopywarning.log

    cron.notice /var/log/cron_notice.log

    (above I added one entry for each Unix facility just for testing propose, only usernotice and daemonerr were started)

    install.* /var/log/install.log

    install.* @127.0.0.1:32376

    local0.* /var/log/appfirewall_lo0.log

    local1.* /var/log/appfirewall_lo1a7.log

    local2.* /var/log/appfirewall_lo1a7.log

    local3.* /var/log/appfirewall_lo1a7.log

    local4.* /var/log/appfirewall_lo1a7.log

    local5.* /var/log/appfirewall_lo1a7.log

    local6.* /var/log/appfirewall_lo1a7.log

    local7.* /var/log/appfirewall_lo1a7.log

    (as I didn't understood the localN concept I just added all, this could be also like local0,local1,local2,local3....local7.* filename.extension

    *.err *

    (this one will be moved away too)

    And in asl.conf I did this:

    ? [T com.apple.message.domain] store_directory /var/log/DiagnosticMessages exclude_asldb

    (here I specifyied "directory" as in man page, the original uses "dir")

    # authpriv messages are root/admin readable

    ? [= Facility authpriv] access 0 80

    # remoteauth critical, alert, and emergency messages are root/admin readable

    ? [= Facility remoteauth] [<= Level info] store /var/log/anycritical
    eauthinfo.log

    # broadcast emergency messages

    ? [>= Level error] broadcast

    # save kernel [PID 0] and launchd [PID 1] messages

    ? [<= PID 1] [>= Level notice] store /var/log/kernel.log

    (here I specified level and file but kept the original line below)

    ? [<= PID 1] store

    # save everything from emergency to notice

    ? [<= Level info] store

    # save lpr info level and above

    ? [<= Level error] [= Facility lpr] store /var/log/lpr.log

    # save all mail, ftp, local0, and local1 messages

    ? [= Facility mail] store /var/log/mail.log

    ? [= Facility daemon] store /var/log/daemonerr.log

    ? [= Facility local0] store /var/log/appfirewall_lo0.log

    ? [= Facility local1] store /var/log/appfirewall_lo1a7.log

    ? [= Facility local2] store /var/log/appfirewall_lo1a7.log

    ? [= Facility local3] store /var/log/appfirewall_lo1a7.log

    ? [= Facility loca14] store /var/log/appfirewall_lo1a7.log

    ? [= Facility local5] store /var/log/appfirewall_lo1a7.log

    ? [= Facility local6] store /var/log/appfirewall_lo1a7.log

    ? [= Facility local7] store /var/log/appfirewall_lo1a7.log

    (above I reflected the syslog.conf items so they can be in accordance - and right now I found that error in my file "local14")

    I used some reference from http://www.softpanorama.org/Logs/syslog.shtml

    Hope it gives you some light.

    Good luck.