
#-----------------------------------------------------------------------
# CHANGES
#-----------------------------------------------------------------------
#
# 2000-10-14  Jean-Sebastien Morisset <jsmoriss@jsm-mv.dyndns.org>
#             Initial module written for v5.0.
#
#-----------------------------------------------------------------------
# MODULE CONFIGURATION
#-----------------------------------------------------------------------
#
#N# https
#A# accept ignore deny
#T# clients
#   |--------------------------------------------------------------------|
#D# The accept option opens access to your port 443 (secure HTTP) for 
#D# these hosts/networks. If you have a secure (SSL) web server on your
#D# firewall, you'll probably want to use "any/0".
#D#
#D# You might want anyone to connect to your secure web server, but you'd
#D# like to exclude a few hosts and/or networks. They could have tried to
#D# attack this service, shouldn't know about it, etc. Use the ignore 
#D# and/or deny options. The deny option will log every failed packet, 
#D# where-as the ignore option will not log anything.
#D#
#D# Example:
#D#   accept-eth1-https-clients="any/0"
#D#   deny-eth1-https-clients="207.253.78.0/24"
#D#
#D# This will let anyone connect to your HTTPS server, except hosts in the 
#D# 207.253.78.* network.
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------


#--------------------------------------------------------------------
# HTTPS Server (Port 443)
#--------------------------------------------------------------------

for ACTION in IGNORE DENY ACCEPT
do
	case $ACTION in
		IGNORE)	ACTION_LOG_MSG="$LOG_MSG"; ACTION_LOG="$LOG";;
		DENY)	ACTION_LOG_MSG="(logged)"; ACTION_LOG="-l"  ;;
		ACCEPT)	ACTION_LOG_MSG=""        ; ACTION_LOG=""    ;;
	esac
	for HOST in `Option_Value $ACTION $INTERFACE HTTPS CLIENTS`
	do
		case $ACTION in
			IGNORE|DENY)
				echo "Deny $INTERFACE $IPADDR HTTPS <- $HOST $ACTION_LOG_MSG"
				ipchains -A $INCHAIN -j DENY -p tcp -s $HOST -d $IPADDR https $ACTION_LOG
				;;
			ACCEPT)
				Accept_Hostports $INTERFACE tcp "HTTPS" $HOST https
				;;
		esac
	done
done

