Friday, November 11, 2022

Identity Awareness

 Identity Awareness - IDC Problems

Examples of information to include would be:

  • cpinfo -y all
  • enabled_blades
  • fw stat
  • cpinfo from gateway and cpinfo / migrate export from management server
  • Screen shots of the issue
  • any debug outputs or traffic captures which have been collected.
Enabling Identity Awareness on the Security Gateway
Checking where the issue resides and provide this extra info to TAC.
Type the following commands on both 
  • PDP (Policy Decision Point - acquires identity from identity sources and shares identity with other gateways). PDP - The process on the Security Gateway responsible for collecting and sharing identities.

  • PEP (Policy Enforcement Point - received identity via identity sharing, redirects users to captive portal ) to see where the identity is known. PEP - The process on the Security Gateway responsible for enforcing network access restrictions. Decisions are made according to identity data collected from the PDP.

  • AD Query - AD Query is the module responsible for acquiring identities of entities (users or computers) from the AD (Active Directory). AD Query was called Identity Logging in previous versions and in some cases is also referenced as AD Log. The adlog is the command line process used to control and monitor the AD Query feature.

  • test_ad_connectivity - A utility that runs connectivity tests from the Security Gateway to an AD domain controller.

adlog a dc
pdp connections pep

pdp m u <PROBLEMATIC USERNAME>
or alternatively:
pdp m ip <PROBLEMATIC IP>
pdp status show
pdp m user
pdp m ip
pdp show
pdp show connections
pdp connections
pdp connections pep
pdp monitor ip 10.14.22.255
pdp monitor user dkhemr01


and on the PEP side:
pep sh u q cid <PROBLEMATIC IP>
or alternatively:
pep sh u q usr <PROBLEMATIC USERNAME>
pep show user all
pep show user all | wc -l
pep show
pep show user
pep show user query
pep show user query usr dkhemr01
pep sh u q cid 10.14.22.255
pep show user query usr _LD36501

adlog a dc IP


In addition to the above outputs, please provide TAC:
1. cpinfo from both PDP and PEP (if these are different machines)
2. log files:
$FWDIR/log/pdpd.elg*
$FWDIR/log/pepd.elg*

[Expert@myFW-int01]# ls -lh $FWDIR/log/pdpd*

-rw-rw-r-- 1 admin root 8.2M May 6 22:40 /opt/CPsuite-R77/fw1/log/pdpd.elg



[Expert@my-vpn:0]# pdp status show
PDP Daemon status
=================
Daemon start time :  8Nov2022 22:05:56
Policy fetched at : 10Nov2022 18:05:31

Connected PEPs    : 0

[Expert@my-vpn:0]# 

DEBUG 
[Expert@myFW-int01]# # pdp d off
debug is now off
[Expert@myFW-int01]# 

[Expert@myFW-int01]#  adlog a d on
adlog debug is already turned on

[Expert@myFW-int01]#  pdp d s all all
Debug is now turned ON
The following topics were added:
topic severity
=====================
+ all all
[Expert@myFW-int01]# pep d s all all
Debug is now turned ON
The following topics were added:
topic severity
=====================
+ all all
[Expert@myFW-int01]#  adlog a d off
adlog debug is turned off
[Expert@myFW-int01]#  pdp d unset all all


Here is the SK: https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk113833&partition=Advanced&product=Identity

And the command that has to be run on both cluster members at the same time:

cat $FWDIR/lib/nac_tables.def | grep dynamic | cut -d ' ' -f1 | awk '{ print ("-t "$0"")}' ORS=" " | awk '{print "fw tab " $0 "-x -y"}' | bash ; fw kill pdpd ; fw kill pepd

The PEP and PDP processes are key components of the system. Through them, administrators control user access and network protection.
AD Query can run either on a Security Gateway that has been enabled with Identity Awareness or on a Log Server. 
When it runs on a Security Gateway, AD Query serves the Identity Awareness feature, and gives logging and policy enforcement. When it runs on a Log Server, AD Query gives identity logging. 
The command line tool helps control users’ statuses as well as troubleshoot and monitor the system.

The test_ad_connectivity utility runs over both the LDAP and WMI protocols. It is usually used by the SmartDashboard Identity Awareness first time wizard, but you can run it manually on the Security Gateway when needed.

1. Go to cluster settings
2. Click on Identity Awareness -> Identity Sharing
3. Check box to enable sharing of identities
4. Publish and install policy
Checkpoint will also run debug commands to further investigate the issue. Running debug commands can be disruptive.
Here is an example of one of the commands Checkpoint will run to clear up the sessions table
fw tab -t pdp_sessions -t pdp_super_sessions -t pdp_encryption_keys -t pdp_whitelist -t pdp_timers -t pdp_expired_timers -t pdp_ip -t pdp_net_reg -t pdp_net_db -t pdp_cluster_stat -t pep_pdp_db -t pep_networks_to_pdp_db -t pep_net_reg -t pep_reported_network_masks_db -t pep_network_to_ips -t pep_network_to_ips_stats -t pep_port_range_db -t pep_async_id_calls -t pep_client_db -t pep_identity_index -t pep_revoked_key_clients -t pep_src_mapping_db -t pep_log_completion -x -y; fw kill pdpd; fw kill pepd

fw tab -t pep_client_db -s

pep show user query usr myname

pdp

Description These commands control and monitor the PDP process.
Syntax # pdp [command]... <parameter>
Parameter
Description
<none>
Display available options for this command and exit
debug
Control debug messages
tracker
Tracker options
connections
pdp connections information
network
pdp network information
status
pdp status information
control
pdp control commands
monitor
Display monitoring data
update
Recalculate users and computers group membership (deleted accounts will not be updated)
ad
Operations related to AD Query
timers
Show pdp timers information

pdp monitor

Description Lets you monitor the status of connected sessions. You may perform varied queries according to the usage below to get the output you are interested in.
Syntax # pdp monitor <parameter> <option>
Parameter
Description
all
Display information for all connected sessions
user <user name>
Display session information for the given user name
ip <IP address>
Display session information for the given IP address
machine <computer name>
Display session information for the given computer name
mad
Display all sessions that relate to a managed asset (i.e. all sessions that successfully performed computer authentication)
client_type [unknown|portal|"Identity Agent"|"AD Query"]

