Showing posts with label vWLC. Show all posts
Showing posts with label vWLC. Show all posts

CCIE Security Lab: IPS and WLC - shun lists

I am not feeling great today, the British public has just shown what a bunch of idiots they are and have voted to leave the EU. Absolutely crazy. But, despite feeling despondent, I need to finish off the IPS.

Today will be pretty quick. The goal is to get the WLC talking to the IPS. Why are we doing this, apart from "just because we can"?

The idea is that we will have traffic that may not be going through the IPS, predominantly Wifi traffic. The IPS is a clever thing and can use the signature-definition rules to create lists of IP addresses we "shun". So we get the benefits of the IPS, even when on the Wifi network.

Creating a shun list looks a bit like this:
IPS(config)# service signature-definition sig1

Editing new instance sig1.
IPS(config-sig)#   
IPS(config-sig)# signatures 64999 0
IPS(config-sig-sig)# alert-severity high 
IPS(config-sig-sig)# engine atomic-ip
IPS(config-sig-sig-ato)# event-action ?
produce-alert                         
produce-verbose-alert                 
deny-attacker-inline                  
deny-connection-inline                
deny-packet-inline                    
log-attacker-packets                  
log-pair-packets                      
log-victim-packets                    
request-block-connection              request NAC to shun this connection
request-block-host                    request NAC to shun this attacker host
request-snmp-trap                     
reset-tcp-connection                  
deny-attacker-victim-pair-inline      
deny-attacker-service-pair-inline     
IPS(config-sig-sig-ato)# event-action request-block-host
IPS(config-sig-sig-ato)# 
I won't be using this one, though, I will be editing the existing signature we set up in the previous post.
IPS(config)# service signature-definition sig0

IPS(config-sig)# signatures 60101 0
IPS(config-sig-sig)# engine atomic-ip
IPS(config-sig-sig-ato)# event-action produce-verbose-alert
IPS(config-sig-sig-ato)# event-action request-block-host
IPS(config-sig-sig-ato)# exit
IPS(config-sig-sig)# show settings 
   sig-id: 60101
   subsig-id: 0
   -----------------------------------------------
      alert-severity: high default: medium
      sig-fidelity-rating: 75 
      promisc-delta: 0 
      sig-description
      -----------------------------------------------
         sig-name: My Sig 
         sig-string-info: My Sig Info 
         sig-comment: Sig Comment 
         alert-traits: 0 
         release: custom 
         sig-creation-date: 20000101 
         sig-type: Other 
      -----------------------------------------------
      engine
      -----------------------------------------------
         atomic-ip
         -----------------------------------------------
            event-action: request-block-host default: produce-alert
            fragment-status: any 
            specify-l4-protocol
            -----------------------------------------------
               yes

IPS(config-sig-sig)# exit
IPS(config-sig)# exit
Apply Changes?[yes]: yes 
IPS(config)#
The rest of the settings are the same as the previous post, so I have truncated the output.

The next step is to set up a user for the WLC on the IPS. I am cribbing from this Cisco doc by the way!
IPS(config)# service network-access 
IPS(config-net)# user-profile vWLC
IPS(config-net-use)# username vWLC
IPS(config-net-use)# password
Enter password[]: *****
Re-enter password: *****
IPS(config-net-use)# enable-password
Enter enable-password[]: *****
Re-enter enable-password: *****
IPS(config-net-use)# show settings
   profile-name: vWLC
   -----------------------------------------------
      enable-password: 
      password: 
      username: vWLC default: 
   -----------------------------------------------
IPS(config-net-use)# exit
IPS(config-net)# exit
Apply Changes?[yes]: yes 
IPS(config)# 
Moving on to the WLC, we head to Security > Advanced > CIDS.

WLC - CIDS

Click on "New" in the top right-hand corner and enter the details:

integrate IPS with WLC

If you are wondering how to get the SHA fingerprint, that comes from the IPS:
IPS# sh tls fingerprint

MD5: 34:F0:0A:8B:F5:4F:E0:89:2A:99:0C:8F:A1:22:64:CF
SHA1: 8F:4E:BF:26:8C:62:8E:5E:C3:80:F4:FD:D4:15:FC:1C:1A:46:80:DF
IPS# 
This then goes on our list:

