[Bug 218633] /security/ossec-hids-local host-deny.sh add ip's to hosts.allow permanently

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Apr 13 14:55:22 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218633

            Bug ID: 218633
           Summary: /security/ossec-hids-local host-deny.sh add ip's to
                    hosts.allow permanently
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs at FreeBSD.org
          Reporter: netbackup.gs at gmail.com

/usr/local/ossec-hids/active-response/bin/host-deny.sh dosent delete entries in
/etc/hosts.allow
Mktemp /var/ossec/ossec-hosts.XXXXXXXXXX is the problem i think, maybe
/tmp/ossec-hosts.XXXXXXXXXX ?

cat host-deny.sh:

# Deleting from hosts.deny   
elif [ "x${ACTION}" = "xdelete" ]; then   
   lock;
   TMP_FILE = `mktemp /var/ossec/ossec-hosts.XXXXXXXXXX` 
   if [ "X${TMP_FILE}" = "X" ]; then 
     # Cheap fake tmpfile, but should be harder then no random data 
     TMP_FILE = "/var/ossec/ossec-hosts.`cat /dev/urandom | tr -dc 'a-zA-Z0-9'
| fold -w 32 | head -1 `"
   fi
   if [ "X$UNAME" = "XFreeBSD" ]; then
    cat /etc/hosts.allow | grep -v "ALL : ${IP} : deny$"> ${TMP_FILE}
    mv ${TMP_FILE} /etc/hosts.allow
   else
    cat /etc/hosts.deny | grep -v "ALL:${IP}$"> ${TMP_FILE}
    cat ${TMP_FILE} > /etc/hosts.deny
    rm ${TMP_FILE}
   fi 
   unlock;
   exit 0;


Mktemp /var/ossec/

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list