Display all sessions connecting via the given client type
Possible client types are:
  • Unknown - User was identified by an unknown source
  • Portal - User was identified by the Captive Portal
  • Identity Agent - User/computer was identified by an Identity Awareness Agent
  • AD Query - User was identified by AD Query
groups <group name>
Display all sessions of users / computers that are members of the given group name
cv_ge <version>
Display all sessions that are connected with a client version that is higher than (or equal to) the given version
cv_le <version>
Display all sessions that are connected via a client version that is lower than (or equal to) the given version.
Example
pdp monitor ip 192.0.2.1
Shows the connected user behind the given IP address (192.0.2.1).
Note - The last field "Published " indicates whether the session information was already published to the Gateway PEPs whose IP addresses are listed.

pdp connections

Description These commands assist in monitoring and synchronizing the communication between the PDP and the PEP.
Syntax # pdp connections <parameter>
Parameter
Description
pep
Shows the connection status of all the PEPs that should be updated by the current PDP

pdp control

Description Provides commands to control the PDP process.
Syntax # pdp control <parameter> <option>
Parameter
Description
revoke_ip <IP address>
Log out the session that is related to the given IP.
revoke_pt_key <session id.>
Revoke the packet tagging key if one exists.
sync
Force an initiated synchronization operation between the PDPs and the PEPs. When running this command, the PDP will inform its related PEPs the up-to-date information of all connected sessions. At the end of this operation, the PDP and the PEPs will contain the same and latest session information.

pdp network

Description Shows information about network related features.
Syntax # pdp network <parameter>
Parameter
Description
info
Display a list of networks known by the PDP.
registered
Display the mapping of a network address to registered gateways (PEP module).

pdp debug

Description Activates and deactivates the debug logs of the PDP daemon.
Syntax # pdp debug <parameter> <option>
Parameter
Description
on
Turn on the debug logs (should be followed by the command "set" to determine the required filter).
off
Turn off the debug logs.
set <topic name> [critical|surprise|
important|events|
all]…

Filter the debug logs that would be written to the debug file according to the given topic and severity
For debug it is recommended to run:
pdp debug set all all
Note that you can place a number of topics and severity pairs.
For example: topicA severityA topicB severityB ...
unset <topic name>…
Unset a specific topic or topics.
stat
Show the status of the debug option.
reset
Reset the debug options of severity and topic. The debug is still activated after running this command.
rotate
Rotate the log files (increase the index of each log file) so that the current log file that will be written is the PDP log. For example, pdpd.elg becomes pdpd.elg.0 and so on.
ccc [on|off]
Allows enabling or disabling writing of the CCC debug logs into the PDP log file.
Important - Activating the debug logs affects the performance of the daemon. Make sure to turn off the debug after you complete troubleshooting.

pdp tracker

Description Adds the TRACKER topic to the PDP logs (on by default). This is very useful when monitoring the PDP-PEP identity sharing and other communication on distributed environments. This can be set manually by adding the TRACKER topic to the debug logs.
Syntax # pdp tracker <parameter>
Parameter
Description
on
Turns on logging of TRACKER events in the PDP log.
off
Turns off the logging of TRACKER events in the PDP log.

pdp status

Description Displays PDP status information such as start time or configuration time.
Syntax # pdp status <parameter>
Parameter
Description
show
Display PDP information.

pdp update

Description Initiates a recalculation of group membership for all users and computers. Note that deleted accounts will not be updated.
Syntax # pdp update <parameter>
Parameter
Description
all
Recalculate group membership for all users and computers.

pdp ad associate

Description For AD Query, adds an identity to the Identity Awareness database on the Security Gateway. The group data must be in the AD.
Syntax # pdp ad associate ip <ip> u <username> d <domain> [m <machine>] [t <timeout>] [s]
Parameter
Description
ip <ip>
IP address for the identity.
u <username>
Username for the identity.
m <machine>
Computer that is defined for the identity.
d <domain>
Domain of the ID server.
t <timeout>
Timeout setting for the AD Query (default is 5 hours).
s
Associates u <username> and m <machine> parameters sequentially. First the <machine> is added to the database and then the <username>.

pdp ad disassociate

Description Removes the identity from the Identity Awareness database on the Security Gateway. Identity Awareness does not authenticate a user that is removed.
Syntax # pdp ad disassociate ip <ip> {u <username>|m <machine>} [r {probed|override|timeout}]
Parameter
Description
ip <ip>
IP address for the identity
u <username>
Username for the identity
m <machine>
Computer that is defined for the identity
t <timeout>
Timeout setting for the AD Query (default is 5 hours)
r {probed|override|timeout}
Reason that is shown in the SmartView Tracker logs

pep

Description Provides commands to control and monitor the PEP process.
Syntax # pep [command]... <argument>
Parameter
Description
tracker
Tracker options.
show
Display PEP information.

pep show

Description Displays information regarding pep status.
Syntax # pep show <parameter> <option>

pep show user

Description Enables monitoring the status of sessions that are known to the PEP. You can perform varied queries according to the usage below to get the output you are interested in.
Syntax # pep show user all
Parameter
Description
all
Display all sessions with information summary.
Query Syntax # pep show user query <parameter>
Parameter
Description
usr <username>
Display session information for the given user name.
mchn <computer name>
Display session information for the given computer name.
cid <IP>
Display session information for the given IP.
uid <uidString>
Display session information for the given session ID.
pdp <IP>
Display all session information that was published from the given PDP IP.
ugrp <group>
Display all sessions of users that are members of the given user group name.
mgrp <group>
Display all sessions of computers that are members of the given computer group name.
Note - You can use multiple query tokens (parameters) at once to create a logical "AND" correlation between them. For example, to display all users that have a sub string of "jo" AND are part of the user group "Employees" then you can use:
# pep show user query usr jo ugrp Employees

pep show pdp

Description Enables monitoring the communication channel between the PEP and the PDP. The output displays the connect time and the number of users that were shared through the connection.
Syntax # pep show pdp <parameter>
Parameter
Description
all
List all the PDPs that are connected to the current PEP with the relevant information.
id <IP>
Display connection information of the given PDP IP.

pep show stat