CIDS Sensor list

We should be able to pull data from the IPS now - if it worked:
(Cisco Controller) >debug wps cids enable 
(Cisco Controller) >*osapiBsnTimer: Jun 24 13:06:27.592: cidsSdeeCallback is called
*cids-cl Task: Jun 24 13:06:27.592: cidsProcessSdeeQuery: ip=10.1.4.155,port=443 state=1 interval=60
*cids-cl Task: Jun 24 13:06:27.592: cidsQuerySend: https://10.1.4.155:443/cgi-bin/transaction-server?command=getShunEntryList
*cids-cl Task: Jun 24 13:06:27.592: curlHandle is 0xe44db58
*cids-cl Task: Jun 24 13:06:27.592: Perform on curlHandle 0xe44db58 ... 
*cids-cl Task: Jun 24 13:06:27.624: Response code is 7: 
*cids-cl Task: Jun 24 13:06:27.624: Curl Error! Response 7:couldn't connect to host 
This is going to cause issues with IDM, but let's try anyway:
IPS# conf t
IPS(config)# service web-server 
IPS(config-web)# enable-tls true
IPS(config-web)# port 443
IPS(config-web)# exit
Apply Changes?[yes]: yes
IPS(config)# exit
IPS#


(Cisco Controller) >debug wps cids enable 
(Cisco Controller) >*osapiBsnTimer: Jun 24 13:13:32.405: cidsSdeeCallback is called
*cids-cl Task: Jun 24 13:13:32.410: cidsProcessSdeeQuery: ip=10.1.4.155,port=443 state=1 interval=60
*cids-cl Task: Jun 24 13:13:32.410: cidsQuerySend: https://10.1.4.155:443/cgi-bin/transaction-server?command=getShunEntryList
*cids-cl Task: Jun 24 13:13:32.410: curlHandle is 0xe44db58
*cids-cl Task: Jun 24 13:13:32.410: Perform on curlHandle 0xe44db58 ... 
*cids-cl Task: Jun 24 13:13:32.538: ssl_sensor_verify_callback: verifying cert from sensor
*cids-cl Task: Jun 24 13:13:32.538: Cert fingerprint verified
*cids-cl Task: Jun 24 13:13:32.831: Response code is 0: 
*cids-cl Task: Jun 24 13:13:32.831: Add 123.123.123.123 from local sensor 10.1.4.155 to shun-list
*cids-cl Task: Jun 24 13:13:32.831: xmlDoc buffer freed
*cids-cl Task: Jun 24 13:13:32.831: Parser cleaned
*cids-cl Task: Jun 24 13:13:32.831: 0 cids-update groupcast messages sent
Looks better. We can even see a manually created entry I made earlier on the IPS:

IPS host blocks


CIDS shun list

Of course, this is only as good as the stability of the IPS, so it quickly craps out:

IPS craps out

The point has been proven, though.

The IPS is kind of pissing me off. It keeps needing to be reset, which is just wasting time. But I think we can leave it there.

It's time to move on and look at VPNs.

CCIE Security lab: vWLC - Part 2 - Bust and Boom!

Well, it took some time, but *finally* its working. It's been a little stressful, but perseverance and hours of googling paid off.

So the new AP arrived today. I was a little confused as it was packaged so well I thought a shower door was being delivered.

I unwrapped it and plugged it in, being the optimistic guy I am, I was hoping that it would connect to the vWLC without issue.

Yeah, so much not the case. I did try to capture as much data as I could though, so that if/when I fixed it, I could have something useful for others. Unfortunately my Windows laptop has a tendancy to reboot spontaneously because of Windows updates, so a little was lost.

Anyway. AP gets booted up and the first thing to do is to upgrade it to a newer version. This seemed to go OK, but the AP would keep dropping off the vWLC. So I decided to try loading the recovery version instead. I had to do this via the boot console, as for some reason Flash went tits-up.

