IP Blocking
The TOE supports the definition of known-good and known-bad lists of source and/or
destination addresses at the firewall rule level. These can be single IPs or a range of
IPs. Address ranges are defined by creating address book entries and attaching them to
firewall policies. Addresses in known-good lists would be combined with a
‘permit’ action in the firewall policies, while those in the
known-bad lists with a ‘deny’ action. Security administrators are the
only ones capable of defining IPS policy elements for the known-good and known-bad
lists.
To implement IP blocking, administrators must first create address book entries for the known-good and known-bad hosts or ranges. These entries are then grouped into address sets and referenced in security policies to enforce the appropriate permit or deny actions. The following steps provide the configuration procedure.
Define known good single IP address:
[edit] user@host# set security address-book global address good-host-1 192.0.2.10/32
Define known good IP range using range-address:
[edit] user@host# set security address-book global address good-range-1 range-address 192.0.2.20 to 192.0.2.30
Define known bad single IP address:
[edit] user@host# set security address-book global address bad-host-1 203.0.113.10/32
Define known bad IP range using range-address:
[edit] user@host# set security address-book global address bad-range-1 range-address 203.0.113.100 to 203.0.113.110
Create known good address set:
[edit] user@host# set security address-book global address-set known-good-hosts address good-host-1 user@host# set security address-book global address-set known-good-hosts address good-range-1
Create known bad address set:
[edit] user@host# set security address-book global address-set known-bad-hosts address bad-host-1 user@host# set security address-book global address-set known-bad-hosts address bad-range-1
Deny traffic from known bad addresses:
[edit] user@host# set security policies from-zone untrust to-zone trust policy deny-bad-sources match source-address known-bad-hosts destination-address any application any user@host# set security policies from-zone untrust to-zone trust policy deny-bad-sources then deny
Allow traffic from known good addresses:
[edit] user@host# set security policies from-zone untrust to-zone trust policy allow-good-sources match source-address known-good-hosts destination-address any application any user@host# set security policies from-zone untrust to-zone trust policy allow-good-sources then permit
Commit configuration:
[edit] user@host# commit
Verify address book:
[edit] user@host> show configuration security address-book global
Verify policies:
[edit] user@host> show configuration security policies
To delete existing address entries from address books:
[edit] user@host# delete security address-book global address good-host-1
Configuration Examples:
Create a single entry of a known bad address and an additional entry with a range of known bad addresses:
set security address-book global address known-bad 10.1.3.92/32 set security address-book global address known-bad-range range-address 10.1.3.93 to 10.1.3.97 set security policies from-zone trust to-zone untrust policy known-bad-policy match source-address any set security policies from-zone trust to-zone untrust policy known-bad-policy match destination-address known-bad set security policies from-zone trust to-zone untrust policy known-bad-policy match application any set security policies from-zone trust to-zone untrust policy known-bad-policy then deny set security policies from-zone trust to-zone untrust policy known-bad-policy then log session-init set security policies from-zone trust to-zone untrust policy known-bad-policy then log session-close set security policies from-zone trust to-zone untrust policy known-bad-range-policy match source-address any set security policies from-zone trust to-zone untrust policy known-bad-range-policy match destination-address known-bad-range set security policies from-zone trust to-zone untrust policy known-bad-range-policy match application any set security policies from-zone trust to-zone untrust policy known-bad-range-policy then deny set security policies from-zone trust to-zone untrust policy known-bad-range-policy then log session-init set security policies from-zone trust to-zone untrust policy known-bad-range-policy then log session-close set security policies from-zone trust to-zone untrust policy vpn-bypass match source-address any set security policies from-zone trust to-zone untrust policy vpn-bypass match destination-address any set security policies from-zone trust to-zone untrust policy vpn-bypass match application any set security policies from-zone trust to-zone untrust policy vpn-bypass then permit set security policies from-zone trust to-zone untrust policy vpn-bypass then log session-init set security policies from-zone trust to-zone untrust policy vpn-bypass then log session-close
Create a single entry of a known-good address and an additional entry with a range of known-good addresses:
set security address-book global address known-good 10.1.9.21/32 set security address-book global address known-good-range range-address 10.1.9.22 to 10.1.9.26 set security policies from-zone trust to-zone untrust policy known-good-policy match source-address any set security policies from-zone trust to-zone untrust policy known-good-policy match destination-address known-good set security policies from-zone trust to-zone untrust policy known-good-policy match application any set security policies from-zone trust to-zone untrust policy known-good-policy then permit set security policies from-zone trust to-zone untrust policy known-good-policy then log session-init set security policies from-zone trust to-zone untrust policy known-good-policy then log session-close set security policies from-zone trust to-zone untrust policy known-good-range-policy match source-address any set security policies from-zone trust to-zone untrust policy known-good-range-policy match destination-address known-good-range set security policies from-zone trust to-zone untrust policy known-good-range-policy match application any set security policies from-zone trust to-zone untrust policy known-good-range-policy then permit set security policies from-zone trust to-zone untrust policy known-good-range-policy then log session-init set security policies from-zone trust to-zone untrust policy known-good-range-policy then log session-close
Apply the address book entries to two security policies to deny and accept the same address entries with the deny policy being applied first:
set security address-book global address known-bad 10.1.9.21/32 set security address-book global address known-bad-range range-address 10.1.9.22 to 10.1.9.26 set security address-book global address known-good 10.1.9.21/32 set security address-book global address known-good-range range-address 10.1.9.22 to 10.1.9.26 set security policies from-zone trust to-zone untrust policy deny-policy match source-address known-bad set security policies from-zone trust to-zone untrust policy deny-policy match source-address known-bad-range set security policies from-zone trust to-zone untrust policy deny-policy match destination-address any set security policies from-zone trust to-zone untrust policy deny-policy match application any set security policies from-zone trust to-zone untrust policy deny-policy then deny set security policies from-zone trust to-zone untrust policy deny-policy then log session-init set security policies from-zone trust to-zone untrust policy deny-policy then log session-close set security policies from-zone trust to-zone untrust policy allow-policy match source-address known-good set security policies from-zone trust to-zone untrust policy allow-policy match source-address known-good-range set security policies from-zone trust to-zone untrust policy allow-policy match destination-address any set security policies from-zone trust to-zone untrust policy allow-policy match application any set security policies from-zone trust to-zone untrust policy allow-policy then permit set security policies from-zone trust to-zone untrust policy allow-policy then log session-init set security policies from-zone trust to-zone untrust policy allow-policy then log session-close
Apply the address book entries to two security policies to deny and accept the same address entries with the accept policy being applied first:
set security address-book global address known-bad 10.1.9.21/32 set security address-book global address known-bad-range range-address 10.1.9.22 to 10.1.9.26 set security address-book global address known-good 10.1.9.21/32 set security address-book global address known-good-range range-address 10.1.9.22 to 10.1.9.26 set security policies from-zone trust to-zone untrust policy allow-policy match source-address known-good set security policies from-zone trust to-zone untrust policy allow-policy match source-address known-good-range set security policies from-zone trust to-zone untrust policy allow-policy match destination-address any set security policies from-zone trust to-zone untrust policy allow-policy match application any set security policies from-zone trust to-zone untrust policy allow-policy then permit set security policies from-zone trust to-zone untrust policy allow-policy then log session-init set security policies from-zone trust to-zone untrust policy allow-policy then log session-close set security policies from-zone trust to-zone untrust policy deny-policy match source-address known-bad set security policies from-zone trust to-zone untrust policy deny-policy match source-address known-bad-range set security policies from-zone trust to-zone untrust policy deny-policy match destination-address any set security policies from-zone trust to-zone untrust policy deny-policy match application any set security policies from-zone trust to-zone untrust policy deny-policy then deny set security policies from-zone trust to-zone untrust policy deny-policy then log session-init set security policies from-zone trust to-zone untrust policy deny-policy then log session-close