Description Shows the last time the daemon was started and the last time a policy was received.
Important - Each time the daemon starts, it loads the policy and the two timers (Daemon start time and Policy fetched at) will be very close.
Syntax # pep show stat

pep show network

Description Shows network related information.
Syntax # pep show network <parameter>
Parameter
Description
pdp
Shows information about mapping between the network and PDPs.
registration
Shows which networks this PEP is registered to.

pep debug

Description See pdp debug.

adlog

Description Provides commands to control and monitor the AD Query process.
When AD Query runs on a Security Gateway, AD Query serves the Identity Awareness feature that gives logging and policy-enforcement. In this case the command line is: adlog a <argument> (see below for options)
When it runs on a Log Server, AD Query gives identity logging. In this case, the command line is: adlog l <argument>. Note: the l in adlog l is a lowercase L.
Options for adlog a and adlog l are identical.
Syntax # adlog {a|l} <command>… <argument>
Parameter
Description
<none>
Display available options for this command and exit.
{a|l}
Set the working mode:
adlog l - if you are using a Log Server (identity logging)
adlog a - if you are using AD Query for Identity Awareness.
query
See sections below.
debug
dc
statistics
control
service_accounts

adlog query

Description Shows the database of identities acquired by AD Query, according to the given filter.
Usage adlog [a|l] query <argument>
Syntax
Parameter
Description
ip <IP address>
Filters identities relating to the given IP.
string <string>
Filters identity mappings according to the given string.
user <user name>
Filters identity mappings according to a specific user.
machine <computer name>
Filters identity mappings according to a specific computer.
all
No filtering, shows the entire identity database.
Example
adlog a query user jo
Shows the entry that contains the string "jo" in the user name.

adlog dc

Description Shows status of connection to the AD domain controller.
Usage adlog [a|l] dc
Syntax None

adlog statistics

Description Displays statistics regarding NT Event Logs received by adlog, per IP and by total. It also shows the number of identified IPs.
Usage adlog [a|l] statistics
Syntax None

adlog debug

Description Turns on/off debug flags for controlling the debug file. The debug file is located at $FWDIR/log/pdpd.elg (for Identity Awareness on a Security Gateway) or $FWDIR/log/fwd.elg (for identity logging on a log server).
Usage adlog [a|l] debug <parameter>
Syntax
Parameter
Description
on
Turn on debug.
off
Turn off debug.
mode
Show debug status (on/off).
extended
Turn on debug and add extended debug topics.

adlog control

Description Sends control commands to AD Query.
Usage adlog [a|l] control <parameter>
Syntax
Parameter
Description
stop
Stop AD Query. New identities are not acquired via AD Query.
reconf
Send a reconfiguration command to AD Query, which means it resets to policy configuration as was set in SmartDashboard.

adlog service_accounts

Description Shows accounts that are suspected to be "service accounts". Service accounts are accounts that don’t belong to actual users, rather they belong to services running on a computer. They are suspected as such if they are logged in more than a certain number of times.
Usage adlog [a|l] service_accounts
Syntax None

test_ad_connectivity

Description Runs connectivity tests from the Security Gateway to an AD domain controller.
Syntax $FWDIR/bin/test_ad_connectivity <parameter_1 value_1> <parameter value_2> … <parameter_n value_n>
Parameters can be set in the command line as specified below, or set in a text file located at $FWDIR/conf/test_ad_connectivity.conf . Parameters set in the test_ad_connectivity.conf file are overridden by ones provided in the command line.
Important - Parameters set in $FWDIR/conf/test_ad_connectivity cannot contain whitespaces and cannot be within quotation marks.
Output of the utility is provided in a file (not to STDOUT). The path of the file is specified by the –oparameter (see below).
Syntax
Parameter
Mandatory?
Description
-d <domain name>
Mandatory
Domain name of the AD, for example ad.checkpoint.com
-i <DC IP>
Mandatory
IP of the domain controller that is being tested.
-u <user name>
Mandatory
Administrator user name on the AD.
-o <filename>
Mandatory
Output filename relative to $FWDIR/tmp. For example, if you specify -o myfile, the output will be in $FWDIR/tmp/myfile
-c <password clear>
Either this or -a should be specified
User’s password.
-a
Either this or -c should be specified
For entering password via stdin.
-t <timeout>
Mandatory
Total timeout in milliseconds.
-D <user DN>
Optional
Use this for LDAP user DN override (the utility won’t try to figure out the DN automatically).
-l
Optional
Run LDAP connectivity test only (no WMI test).
-w
Optional
Run WMI connectivity test only (no LDAP test).
-s
Optional
SSL Parameters file path.
-L
Optional
Timeout for the LDAP test only. If this timeout expires and the LDAP test doesn’t finish, both tests fail.
-h
Optional
Show help.

Threat Emulation

curl_cli -v -k http:/te.checkpoint.com
cpwd_admin list
ps  aux | grep ted  

tecli a e v
tecli advanced engine version 
tecli show statistics
tecli show downloads images
tecli show downloads images all
tecli show emulator emulations

cpstat threat-emulation -f update_status
cpstat threat-emulation -f default
cpstat threat-emulation -f contract
 
cd $FWDIR/log
tail -f ted.elg
tail -n 50 ted.elg
tail -n 150 ted.elg
tail -f ted.elg


This system is for authorized use only.
Last login: Thu Nov  3 19:49:43 2022 from 10.1.1.1
CLINFR0771  Config lock is owned by admin. Use the command 'lock database override' to acquire the lock.
myte01> expert
Enter expert password:

Warning! All configurations should be done through clish
You are in expert mode now.
 
Expert@myte0]# cpstat threat-emulation -f contract
TE Contract Name:                          temu_local
TE Subscription Expire Date:               1677200154
TE Cloud Hourly Quota:                     0
TE Cloud Monthly Quota:                    0
TE Cloud Remaining Quota:                  0
TE Maximal VMs Number:                     28
TE Subscription Status:                    valid
TE Cloud Quota Status:                     ok
TE Subscription Description:               Subscription is up to date
TE Cloud Quota Description:                Cloud emulation is not used
TE Cloud Quota Identifier:                 N/A
TE Cloud Monthly Quota Period Start:       0
TE Cloud Monthly Quota Period End:         0
TE Cloud Monthly Quota Usage for This GW:  0
TE Cloud Hourly Quota Usage for this GW:   0
TE Cloud Monthly Quota Usage for Quota ID: 0
TE Cloud Hourly Quota Usage for Quota ID:  0
TE Cloud Monthly Quota Exceeded:           0
TE Cloud Hourly Quota Exceeded:            0
TE Cloud Last Quota Update GMT Time:       0