There are some Cisco docs about this, but they didn't work, and it just sat there doing nothing. Then I googled "load_helper" and found a very helpful post that said that "ether_init" is also needed. So I rebooted the AP and tried again. This is the working command sequence:
load_helper
flash_init
format flash:
set IP_ADDR 10.1.4.53
set NETMASK 255.255.255.0
set DEFAULT_ROUTER 10.1.4.254
ether_init
tftp_init
tar -xtract tftp://10.1.4.200/c1140-rcvk9w8-tar.152-4.JA1.tar flash:
boot
This is how it looks in real life, a little slimmed down, but notice that if you mess up a command (like I did with the first tar command), you need to reenter the previous command:
ap: ether_init
ap: set IP_ADDR 10.1.4.53
ap: set NETMASK 255.255.255.0
ap: set DEFAULT_ROUTER 10.1.4.254
ap: tftp_init
ap: ether_init
ap: tar -xtract tftp://10.1.4.200/c1140_rcvk9w8_tar.152_4.JA1.tar
usage: tar <-table -xtract="">  
ap: tar -xtract tftp://10.1.4.200/c1140_rcvk9w8_tar.152_4.JA1.tar flash:
Unknown cmd: tar
ap: tar ?
usage: tar <-table -xtract="">  
ap: tar -xtract tftp://10.1.4.200/c1140_rcvk9w8_tar.152_4.JA1.tar flash:
Unknown cmd: tar
ap: tftp_init
ap: tar -xtract tftp://10.1.4.200/c1140_rcvk9w8_tar.152_4.JA1.tar flash:
extracting info (273 bytes)
c1140-rcvk9w8-mx/ (directory) 0 (bytes)
extracting c1140-rcvk9w8-mx/c1140-rcvk9w8-mx (6865717 bytes)........................................................ 
a lot of minutes later
extracting c1140-rcvk9w8-mx/info (273 bytes)
extracting c1140-rcvk9w8-mx/file_hashes (280 bytes)
extracting c1140-rcvk9w8-mx/final_hash (141 bytes)
extracting c1140-rcvk9w8-mx/img_sign_rel.cert (1375 bytes)
extracting c1140-rcvk9w8-mx/img_sign_rel_sha2.cert (1371 bytes)
extracting info.ver (273 bytes)
ap: boot
Loading "flash:/c1140-rcvk9w8-mx/c1140-rcvk9w8-
Once it comes back up again, we are on the new version:
Cisco IOS Software, C1140 Software (C1140-RCVK9W8-M), Version 15.2(4)JA1, RELEASE SOFTWARE (fc2)
LWAPP image version 7.5.1.73
OK, so one update done. Can we connect to the AP yet? Not quite, but it does start to do an update FROM the vWLC, so at least we are headed in the right direction:
 examining image...!
extracting info (282 bytes)
Image info:
    Version Suffix: k9w8-.153-3.JA
    Image Name: c1140-k9w8-mx.153-3.JA
    Version Directory: c1140-k9w8-mx.153-3.JA
    Ios Image Size: 317952
    Total Image Size: 8714752
    Image Feature: WIRELESS LAN|LWAPP
    Image Family: C1140
    Wireless Switch Management Version: 8.0.100.0
Extracting files...
c1140-k9w8-mx.153-3.JA/ (directory) 0 (bytes)
extracting c1140-k9w8-mx.153-3.JA/c1140-k9w8-xx.153-3.JA (82241        )
After a while the AP comes back up again, and we are running another new version, courtesy of the vWLC:
POWER TABLE FILENAME = flash:/c1140-k9w8-mx.153-3.JA/T5.bin
cisco AIR-LAP1142N-E-K9 (PowerPC405ex) processor (revision B0) with 98294K/32768K bytes of memory.
Processor board ID FCZ1427W4UB
PowerPC405ex CPU at 586Mhz, revision number 0x147E
Last reset from reload
LWAPP image version 8.0.100.0
1 Gigabit Ethernet interface
2 802.11 Radios
Notice the LWAPP image now matches the Controllers version:
(Cisco Controller) >show sysinfo 

Manufacturer's Name.............................. Cisco Systems Inc.
Product Name..................................... Cisco Controller
Product Version.................................. 8.0.100.0
RTOS Version..................................... 8.0.100.0
Bootloader Version............................... 8.0.100.0
Emergency Image Version.......................... 8.0.100.0

Build Type....................................... DATA + WPS