[Expert@myte01:0]# cpstat threat-emulation -f default 
Status:                   0
Status short description: ok
Status long description:  Gateway is up to date.
Engine Major Version:     59
Engine Minor Version:     990001351

[Expert@myte01:0]# 
[Expert@myte01:0]# tecli show statistics
                                          Last day           Last week        Last 30 days
General Information:
--------------------
Scanned files:                                   1                1980               18965
Malicious files:                                 0                   0                   0
Files filtered by static analysis:               0                  16(0%)              60(0%)
Files error count:                               2                  26                 128
Files filtered by local cache:                   0                   0                   0
Files no resource count:                         0                   0                   0
Malicious files detected by HPS:                 0                   0                   0
Files error count in HPS:                        0                   0                   0
Average sample process time:                    85 sec.             88 sec.            133 sec.
Average sample size:                          9493 bytes       1211408 bytes        865609 bytes
Files destined for Local Emulation:
-----------------------------------
Scanned files locally:                           1                1980               18965
Malicious files locally:                         0                   0                   0
Average process time for emulated files:        85 sec.             90 sec.            134 sec.
Average virtual machine usage:                   0                   0                   1
Average queue size:                              0                   0                  13
Peak queue size:                                 0                  30                 123
Files destined for Cloud Emulation:
-----------------------------------
Scanned files using cloud emulation policy:      0                   0                   0
Resend files on cloud:                           0                   0                   0
Malicious files on Cloud:                        0                   0                   0
Files filtered by cloud cache:                   0                   0                   0
Emulated files on cloud:                         0                   0                   0
Average cloud emulation time:                    0 sec.              0 sec.              0 sec.
Average process time for uploaded files:         0 sec.              0 sec.              0 sec.
Average cloud process time:                      0 sec.              0 sec.              0 sec.
Files destined for Remote Emulation:
------------------------------------
Scanned files using remote emulation policy:     0                   0                   0
Resend files remotely:                           0                   0                   0
Malicious files remotely:                        0                   0                   0
Files filtered by remote cache:                  0                   0                   0
Emulated files remotely:                         0                   0                   0
Average remote process time:                     0 sec.              0 sec.              0 sec.
Communication with Threat Cloud:
--------------------------------
Last Sharing succeeded:Thu Nov  3 19:02:17 2022
Last Sharing failed:Sat Jul 31 00:25:58 2021
Sharing Identifier:HASHED_08fe0a70d8bedc2206aaeade31c62e87-9f163947dd3664257284be2cf9f5c62e
Threat emulation engine version is: 59.990001351
[Expert@te01:0]# 



Tuesday, September 20, 2022

Cisco ASA Firewalls

 

Cisco ASA: Activating The AnyConnect License

How to activate an anyconnect mobile license key on the Cisco ASA.

ASA(config)# activation-key 9f9k7747 38hghfd5 kf74jhtr 9ceffc1c 7764e4a6
Validating activation key. This may take a few minutes...

Licensed features for this platform:
Maximum Physical Interfaces    : Unlimited
Maximum VLANs                  : 150
Inside Hosts                   : Unlimited
Failover                       : Active/Active
VPN-DES                        : Enabled
VPN-3DES-AES                   : Enabled
Security Contexts              : 2
GTP/GPRS                       : Disabled
SSL VPN Peers                  : 2
Total VPN Peers                : 750
Shared License                 : Disabled
AnyConnect for Mobile          : Enabled
AnyConnect for Cisco VPN Phone : Disabled
AnyConnect Essentials          : Disabled
Advanced Endpoint Assessment   : Disabled
UC Phone Proxy Sessions        : 2
Total UC Proxy Sessions        : 2
Botnet Traffic Filter          : Disabled

This platform has an ASA 5520 VPN Plus license.

Both running and flash activation keys were updated with the requested key.
ASA(config)#

Cisco ASA: 5505 ASA Config Template


Below is a template I created while doing an ASA 5505 (directly out of box) for a remote site.  It had one VPN and the rest was a just plane Jane config.  Below is my template for such a config.  Its a pre8.3 config.  Make sure you upgrade something like this before you send it onsite:

ASA(config)# username shane pass password
ASA(config)# enable pass apasswordthatissecret
ASA(config)# hostname ASA
ASA(config)# aaa authentication ssh con LOCAL
ASA(config)# crypto key generate rsa mod 1024
INFO: The name for the keys will be: <Default-RSA-Key>
Keypair generation process begin. Please wait...
ASA(config)# ssh 0.0.0.0 0.0.0.0 outside
WARNING: This command will not take effect until interface 'outside' has been assigned an IPv4 address
ASA(config)# route outside 0.0.0.0 0.0.0.0 7.8.9.106
ASA(config)#  int vlan 2
ASA(config-if)# ip add 7.8.9.105 255.255.255.252
ASA(config-if)# no shut
ASA(config)# no dhcpd enable inside
ASA(config)# no dhcpd address 10.10.1.5-10.10.1.254 inside
ASA(config)#
ASA(config)# no dhcpd enable inside
ASA(config)# no dhcpd address 10.10.1.5-10.10.1.254 inside
ASA(config)# interface Vlan1
ASA(config-if)# no ip add
ASA(config-if)# ip add 10.10.199.1 255.255.255.0
ASA(config-if)# no shut
ASA(config-if)# route inside 10.10.4.0 255.255.255.0 10.10.199.2
ASA(config)# route inside 10.10.14.0 255.255.255.0 10.10.199.2
ASA(config)#
ASA(config)# aaa authentication serial console LOCAL
ASA(config)# crypto isakmp policy 10
ASA(config-isakmp-policy)#  authentication pre-share
ASA(config-isakmp-policy)#  encryption aes-256
ASA(config-isakmp-policy)#  hash sha
ASA(config-isakmp-policy)#  group 2
ASA(config-isakmp-policy)#  lifetime 86400
ASA(config-isakmp-policy)# crypto ipsec transform-set ESP-3DES-SHA esp-3des esp-sha-hmac
ASA(config)# access-list 2HQ permit ip 10.10.4.0 255.255.255.0 10.10.2.0 255.255.255.0
ASA(config)# access-list 2HQ permit ip 10.10.14.0 255.255.255.0 10.10.12.0 255.255.255.0
ASA(config)# access-list 2HQ permit ip 10.10.14.0 255.255.255.0 10.10.13.0 255.255.255.0
ASA(config)# access-list 2HQ permit ip 10.10.14.0 255.255.255.0 10.10.11.0 255.255.255.0
ASA(config)# access-list nonat permit ip 10.10.4.0 255.255.255.0 10.10.2.0 255.255.255.0
ASA(config)# access-list nonat permit ip 10.10.14.0 255.255.255.0 10.10.12.0 255.255.255.0
ASA(config)# access-list nonat permit ip 10.10.14.0 255.255.255.0 10.10.13.0 255.255.255.0
ASA(config)# access-list nonat permit ip 10.10.14.0 255.255.255.0 10.10.11.0 255.255.255.0
ASA(config)# nat (inside) 0 access-list nonat
ASA(config)# tunnel-group 20.30.40.55 type ipsec-l2l
ASA(config)# tunnel-group 20.30.40.55 ipsec-attributes
ASA(config-tunnel-ipsec)#  pre-shared-key veryprivatevpnkeynothisisnotwhatiuse
ASA(config-tunnel-ipsec)# exit
ASA(config)# crypto map outside_map 10 match address 2HQ
ASA(config)# crypto map outside_map 10 set peer 20.30.40.55
ASA(config)# crypto map outside_map 10 set transform-set ESP-3DES-SHA
ASA(config)# crypto map outside_map interface outside
ASA(config)# crypto isakmp enable outside


Cisco ASA: Configuring Redundant VPN Configuration On The Remote End

I have a customer where voice services is a high priority.  They are a hosted customer of ours, and the customer asked me about VPN failover.  They have two ISPs at their site.  I have two locations for my hosted voice.  But for this scenario, we want them to reach one site in particular.  So on my Cisco ASA that Im using at this point for VPN connections, I'm going to configure two tunnel groups.  One for ISP 1 IP address and one for ISP 2 IP address.  Its the normal VPN config on the ASA with one exception.  The exception is below.  See line two.  It has two IP addresses in that command instead of only one.  The first is the primary.  The second is the secondary.  Its a pretty easy setup.  In fact, most of the work is done on the remote end of the VPN.

crypto map outside_map 110 match address 190
crypto map outside_map 110 set peer 12.16.6.154 12.15.22.29 
crypto map outside_map 110 set ikev1 transform-set ESP-3DES-MD5


Cisco Pix 501: Password Recovery Procedure

Can you believe that I had to do this???  I was asked to put in a Cisco Pix 501 for an internet connection.  Yes, a Pix.  Oh well.  I didnt know the password, so I had to do a recovery.  I downloaded a file from Cisco (or somewhere) and went through the process below.  Have a TFTP server ready.

CISCO SYSTEMS PIX-501
Embedded BIOS Version 4.3.200 07/31/01 15:58:22.08
Compiled by morlee
16 MB RAM

PCI Device Table.
Bus Dev Func VendID DevID Class              Irq
 00  00  00   1022   3000  Host Bridge
 00  11  00   8086   1209  Ethernet           9
 00  12  00   8086   1209  Ethernet           10

Cisco Secure PIX Firewall BIOS (4.2) #6: Mon Aug 27 15:09:54 PDT 2001
Platform PIX-501
Flash=E28F640J3 @ 0x3000000

Use BREAK or ESC to interrupt flash boot.
Use SPACE to begin flash boot immediately.
Flash boot interrupted.
0: i8255X @ PCI(bus:0 dev:17 irq:9 )
1: i8255X @ PCI(bus:0 dev:18 irq:10)

Using 1: i82557 @ PCI(bus:0 dev:18 irq:10), MAC: 0013.c340.f24f
Use ? for help.
monitor> address 10.10.10.2
address 10.10.10.2
monitor> server 10.10.10.1
server 10.10.10.1
monitor> file np63.bin
file np63.bin
monitor> tftp
tftp np63.bin@10.10.10.1.....................................................................................................................................................................................
Received 92160 bytes

Cisco Secure PIX Firewall password tool (3.0) #0: Thu Jul 17 08:01:09 PDT 2003
Flash=E28F640J3 @ 0x3000000
BIOS Flash=E28F640J3 @ 0xD8000

Do you wish to erase the passwords? [yn] y
The following lines will be removed from the configuration:
        enable password Zo5xMCqMemyT4GaK encrypted
        passwd Zo5xMCqMemyT4GaK encrypted

Do you want to remove the commands listed above from the configuration? [yn] y
Passwords and aaa commands have been erased.



Rebooting...

Cisco ASA: Troubleshooting With Logs

I was having to troubleshoot a VPN between a Check Point and an ASA the other day.  I came up with this message in the ASA logs:

%ASA-7-713222: Group = 5.8.15.51, IP = 5.8.15.51, Static Crypto Map check, map = BHM, seq = 30, ACL does not match proxy IDs src:5.8.15.51 dst:192.168.2.10
%ASA-7-713221: Group = 5.8.15.51, IP = 5.8.15.51, Static Crypto Map check, checking map = BHM, seq = 40...

It appears that the Check Point is trying to use the public address instead of the non-NAT'ed address.  My point here is that the ASA logs are very important for troubleshooting issues.  Maybe you can look at the config and just find the solution.  Maybe you need the logs.  Either way, setting the appropriate log levels in troubleshooting is important.  It helped me determine that the ASA was fine and that the Check Point needed some work.


Packet Capture: More Proving What is There

More packet captures on the ASA.  Sometimes you just have to know how far the packet is getting.  This time its across a VPN.  I need to see what the packets actually are getting across, and not just look at the counters.  Im trying to see if one DNS server is sending traffic back.  Yep, the 192.168.1.100 DNS server is sending traffic back.  I see this on the inside interface of the ASA.  Looks good.