System Name...................................... vWLC
System Location.................................. 
System Contact................................... 
System ObjectID.................................. 1.3.6.1.4.1.9.1.1631
IP Address....................................... 10.1.4.152
IPv6 Address..................................... ::
System Up Time................................... 0 days 3 hrs 39 mins 19 secs
System Timezone Location......................... 
System Stats Realtime Interval................... 5
System Stats Normal Interval..................... 180

Configured Country............................... GB  - United Kingdom

--More-- or (q)uit
(Cisco Controller) >
The above output is pretty long, but the important thing is that our versions match, and that the Configured Country is GB. This needs to match up with the -E- in the version details on the AP (if you are in the UK that is):
Product/Model Number                 : AIR-LAP1142N-E-K9
However, we are not out of the woods yet. The AP keeps flip-flopping about, and my frustration is growing. But we are seeing it in the vWLC, so this is still encouraging:

Cisco vWLC on UNetLab

However, it doesn't stay stable for very long. Some of the useful errors are below:
%DTLS-5-SEND_ALERT: Send FATAL : Close notify Alert to 10.1.4.152:5246
%CAPWAP-5-DTLSREQSEND: DTLS connection request sent peer_ip: 10.1.4.152 peer_port: 5246
%CDP_PD-4-POWER_OK: Full power - NEGOTIATED inline power source
%LINK-6-UPDOWN: Interface Dot11Radio0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Dot11Radio0, changed state to up
%LINK-6-UPDOWN: Interface Dot11Radio1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Dot11Radio1, changed state to up
DTLS_CLIENT_ERROR: ../capwap/base_capwap/dtls/base_capwap_dtls_connection_db.c:2214 Max retransmission count reached for Connection 0x4FEE418!  
%LWAPP-3-CLIENTERRORLOG: LWAPP LED Init: incorrect led state 255
%LINK-5-CHANGED: Interface Dot11Radio0, changed state to administratively down
%LINK-5-CHANGED: Interface Dot11Radio1, changed state to administratively down
%LWAPP-4-CLIENTEVENTLOG: Not sending change state post as the radio admin is down, lrad state = 5
The interesting lines are "%LWAPP-3-CLIENTERRORLOG: LWAPP LED Init: incorrect led state 255" and "DTLS_CLIENT_ERROR:...Max retransmission count reached for Connection". There seems to be two fixes for this. The first is to disable the Self-Signed Certificate (SSC) hash validation:
(Cisco Controller) >config certificate ssc hash validation disable 

(Cisco Controller) >show certificate ssc

SSC Hash validation.............................. Disabled.

SSC Device Certificate details:

         Subject Name :
                 C=US, ST=California, L=San Jose, O=Cisco Virtual Wireless LAN Controller, 
                 CN=DEVICE-vWLC-AIR-CTVM-K9-520000020001, MAILTO=support@vwlc.com

         Validity :
                 Start : 2015 Mar  3rd, 09:21:37 GMT
                 End   : 2025 Jan  9th, 09:21:37 GMT

         Hash key : e9c65b6b31a76266f28c1bddfa297780ac1bbf8a

(Cisco Controller) >
The second requirement is that the AP needs to be set as FlexConnect

Cisco vWLC on UNetLab

Once these were set, we can actually see the SSIDs!

Cisco vWLC on UNetLab

And here we can see them on the phone as well:

Cisco vWLC on UNetLab

So, this brings an end to trying to set up hardware. It now leaves the remaining tasks to be the setting up of the IPS, so that we can plug the vWLC into it and set up the ISE so that we can plug the vWSA's APs and the IP Phone into that.

Progress is definitely being made, albeit with a bit of added frustration, but no-one ever said a CCIE would be easy.

CCIE Security lab: vWLC - Part 1 - Check the Wireless compatibility matrix for vWLC!

My Cisco 1200 series AP arrived the other day. It's a nice looking AP, as far as they go, but trying to get it set up has reminded me how much Wireless technology annoys me. But it's been a useful learning curve nonetheless.

So, we have the following setup:

vWLC -> SW2 -> SW3 -> 3750X -> AP

It looks like this:

Cisco vWLC on UNetLab