ASA# sh capture
capture capin type raw-data access-list 191 interface inside [Capturing - 28987 bytes]
ASA# sh capture capin

143 packets captured

   1: 14:03:29.546663       192.168.1.100.53 > 192.168.5.64.54137:  udp 373
   2: 14:24:47.714761       192.168.5.64.61552 > 192.168.1.100.53:  udp 55
   3: 14:24:47.717064       192.168.1.100.53 > 192.168.5.64.61552:  udp 55
   4: 14:24:47.931943       192.168.5.64.53348 > 192.168.1.100.53:  udp 35
   5: 14:24:47.932340       192.168.1.100.53 > 192.168.5.64.53348:  udp 90
   6: 14:24:47.970271       192.168.5.64.50397 > 192.168.1.100.53:  udp 32
   7: 14:24:47.970683       192.168.1.100.53 > 192.168.5.64.50397:  udp 79
   8: 14:24:48.015196       192.168.5.64.63238 > 192.168.1.100.53:  udp 45
   9: 14:24:48.015853       192.168.1.100.53 > 192.168.5.64.63238:  udp 98
  10: 14:24:48.059841       192.168.5.64.64395 > 192.168.1.100.53:  udp 39
  11: 14:24:48.090159       192.168.1.100.53 > 192.168.5.64.64395:  udp 39
  12: 14:24:48.135307       192.168.5.64.62142 > 192.168.1.100.53:  udp 42
  13: 14:24:48.136025       192.168.1.100.53 > 192.168.5.64.62142:  udp 111
  14: 14:24:48.172140       192.168.5.64.52743 > 192.168.1.100.53:  udp 35
  15: 14:24:48.174566       192.168.1.100.53 > 192.168.5.64.52743:  udp 110
...
143 packets shown
ASA#

Cisco ASA: VPN Lifetime Count

Did you know that VPNs resend their information after a certain amount of time?  Yep, its true.  After the lifetime expires, they resend their SA info.  You can see the remaining times when you do a show crypto isakmp sa detail on the Cisco ASA.

asa# sh cryp isa sa det
   Active SA: 2
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
Total IKE SA: 2

1   IKE Peer: 4.4.4.164
    Type    : L2L             Role    : initiator
    Rekey   : no              State   : MM_ACTIVE
    Encrypt : 3des            Hash    : SHA
    Auth    : preshared       Lifetime: 86400
    Lifetime Remaining: 42302
2   IKE Peer: 5.5.5.104
    Type    : user            Role    : responder
    Rekey   : no              State   : AM_ACTIVE
    Encrypt : aes             Hash    : SHA
    Auth    : preshared       Lifetime: 86400
    Lifetime Remaining: 28616

Cisco ASA: Capture ASP-DROP Command

There are times when you just have to take advantage of some cool troubleshooting tools that these companies put out.  Cisco has a pretty cool CLI command that I like when I just cant seem to see the config problem with my eyes.  Its the below capture command.  I used this when trying to troubleshoot why I couldnt get packets across the VPN.  I could see it on the interface in a packet capture, but going back, it was getting dropped.  How do I know that?  First, my packet capture told me when I looked on the inside interface of the ASA.  I saw it.  I also saw the packet coming back on the inside interface as well.  But, it turns out that there was an ACL dropping it, as shown below.  Once I saw this, I immediately took  off the ACL (to test) and the packets went through the VPN just fine after that.  Then, I modified the ACL to resolve the issue.

ASA# capture asp-drop type asp-drop acl-drop
ASA# show capture asp-drop

32 packets captured
...
  27: 14:05:42.770162 802.1Q vlan#15 P0 10.10.15.25 > 10.10.50.127: icmp: echo reply Drop-reason: (acl-drop) Flow is denied by configured rule
  ...
32 packets shown
ASA#


Cisco ASA: "Removing peer from peer table failed, no match!" For VPN

My customer says that the VPN to a certain customer of theirs is down on the ASA.  Nothing change on our side.  So the obvious answer is that something changed on their side.  So I get him to run a constant ping to the remote side network where he is trying to get to.  But, I see the below message when doing a "show cryp isa"

6   IKE Peer: 4.2.26.166
    Type    : user            Role    : initiator
    Rekey   : no              State   : MM_WAIT_MSG2

I also see this in the logs:

Nov 09 11:02:44 [IKEv1]: IP = 4.2.26.166, Removing peer from peer table failed, no match!
Nov 09 11:02:44 [IKEv1]: IP = 4.2.26.166, Error: Unable to remove PeerTblEntry

As it turns out, their Internet connection is down.  When it came back up, so did the VPN.


Cisco ASA: Allowing ICMP Through The Firewall

I cant believe I have not done this post yet.  I had a customer call me up on an ASA I configured remotely.  He went up to put it in place and told me that although he could get on the Internet, he could not ping anything beyond the firewall.  No worries.  We can setup a policy for that.  This should do it:

ASA(config)#
ASA(config)# class-map icmp-class
ASA(config-cmap)# match default-inspection-traffic
ASA(config-cmap)# exit
ASA(config)# policy-map icmp_policy
ASA(config-pmap)# class icmp-class
ASA(config-pmap-c)# inspect icmp
ASA(config-pmap-c)# exit
ASA(

Cisco Firewall: How To Copy The Config To A TFTP Location Directly

Here is a quick post on how to send the config to a TFTP in CLI on the ASA.  I typically just log it in my Tera Term session.  But this works too.

ASA# copy running-config tftp

Source filename [running-config]?

Address or name of remote host []? 10.1.1.30

Destination filename [running-config]?
Cryptochecksum: 0d26cd13 fe9f6f96 d8c80803 2ff55825
!!!!!!!!!!!!
46613 bytes copied in 3.330 secs (15537 bytes/sec)
ASA#config-pmap)# service-p icmp_policy interface outside


Firewalls And NAT'ing And The Traveling Packet

Its an interesting thing to me, that NAT'ing takes place before routing does on most firewalls.  So, if your public IP address space was 10.10.10.X/24, and you decided that you wanted to NAT your internal 192.168.1.10 server to the public IP address of 10.4.4.4, you could.  Now, you might start to think that "you cant do that" because your 10.4.4.4 is not on your 10.10.10.X/24 address space, right?  Well, actually, that is wrong.  You actually CAN  have a public IP address that is not on your public IP range and have it NAT through to your internal server.  Routing at the upstream router certainly poses a problem, but if a packet can make it to your firewall, then you can NAT your traffic to any public IP address you want to, even if its not part of your IP range on  your firewall interface.
I actually went through this recently on a certain problem I was having on a Check Point firewall.  You see, it was the same thing really.  I had a public range of, lets say, 40.40.40.0/25.  This gives us 126 usable IP addresses (1-126).  However, in the config, they had some NATs that were outside of that range.  Now, just so you know, they actually owned the whole /24 of 40.40.40.0.  But, on the firewall interface, they had split up this subnet and were not using anything above this range (40.40.40.0/25).
In our example, they had a static NAT translation of 40.40.40.200 pointing to a webserver inside the network at 192.168.1.200.  I thought that since it was not on the subnet of the public facing NIC on the firewall, the firewall would try to route it out its default gateway (the upstream router), which would try to send it back and ultimately the TTL would hit 0 and the packet would drop.  But, this is NOT what happens.  What actually happens is that NAT is checked FIRST.
Below, I have the best explanation (from Cisco) of the process the packet actually takes going through the firewall from the outside to the inside.  This process also applies to Check Point as well.  Notice that first, the ACL is checked to see if the packet is allowed, then NAT.   Notice its not until step 7 and 8 where routing comes into place.  Its a very interesting process for sure.  Take a walk through the steps below.  Its a really good read through.
Steps

1. The packet is reached at the ingress interface. Once the packet reaches the internal buffer of the interface, the input counter of the interface is incremented by one. 

2. Cisco ASA first looks at its internal connection table details in order to verify if this is a current connection. If the packet flow matches a current connection, then the Access Control List (ACL) check is bypassed and the packet is moved forward.If packet flow does not match a current connection, then the TCP state is verified. If it is a SYN packet or UDP (User Datagram Protocol) packet, then the connection counter is incremented by one and the packet is sent for an ACL check. If it is not a SYN packet, the packet is dropped and the event is logged. 

3. The packet is processed as per the interface ACLs. It is verified in sequential order of the ACL entries and if it matches any of the ACL entries, it moves forward. Otherwise, the packet is dropped and the information is logged. The ACL hit count is incremented by one when the packet matches the ACL entry. 

4. The packet is verified for the translation rules. If a packet passes through this check, then a connection entry is created for this flow and the packet moves forward. Otherwise, the packet is dropped and the information is logged. 

5. The packet is subjected to an Inspection Check. This inspection verifies whether or not this specific packet flow is in compliance with the protocol. Cisco ASA has a built-in inspection engine that inspects each connection as per its pre-defined set of application-level functionality. If it passed the inspection, it is moved forward. Otherwise, the packet is dropped and the information is logged.Additional security checks will be implemented if a Content Security (CSC) module is involved. 

6. The IP header information is translated as per the Network Address Translation/ Port Address Translation (NAT/PAT) rule and checksums are updated accordingly. The packet is forwarded to Advanced Inspection and Prevention Security Services Module (AIP-SSM) for IPS related security checks when the AIP module is involved. 

7. The packet is forwarded to the egress interface based on the translation rules. If no egress interface is specified in the translation rule, then the destination interface is decided based on the global route lookup. 

8. On the egress interface, the interface route lookup is performed. Remember, the egress interface is determined by the translation rule that takes the priority. 

9. Once a Layer 3 route has been found and the next hop identified, Layer 2 resolution is performed. The Layer 2 rewrite of the MAC header happens at this stage. 

10. The packet is transmitted on the wire, and interface counters increment on the egress interface. 

11. The packet is transmitted on the wire, and interface counters increment on the egress interface.


Below is Check Points explanation in the CP documentation.  Very similar.


Cisco Firewall: What Is That "passwd" In CLI?

I was tasked to clear up an issue on an ASA running 9.4 code.  The issue?  There was a default password left on the ASA, that should be deleted out.  In CLI, you will see a command "passwd ...". That is the default password for telnet and ssh.  See from Cisco's documentation below:

The login password is used for Telnet and SSH connections. By default, the login password is "cisco." To change the password, enter the following command:
hostname(config)# {passwd | password} password
You can enter passwd or password. The password is a case-sensitive password of up to 16 alphanumeric and special characters. You can use any character in the password except a question mark or a space.
The password is saved in the configuration in encrypted form, so you cannot view the original password after you enter it. Use the no password command to restore the password to the default setting.

Cisco ASA: How To Immediately Block An External IP From Coming Through Your Firewall

Have you ever had an intruder coming through your firewall, and you needed to block that IP address immediately?  I recently saw this very thing coming through a Cisco ASA.  Even though we didn't see this in our logs (still working on why this didn't happen), it was reported to us from our server team.  And because we didn't see it coming through our log, we decided to do a packet capture on the ASA to verify that it was actually coming through.  Well, the capture proved that it was.  So, our immediate solution was to add this public IP address to our block list.  However, because he was already coming through to a particular NAT translation (an internal server accessed from the outside), adding this in to the ACL did not work.  Now this, to me, is unacceptable in a firewall!  So as I'm writing this post, I think Ill do a post coming up on how the ASA works regarding this concept.  I'm not sure its widely published.
Back to this post though.  So I put the public IP address to be blocked and that did not stop them.  So, what to do?
There is a command called "shun" on the ASA.  Its intended to block the IP from coming through.  So, after the packet capture, I verified with another command:
ASA# sho conn add 159.203.83.32
TCP outside  159.203.83.32:37044 inside  10.10.10.10:443, idle 0:00:00, bytes 903237461, flags UIOXB

You can see above, the connection is active.  So lets shun it:
ASA# shun 159.203.83.32
Shun 159.203.83.32 added in context: single_vf
Shun 159.203.83.32 successful

Now to verify that its actually stopped.  We did a show capture, to verify that the packet count was not increasing, as it was before:
ASA# sh capture
capture capin type raw-data access-list 189 interface outside [Buffer Full - 524058 bytes]
ASA# sh capture
capture capin type raw-data access-list 189 interface outside [Buffer Full - 524058 bytes]
ASA# sh capture
capture capin type raw-data access-list 189 interface outside [Buffer Full - 524058 bytes]