We need a few things in place to run a lightweight AP. These are a DHCP server, with option 43 defined, maybe a DNS server with a couple of entries in it, and, of course, physical connectivity.

I added a Cisco IOSv router to take care of the DHCP and DNS, and, to cut a long story short, got much further. Here is the setup:
AP-DNS#sh run | s dhcp
ip dhcp excluded-address 10.1.4.1 10.1.4.50
ip dhcp excluded-address 10.1.4.100 10.1.4.254
ip dhcp pool APs
 network 10.1.4.0 255.255.255.0
 default-router 10.1.4.254 
 dns-server 10.1.4.101 
 option 60 ascii "Cisco AP c1200"
 option 43 ascii "10.1.4.152"
 domain-name 802101.local
AP-DNS#sh run | i host
hostname AP-DNS
ip host CISCO-LWAPP-CONTROLLER 10.1.4.152
ip host CISCO-CAPWAP-CONTROLLER 10.1.4.152
ip host CISCO-LWAPP-CONTROLLER.802101.local 10.1.4.152
ip host CISCO-CAPWAP-CONTROLLER.802101.local 10.1.4.152
ip host vWLC 10.1.4.152
ip host vWLC.802101.local 10.1.4.152
AP-DNS#
With this, the AP started to get a bit further. But still would not register. I made some changes to the switching side of things, and set the port connecting SW2 to the vWLC to be trunks:
SW2#sh run int gi 1/3
Building configuration...

Current configuration : 158 bytes
!
interface GigabitEthernet1/3
 switchport access vlan 4
 switchport trunk encapsulation dot1q
 switchport mode trunk
 media-type rj45
 negotiation auto
end

SW2#sh run int gi 2/3
Building configuration...

Current configuration : 174 bytes
!
interface GigabitEthernet2/3
 switchport access vlan 4
 switchport trunk encapsulation dot1q
 switchport mode trunk
 media-type rj45
 duplex full
 no negotiation auto
end

SW2#
The vWLC was set up to have the management interface in VLAN 4:
Interface Configuration
Interface Name................................... management
MAC Address...................................... 50:00:00:15:00:01
IP Address....................................... 10.1.4.152
IP Netmask....................................... 255.255.255.0
IP Gateway....................................... 10.1.4.254
External NAT IP State............................ Disabled
External NAT IP Address.......................... 0.0.0.0
Link Local IPv6 Address.......................... fe80::5200:ff:fe15:1/64
STATE ........................................... REACHABLE
Primary IPv6 Address............................. ::/128
STATE ........................................... NONE
Primary IPv6 Gateway............................. ::
Primary IPv6 Gateway Mac Address................. 00:00:00:00:00:00
STATE ........................................... INCOMPLETE
VLAN............................................. 4         
Quarantine-vlan.................................. 0
Physical Port.................................... 1         
DHCP Proxy Mode.................................. Global
Primary DHCP Server.............................. 10.1.4.101
Secondary DHCP Server............................ Unconfigured
DHCP Option 82................................... Disabled
Even with this setup, the AP just kept on renewing the IP address, and moaning about certificates. The vWLC itself does show that the registration requests were getting to where they should be:
(Cisco Controller) >show ap join stats detailed 00:1e:f7:47:72:4b

Sync phase statistics
- Time at sync request received............................ Not applicable
- Time at sync completed................................... Not applicable

Discovery phase statistics
- Discovery requests received.............................. 245
- Successful discovery responses sent...................... 163
- Unsuccessful discovery request processing................ 82
- Reason for last unsuccessful discovery attempt........... Layer 3 discovery request not received on management VLAN
- Time at last successful discovery attempt................ Apr 19 15:47:54.389
- Time at last unsuccessful discovery attempt.............. Apr 19 15:47:54.385
You can see a lot of requests and responses above. After much mucking about it turns out that I should have looked at the compatibility matrix before buying what I assumed would be a decent AP. The link is here in case you need it: http://www.cisco.com/c/en/us/td/docs/wireless/compatibility/matrix/compatibility-matrix.html.

So now I have ordered a new AP, this time it is an 1142, which is on the matrix. Lesson learned - do your homework! The alternative could have been to run an older version of the vWLC (7.0).

Hopefully when this arrives I can plug it in and get going!