Done, shunned for now.

Cisco ASA: Why Adding To Your ACL Does Not Block The Connection You Want To Block

In yesterday's post about shunning in the ASA, I said something about how I added an IP address to the ACL to block an IP address from getting through to a server.  I also mentioned that because the connection was already active, that adding his IP into the ACL did not stop him from coming through at that point.  So, why?
There is this concept in the ASA called "slow path" and "fast path".  When a connection is initiated, the ASA will use the "slow path", which means it checks the packet against the incoming ACL that is in place, to verify if its allowed or not.  If allowed through, then the packets from then on take the "fast path" for that particular connection.  Taking the "fast path" means that the packets are no longer checked against the ACL to verify if its allowed or not, allowing for better performance.  However, I personally am not a fan of this method.  My stance would be to add performance to the gear, instead of skimping on security for the sake of performance.


Cisco ASA: Dropping Remote Access After A Certain Timeframe

Quick post here, but you really should drop remote-access connections after a certain time. Or they will stay connected forever.  Here is how to set it to 12 hours.
ASA/act/pri# config t
ASA/act/pri(config)# group-policy DfltGrpPolicy attributes
ASA/act/pri(config-group-policy)# vpn-session-timeout 720
ASA/act/pri(config-group-policy)# exit
ASA/act/pri(config)# exit
ASA/act/pri# wr men


VPN: IKEv1 And IKEv2

While configuring some VPNs today, the question came up about using IKEv1 vs IKEv2. I don't want to get into the technical details about the differences in the two (I'll do that in the next post), but I do want you to know that the two are not compatible with each other. So if you use IKEv2 on one side, you have to use it in the other side.


Cisco Firewall: How A Cisco ASA L2 Firewall Works (Transparent Mode)

I'd like to explain how the Cisco ASA L2 firewall works.  I find that most people really don't understand how this works, so I'm going to attempt to explain as best I can.

How A L2 Firewall Works (Transparent Mode)
As a packet comes into the Aggregation switch, destined for Server IP address of 10.10.1.30, that packet is destined for Vlan1273 on the Agg switch. As the Agg switch sends out an ARP request to get the MAC address of the Server 10.10.1.30, the ARP is sent out all ports with Vlan 1273 configured.  As the ARP comes into the ASA, it then broadcasts over across its bridge-group 30, and the destination is then within the Layer2 Vlan of 273.  It traverses back to the Agg switch, in Vlan 273, and all ports with Vlan 273.  The Leaf switch sees the ARP request, and forwards it out all ports with Vlan 273 (L2) on the Leaf switch.  The server gets the ARP request, and responds with its MAC address, traversing back across the Leaf switch, through the Agg switch on Vlan 273, and to the ASA on Vlan 273.  When the ASA receives the ARP reply, it forwards it back across the bridge-group 30 to Vlan 1273, and on to the Agg switch in Vlan 1273.  There is now two way communication, from Vlan 1273 across to Vlan 273, and vice versa. 

Notice that in the ASA configuration, the ACL allows all traffic GLOBALLY, for simplicity for our example.



















Meraki Install

I don't know that I've ever really commented on the Meraki installs that I've done. I did an install for a company out of Nashville recently. Meraki does make some things easy to configure. But it also leaves out some really important threat prevention features. I should probably do a comparison list between firewall vendors.




Referenence: https://www.shanekillen.com/search/label/Cisco%20Firewall























Monday, September 19, 2022

Check Point: R80.10 Install

Check Point: R80.10 Install

I did another install of a Check Point firewall on a 4600 today.  Check Point is a good product, right up there with Palo Alto.  When considering your firewall replacement, these two are the front runners.

Inside the 4600:


Check Point Firewall: Adding A User In CLI

Here is a quick "how to" on adding a user in Check Point via command line (CLI).  It just as easy to go into the GUI and do this, but I have found that when I'm in CLI anyway and need to do this, this is a quick template for me. 

add user NewUserName uid 0 homedir /home/NewUserName
set user NewUserName gid 100 shell /etc/cli.sh
set user NewUserName password
(then you will verify the password you just typed in)
add rba user NewUserName roles adminRole (for adding an administrator)
save config


Firewall: Difference Between "fw mon", "zdebug" And "TCPDump"

I've decided that there is just some documentation that is missing on a few topics. The difference between these Check Point commands (fw monitor, zdebug, and tcpdump) is something that needs some explaining. I'm putting this together and will have this one up in a few days.  Stay tuned...


Check Point Firewall: Modifying The FWKERN.CONF File To Overcome Dropped Packets From The Queue Buffer

Here recently, I had a server guy come to me and tell me that he needed some network help to get an issue of his resolved.  Long story short, his NetApp replication from one site to another was failing, and he couldn't find anything wrong in his configuration to solve the issue.  After troubleshooting the firewall and network from my perspective, I didn't see anything wrong either.  This, needless to say, did not help him out any.

However, after further review, I found that the reason I didn't see anything in my firewall logs was because it wasn't making it to the Check Point application itself.  There actually were dropped packets, just at the OS level.  This took some time to troubleshoot, but what we found was that the queue limit buffer was getting too much traffic and was dropping packets.

So, what did we do?  Well, the default queue limit is set to 2048 by default (in Gaia on the Check Point appliances).  We wanted to up that limit to 8196, since we had plenty of memory to do so (don't do this unless you know for sure you have plenty of resources, as this may not resolve your issue).  In this case, my CPU (CPU #1) was consistently hitting 100% utilization.  So, time to edit the fwkern.conf file.

After logging into Check Point in CLI, and going into expert mode, I then went to /var/opt/fw.boot/modules directory.  There, the fwkern.conf file resides.  I went into VI editor and put in the following:

fwmultik_input_queue_len = 8196


After coming out of VI editor and rebooting the HA cluster, everything worked well and his NetApp issue was resolved.  No more dropped packets from the buffer and CPU down to 10%.  To check what your setting is at, do the following:

[Expert@CheckPoint:0]# fw -i k ctl get int fwmultik_input_queue_len

fwmultik_input_queue_len = 2048