> For the complete documentation index, see [llms.txt](https://phiph.gitbook.io/foundation-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://phiph.gitbook.io/foundation-1/network/nac.md). Agents can also search and read this documentation through its [MCP server](https://phiph.gitbook.io/foundation-1/~gitbook/mcp).

# NAC

## What is NAC?

* Crucial question: Who or what is attempting to connect, and what level of network access should they be granted?
* Old principle: trust everyone inside, and distrust everyone outside
* Modern zero trust security model: Never trust, always verify. A zero-trust approach considers all resources to be external
* NAC should ontinuously verify trust even after initial access is granted
* As the networks have become far more interconnected, with clouds and remote hybrid work, the notion of a single network perimeter or control point no longer exists

NAC controls all types of access to network: - Wired - Wireless - VPN

* Criteria set
  * Who: employee, guest, contractor - different roles and levels of access
  * What: device are they using (corporate laptop, personal smartphone, and so on)
  * Where: are they located (office, home, hotel, and so on)
  * When
  * How: Wired, Wireless, VPN

```
User or device tries to connect
NAC collects context: wo, what, where, when, how)
Policy evaluates situation
Access is granted, limited, or restricted
Context and results are shared with other tools
```

* Cisco ACS lacked awareness of device health or posture

NAC should control access from:

* Internal wired and wireless devices
* Cloud services - to them
* IoT systems
* VPNs
* Personal devices

## Certificate renewal

* Certs are used in: Radius for EAP methods where SSL is used, Radius DTLS, Admin SSL Gui
* NAC sends to client all chain of certs during EAP session
* After cert renewal we need to check Wi-Fi, VPN and Wired devices can successfully connect
* All types of devices should be checked: Mac, Windows, iOS, Android, Linux.....
* Devices should be checked on site
* Plus Radius logs on NAC itself should be checked, that there are no many Auth failed messages
* Renewal change should be coordinated with all affected departments
* Mac devices require new NAC server certificate to be installed explicitly on MAC, not only CA and Intermidiate certs + Trust should be configured explicitly for this cert locally on MAC or via MDM, if it is used
* This trust is configured explicitly for particular Wireless network: `Wi-Fi settings > Network name > 802.1x > Trusted certificate`
* If client does not trust new certificate it will send `SSL alert right after getting ServerHello with Server Certificate and close connection`
* Cert renewal may require `services restart`, consider this, `use load balancer` to disable node before renewal, test on one node first before going to others
* On Cisco ISE Admin cert renewal on main node may require restarting services on all nodes

**Capture traffic on client to troubleshoot new certificate**

```
sudo tcpdump -i en0 ether proto 0x888e -vv -w wifi_handshake.pcap
```

## 802.1X

* The 802.1X framework is built upon the EAP, which was initially designed for PPP networks but gained broad adoption on wired and wireless 802.1X implementations
* 2001 is the year the standard was formally created and released
* Cisco was the first major vendor to ship 802.1X support in switches around 2001–2002, along with early RADIUS integrations with Cisco ACS
* 802.1X is an IEEE standard for network access control
* It defines how devices authenticate before they are allowed to send normal traffic on: wired Ethernet, Wi-Fi (WPA2/WPA3-Enterprise), MACsec-enabled networks
* 802.1X is a framework that controls who can connect to the network by requiring authentication at the moment a device plugs in or associates to Wi-Fi
* Login before network access
* Supplicant - PC
* Authenticator - switch, AP - NAS
* Authentication server - ISE
* This standard defines using of Radius, EAP, EAPOL...
* 802.1X itself does not define authentication — it only transports EAP methods
* Wired: `Supplicant > EAPOL over L2 link > Authenticator(Switch) > EAP inside Radius over L3 link > Authentication Server`
* Wireless: `Supplicant > EAP over WLAN(EAP over IEEE 802.11) > Authenticator(Access point) > EAP inside Radius over L3 link > Authentication Server`

## EAP

### AP

* EAP is never used in pure form, it is always encapsulated somewhere...

```bash
+-------------------------------------------------------------+

|                  [ 1. AUTHENTICATION METHOD ]               |
|      (The actual credentials - "The Secret Message")        |
|      Examples: EAP-TLS, EAP-MSCHAPv2, EAP-PEAP, EAP-SIM     |
+------------------------------|------------------------------+
                               v
+-------------------------------------------------------------+

|                  [ 2. EAP FRAMEWORK ]                       |
|         (The common language - "The Envelope")              |
|         RFC 3748: Request, Response, Success, Failure       |
+------------------------------|------------------------------+
                               v
+-------------------------------------------------------------+

|                  [ 3. CARRIER PROTOCOL ]                    |
|             (The vehicle - "The Delivery Truck")            |
|                                                             |
|  [ LAYER 2 ]       [ LAYER 3 ]       [ LAYER 7 / UDP ]      |
|    EAPOL      |       PANA      |         RADIUS            |
|     PPP       |       IKEv2     |        DIAMETER           |
+------------------------------|------------------------------+
                               v
+-------------------------------------------------------------+

|                  [ 4. PHYSICAL MEDIA ]                      |
|             (The road - "The Infrastructure")               |
|          802.3 (Ethernet), 802.11 (Wi-Fi), 5G/LTE           |
+-------------------------------------------------------------+
```

* EAP existed before 802.1X and was originally created for PPP (Point-to-Point Protocol)
* Extensible Authentication Protocol (EAP) is not an authentication method by itself
* It is a framework that allows many authentication methods to be plugged into it
* EAP = a wrapper / container for authentication carried over something else
* EAP defines:
  * message types (Request, Response, Success, Failure)
  * how clients and servers negotiate methods
  * how outer protocols
* EAP does not define:
  * how keys are exchanged
  * how clients authenticate
  * how servers authenticate
* The auth method defines those
* EAP is used in:
  * IKEv2 – VPN authentication EAP messages are carried inside IKE\_AUTH encrypted payloads
  * 802.1X (Wired/Wireless): EAP runs between the client and authenticator, and is transported to RADIUS/ISE - EAP inside EAPOL
  * PPP (PPP-EAP)
  * Dial-in, broadband, LTE, etc.
  * RADIUS: EAP is encapsulated in EAP-Message attributes inside RADIUS packets
* The full TLS handshake is between the Supplicant (Client PC) and the Authentication Server (Cisco ISE) - switch or AP is just a forwarder
* Everything is just Request/Response pairs, repeated until the method finishes

```
  Server         Client
------         -------
EAP-Request →  
             ← EAP-Response
EAP-Request → 
             ← EAP-Response
... repeats ...
EAP-Success/Failure →
```

**EAP inside EAPOL**

* EAPOL is just the L2 transport for EAP
* The switch does NOT process EAP. It only forwards it to ISE via RADIUS
* The full TLS handshake is between the Supplicant (Client PC) and the Authentication Server (Cisco ISE)

This is the typical order:

1. EAPOL-Start (client)
2. EAP-Request/Identity (switch)
3. EAP-Response/Identity (client)
4. EAP-Request (method) (switch)
5. EAP-Response (method) (client)
6. EAP-Success or Failure

### EAP Методы

* EAP Method — это конкретный способ (механизм) проверки личности пользователя или устройства внутри протокола EAP (Extensible Authentication Protocol)
* Сам EAP не знает, как именно проверять пользователя. Он лишь предоставляет `каркас` для обмена сообщениями между клиентом и сервером аутентификации

EAP Method определяет:

* какие учетные данные будут использоваться (пароль, сертификат, SIM-карта и т.д.);
* как будет происходить обмен сообщениями;
* какие криптографические алгоритмы применяются;
* как сервер примет решение, успешно ли прошла аутентификация.

**Карта методов**

```bash
EAP методы
│
├── 🔓 Нативные EAP (без TLS-туннеля)
│   │
│   ├── EAP-MD5
│   │     └─ пароль (хеш), нет защиты канала
│   │
│   ├── EAP-OTP
│   │     └─ одноразовые пароли
│   │
│   ├── EAP-GTC
│   │     └─ токены / challenge-response (generic)
│   │
│   ├── LEAP (Cisco, устарел)
│   │     └─ слабая MSCHAP-подобная схема
│   │
│   └── прочие vendor-методы
│
├── 🔐 Туннелируемые EAP (TLS внутри)
│   │
│   ├── PEAP (Protected EAP)
│   │     │
│   │     └── внутренняя аутентификация
│   │           ├─ MSCHAPv2 (самый частый) - логин/пароль -  используется на Palo Alto для аутентификации VPN - используется для гостевого Wi-Fi
│   │           ├─ GTC (иногда) - тоже поддерживается на Palo Alto
│   │           └─ редкие кастомные реализации
│   │
│   ├── EAP-TTLS
│   │     │
│   │     └── внутренняя аутентификация (гибкая)
│   │           ├─ PAP
│   │           ├─ CHAP
│   │           ├─ MSCHAP / MSCHAPv2
│   │           ├─ OTP / токены
│   │           └─ иногда вложенный EAP
│   │ 
│   ├── EAP-FAST (Cisco) - требует агента Cisco
│   │     └─ PAC-туннель + внутр. MSCHAPv2
│   │
│   │
│   └── TEAP (современный)
│         ├─ TLS tunnel (как база)
│         ├─ multiple inner EAP methods
│         ├─ device + user auth separation
│         └─ MFA / posture-capable flows
│
└── 🔒 Полный TLS
    │
    └── EAP-TLS - золотой стандарт
          ├─ клиентский сертификат
          ├─ серверный сертификат
          └─ без паролей вообще
```

**Native Methods(a.k.a. "standalone methods")**

* EAP-TLS: mutual certificate authentication, strongest, widely used for Wi-Fi and VPN with smartcards - full TLS session inside EAP - `TLS → wrapped in EAP → wrapped in RADIUS → transported between ISE and NAS/switch/WLC`
* EAP-MD5 - insecure, uses digest algorithm to hide credentials, does not have mutual authentication. Some switches use it for MAB, some IP phones use it
* EAP-PWD - password based, strong crypto
* EAP-SRP - secure remote password
* EAP itself carries all authentication data
* No “inner” methods
* No tunnel wrapping EAP
* Example: EAP-TLS is entirely self-contained: TLS handshake happens directly in EAP messages. No second method inside
* Only EAP messages are carried inside EAPOL frames on the LAN

```bash
Ethernet
 └─ 802.1X (EAPOL)
     └─ EAP
         └─ EAP-Method (TLS handshake messages)
```

**Tunneled EAP Methods (methods that create a secure tunnel first)**

* A tunneled method first creates an encrypted outer tunnel, then authenticates inside that tunnel using some inner method
* Outer methods (PEAP, EAP-TTLS, EAP-FAST) REQUIRE an inner method
* They only create an encrypted channel
* Outer method = secure tunnel
* Inner method = how you prove who you are inside the tunnel
* Because outer methods only provide:
  * Server authentication
  * TLS tunnel creation
  * Protection against credential snooping
* Outer methods - cannot work by it self - they need inner method - they are all “TLS-based,” but the tunnels are not the same - They differ in how the tunnel is created, what keys are used, what is allowed inside, and how the client/server authenticate each other:
  * PEAP → TLS tunnel + EAP-MSCHAPv2 inside, requires server cert - Enterprise Wi-Fi with AD (most common) - only allows EAP inner methods
  * EAP-TTLS → TLS tunnel + ANY inner method (PAP/CHAP/MSCHAPv2/EAP), requires server cert - no client cert - - username+passwd - Best for RADIUS servers in Linux/FreeRADIUS setups needing PAP/LDAP
  * EAP-FAST → TLS tunnel built using PAC instead of server cert, Cisco-centric - Cisco-only shops where certificate deployment is hard
* Inner methods - cannot live without outer methods:
  * EAP-MSCHAPv2: username/password, used for VPNs, weak, avoid for Wi-Fi - MSCHAPv2 encapsulated as an EAP inner method - not pure MSCHAPv2
  * PAP
  * CHAP / MS-CHAP / MS-CHAPv2

**MSCHAPv2**

* In short: using complex computation server and client generates NT-Response using: `Server Challenge, Client Challenge, Username, Password, DES Encryption, SHA-1, MD-4`
* MSCHAPv2 = Microsoft Challenge Handshake Authentication Protocol, version 2
* Password-based authentication protocol
* Designed for PPP, VPNs, and 802.1X inner authentication
* Provides mutual authentication between client and server - v1 supports only client
* Generates a shared session key for subsequent encryption (MPPE in VPNs) - `optional`
* Server generates a 16-byte random challenge
* Client generates its NT hash of the password: `NT-Hash = MD4(unicode(password))` - only MD4 is used - Weak! - that is why TLS tunnel is required
* Peer Challenge = a 16-byte random value generated by the client
* `ChallengeHash = SHA1(PeerChallenge || ServerChallenge || Username)` - generated by client
* Only first 8 bytes of challenge hash are used as DES plaintext
* Pad NT-Hash to 21 bytes → split into 3 × 7-byte blocks → convert each to 8-byte DES key
* Encrypt ChallengeHash (8 bytes) with each DES key → concatenate → `24-byte NT-Response`
* Client sends `NT-Response + Peer Challenge to server`
* Server does same computation using stored NT-Hash → compares NT-Response → `Success/Fail`
* CHAP: Basic challenge-response, MD5, no mutual auth
* MS-CHAP v1: Microsoft’s version, uses NT hash, one-way authentication.
* MS-CHAP v2: Adds mutual authentication, peer challenge, and session key; much stronger and used in PEAP inner auth.

**PEAP + MSCHAPv2 after TLS Handshake**

* Everything encrypted inside TLS
* 4 messages
* Server sends PEAP AVP with EAP-Request (MSCHAPv2 Challenge) - Inside TLS, the server sends a standard MSCHAPv2 Challenge (16-byte random challenge)

```
EAPOL
  EAP-Request (Type: PEAP)
    TLSv1.2 Application Data
      PEAP TLV
        EAP-Request
          Type: MSCHAPv2 (26)
          MSCHAPv2: Challenge
            Challenge: 52 1a 9e f1 8b 23 87 2c ...
            Name: host/MyRadiusServer
```

* Client responds: PEAP + EAP-Response (MSCHAPv2 Response)

```
EAPOL
  EAP-Response (PEAP)
    TLSv1.2 Application Data
      PEAP TLV
        EAP-Response
          Type: MSCHAPv2 (26)
          MSCHAPv2: Response
            Peer-Challenge: 2b 3d 19 9a 44 e5 aa 07 ...
            NT-Response: 9c 66 bc 4e 94 5d 18 61 ...
            Flags: 0x00
```

* Server sends PEAP TLV: Success + EAP-Success (inner)

```
EAPOL
  EAP-Request (PEAP)
    TLSv1.2 Application Data
      PEAP TLV
        Result TLV: Success
        EAP-Request
          Type: MSCHAPv2 (26)
          MSCHAPv2: Success
            Message: "S=11223344556677889900..."
```

* Client acknowledges inner success

```
EAPOL
  EAP-Response (PEAP)
    TLSv1.2 Application Data
      PEAP TLV
        Result TLV: Success
        EAP-Response
          Type: MSCHAPv2 (26)
          MSCHAPv2: ACK
```

**EAP-TLS**

* In EAP-TLS, the authentication is completed by the certificates during the TLS handshake
* In pure EAP-TLS, nothing is sent “inside a tunnel” after the TLS handshake
* Full mutual certificate validation
* There is no inner method, no inner username, no MSCHAPv2, no PAP.
* ISE sends CertificateRequest
* Client sends:
  * Client Certificate
  * ClientKeyExchange
  * CertificateVerify (signed with client private key)
* ISE validates:
  * certificate chain
  * certificate’s key usage
  * revocation (CRL/OCSP)
  * trust store
  * identity (CommonName/SAN)
  * optional—mapping to AD/endpoint ID
* This cryptographic proof is the authentication
* After authentication is finished the switch opens the port and applies authorization (VLAN, ACL, SGT, etc.)
* TLS generates a Master Secret
* From that, EAP-TLS derives: MSK (Master Session Key, 64 bytes), EMSK (64 bytes)
* These are sent (via RADIUS) to the switch/WLC from ISE in encrypted form using the shared secret and MD5-based obfuscation
* And used to create:
  * WPA2/WPA3 Pairwise Master Key (PMK)
  * Wired 802.1X session keys
  * Fast roaming keys (PMKID)
* AP/WLC and client use the MSK to derive the PMK (Pairwise Master Key).
* AP and client run the 4-Way Handshake to prove possession of the PMK and derive:
  * PTK (Pairwise Transient Key)
  * GTK (Group Temporal Key)
* PTK is used to encrypt unicast traffic between client and AP (WPA2/3)
* GTK is used to encrypt broadcast/multicast traffic

### Wired auth work flow

* Client (supplicant) sends `EAPOL-Start` broadcast to the switch (authenticator)
* Switch (authenticator) sends `EAP-Request/Identity` frame to client
* Client responds with username (`EAP-Response/Identity`) - At this point, no method is chosen yet — only the identity is exchanged
* Authenticator passes identity to authentication server
* Switch encapsulates the EAP packet in RADIUS Access-Request and forwards to RADIUS / AAA server (authentication server)
* Server now knows the username and can look up the user’s profile/policy: `Which EAP method is allowed`
* It decides the method based on user group, device, or other policy
* Server responds with EAP-Request specifying outer method: For example: EAP-Request / PEAP Start
* The EAP Type field indicates which outer method the client should use
* Switch forwards this packet to client
* Client evaluates supported methods
* If supported: proceeds → starts TLS handshake
* Inside that tunnel, the inner authentication method is negotiated
* Once the tunnel is up, the server sends an EAP-Request inside the TLS tunnel
* The Type field specifies the inner method
* The server may also send an initial challenge if the inner method is challenge/response
* Client examines the inner method, If supported → proceeds with inner authentication
* After agreeing on the inner method, actual authentication proceeds inside the TLS tunnel
* EAP-MSCHAPv2 example:
  * Server → Client: Challenge (16-byte random)
  * Client → Server: Response (hash of password + challenge)
  * Server verifies → sends Success / Failure
* In practice:
  * PEAP → nearly fixed: MSCHAPv2
  * TTLS → can vary: PAP/CHAP/MSCHAPv2/EAP
  * FAST → usually MSCHAPv2 or GTC

### EAP Packets

The first packet which sees ISE is `EAP-Response/Identity` from switch/AP because it does not see first 2 messages between switch/AP and client:

* EAPOL start
* EAP Request/Identity

**Frame 1 — EAPOL-Start (client → switch)**

```
Frame 1: 30 bytes on wire
Ethernet II
   Destination: 01:80:c2:00:00:03   (EAPOL multicast)
   Source:      3c:22:fb:aa:bb:cc
   Type: 0x888e (802.1X Authentication)

EAPOL
   Version: 1
   Type: EAP-Packet (0)
   Length: 0
```

This tells the switch: `"Hey, I want to authenticate via 802.1X"`

**Frame 2 — EAP-Request / Identity (switch → client)**

```
Frame 2: 60 bytes
Ethernet II
   Type: 0x888e (802.1X)

EAPOL
   Version: 1
   Type: EAP-Packet (0)
   Length: 9

EAP
   Code: Request (1)
   Identifier: 0x01
   Length: 9
   Type: Identity (1)
```

Switch asks: `"Who are you?"`

**Frame 3 — EAP-Response / Identity (client → switch)**

```
Frame 3: 78 bytes
Ethernet II
   Type: 0x888e

EAPOL
   Version: 1
   Type: EAP-Packet (0)
   Length: 25

EAP
   Code: Response (2)
   Identifier: 0x01
   Length: 25
   Type: Identity (1)
   Identity: host/WIN10PC.example.com
```

Switch now takes this and wraps it into `RADIUS → forwards to ISE`

**Frame 4 — EAP-Request / EAP-TLS Start (switch → client)**

```
Frame 4: 110 bytes
Ethernet II
   Type: 0x888e

EAPOL
   Version: 1
   Type: EAP-Packet (0)
   Length: 42

EAP
   Code: Request (1)
   Identifier: 0x02
   Length: 42
   Type: EAP-TLS (13)
      Flags: 0x20 (Start)
      TLS Data: <empty>
```

ISE says: `Begin EAP-TLS now`

**Frame 5 — EAP-Response / EAP-TLS (ClientHello, client to switch)**

```
Frame 5: 214 bytes
Ethernet II
   Type: 0x888e

EAPOL
   Length: 152

EAP
   Code: Response (2)
   Identifier: 0x02
   Length: 152
   Type: EAP-TLS (13)
      Flags: 0xc0 (More Fragments + Length Included)
      TLS Message Length: 517
      TLS Data (fragment 1): ClientHello
         TLSv1.2 Record Layer
         Handshake Protocol: Client Hello
            Cipher Suites: ...
            Random: ...
```

**Frame 6 — EAP-Request / EAP-TLS (ServerHello + Certificate, ISE > Switch > Client)**

```
Frame 8
EAP
   Code: Request (1)
   Identifier: 0x03
   Type: EAP-TLS
      Flags: 0xc0 (More Fragments + Length Included)
      TLS Message Length: 3230
      TLS Data (fragment 1):
         TLSv1.2 Record: ServerHello
         TLSv1.2 Record: Certificate (fragment)
```

In EAP-TLS, the authentication is completed by the certificates during the TLS handshake

## Packet capture

```
sudo tcpdump -i en0 ether proto 0x888e -vv -w wifi_handshake.pcap
```

### MAB

* Authenticate based on MAC
* Printer sends any packet
* Switch sends 3 EAP Request Identity and waits for reply
* If no reply, switch sends printer's MAC to Authentication server in Radius Access-Request
* Authentication server sends Access-Accept
* No periodic reauthentication
* Radius service type 6 - it distinguishes MAB from other packets
* We can specify order and priority for MAB, dot1x and web...

```
Service-Type = Call-Check (6)
User-Name = "aabbccddeeff"
Calling-Station-Id = "aa-bb-cc-dd-ee-ff"
NAS-Port-Type = Ethernet
```

### Authorization

* Dynamic VLAN
* Downloadable access control list - stored on NAC + named ACL - stored on switch or AP
* Security group tags SGTs - NAC assignes a role - Switch adds it to packets - firewalls filter based on it
* Airspace ACL names
* URL redirections
* Time based access
* Trust sec capabilities
* Change of authorization - CoA - NAC periodically checks AD groups memberships - if changed - sends CoA to switch/AP - RADIUS protocol feature

## IEEE 802.1X Wired modes

* Monitor mode - full end-user access, regardless of authentication results - 802.1X-enabled ports do not block traffic before successful authentication and authorization - visibility on who and what is connecting - devices connecting to your network - types of endpoints (for example, PCs, printers, cameras) and their connection points (switch, port) - types of endpoints (for example, PCs, printers, cameras) and their connection points (switch, port) - `evice is allowed network access on a port before completing the full 802.1X authentication process`
* Low impact - pre-authentication ACL that permits only basic connectivity for unauthenticated hosts - After successful authentication, the Cisco ISE authentication server sends a dACL to override any existing port ACL
* Closed mode - allows only EAPOL traffic until the authentication process completes - default behavior of an 802.1X-enabled switch port

## Host modes

* Single Host Mode - Only one client can be connected to the 802.1X-enabled port - Packets from other hosts are dropped
* Multiple Host Mode - multiple hosts to a single 802.1X-enabled port - nly the first client must be authorized
* Multi Domain Authentication Mode (MDA) - Allows an IP phone and a single host behind the IP phone to authenticate independently - Only one MAC address is allowed per domain - The switch can place the host in the data VLAN and the IP phone in the voice VLAN
* Multi Authentication Mode - Allows one client on the voice VLAN and multiple clients on the data VLAN to authenticate individually on a single 802.1X-enabled port - used for VMs

## Active directory integration

* If NAC joins AD, then `MSRPC / Kerberos / Netlogon` are used to verify user cerdentials
* MSCHAPv2 does not send the password to ISE, ISE gets only username and challenge response
* ISE sends the challenge-response information through Microsoft's authentication mechanisms
* Primary option is Netlogon - MS-NRPC (Netlogon Remote Protocol) for PEAP-MSCHAPv2 password validation

## ISE

### Architecture

* There are nodes and personas
* Node - VM or appliance
* One node may run several personas
* Distributed deployment - personas are distributed accross may nodes
* One node deployment - 2000 endpoints
* Two node deployment - all personas on each node
* Four node deployment - Primary PAN/MnT, Secondary PAN/MnT, PSN, PSN
* There is no concept of a "Primary" PSN versus a "Secondary" PSN
* PSNs share session information and profiling data and exchange heartbeats - when they are `in a PSN group` - configured explicitly when no load balancer is used and NAD may connect to different PSNs - `Administration → System → Deployment → Node Groups`
* Without a load balancer, load distribution between the PSNs depends on how NADs are configured with multiple PSN IPs, which may not be evenly balanced
* PSN node group

**Personas - role, assigned to a node:**

* PAN - policy administration node
* PSN - Policy service node - usually deployed in a redundant groups
* MNT - monitoring and troubleshooting node
* pxGrid - data sharing - session state, posture, profiling, group > Firewalls, EDR, SIEM, SOAR - typically enabled on redundant nodes, like PSNs

**NAD**

* Switch
* Access point
* VPN server
* IPN - Inline Posture Node
* Several nodes combined into one deployment are called cube
* All PSNs send their logs to the MnT as Syslog messages UDP/20514
* 2 interfaces on a node: one for management, one for requests
* If two MNT nodes exist in a deployment, all ISE nodes send their logs to both nodes.
* Inline Posture Nodes send logs only to one target
* However, the log database is not synchronized between the primary and secondary MnT nodes. Therefore, when the MnT node returns to service, a backup and restore of the monitoring node is required to keep the two MnT nodes in complete sync.
* The best practice for logging is to also send logging data to a security information manager (SIM) tool for long-term data archiving and reporting.
* PAN is responsible for admin GUI and synchronization of all ISE nodes
* In the eventof the primary PAN going offline, no synchronizations will occur until the secondary PAN is promoted to primary. After it becomes the primary, it will take over all synchronization responsibility. Some might consider this a “warm spare” type of high availability (HA)
* However, ISE does have a concept of a node group. Node groups are made up of Layer-2 adjacent (same VLAN) PSNs, where the nodes maintain a heartbeat with each other. In the event that a PSN goes down while a session is being authenticated, one of the other PSNs in the node group sends a CoA to the NAD so the endpoint can restart the session establishment with a new PSN. This is most commonly used when deploying the PSNs behind a load balancer. However, there is no requirement for node groups to be used solely with any Layer-2 adjacent PSNs
* You can configure AD groups of interest and then use them as conditions, you may also use AD attributes
* Certificate authentication profile - CAP tels ISE which value from certificate should be use for comparission during authorization
* ISS - identity source sequence - we can check user not only against one source but several
* We should use phasing deployment to do it safely: phase 1 - Monitor Mode, Phase 2 - Low Impact mode, Closed Mode

Deployment scenarios:

* Single node - all in 1
* 2 node - one primary and 1 backup
* 4 node - 2 appliances are PSN and 2 appliances are PAN MNT
* Fully Distributed

### Design

* First question - `amount of endpoints`
* Hundreds to thousands - Standalone
* Tens of thousands - Partially distributed - PSN separate nodes - PAN and MnT one node -
* Tens to hundreds of thousands - Primary and secondary PAN are separate - Primary and secondary MnT are separate - farm of PSNs
* What features do you need? This defines the License Tier
* 60 percent of the MnT VM disk space is allocated for log storage
* A deployment with 25,000 endpoints generates approximately 1 GB of logs per day
* PSN or pxGrid - 300 GB
* PAN - 600 GB
* MnT - 600 GB (Large Scale 2.4 TB)
* PAN and MnT 600 GB (Large Scale 2.4 TB)
* Standalone - 300GB for Cisco ISE v3.4, and 600GB for Cisco ISE v3.5.
* CPU and RAM: Always follow Cisco official sizing templates (small, medium, or large) based on your endpoint scale.
* I/O throughput:
  * Read Speed: at least 300 MBps
  * Write Speed: at least 50 MBps
* Disk Configuration:
  * Use minimum 10K RPM disks or, preferably, SSDs
  * Use RAID 10 for balanced performance and redundancy
  * Enable RAID caching on your storage controller
* Provisioning Method:
  * Use Thick Provisioning Eager Zero, especially for MnT nodes
* Cisco ISE virtual appliances are configured with strict CPU and memory reservations
* Hyper-threading is not mandatory; enabling this feature can improve throughput

### Installation

* Install on appliance or VM
* Type 'setup' to configure the appliance
* Cisco ISE supports bonding two network interfaces into a single, fault-tolerant link for high availability.
* It must be configured via the CLI after the wizard is complete, but before the node is assigned a persona in the deployment
* Cisco ISE 3.4 CLI Reference Guide - for all commands
* The GUI login account is a separate account from the CLI login account, it was merely duplicated during setup to simplify things
* `application reset-passwd ise <admin_username>` - reset the GUI password
* `password` - reset the CLI password
* ZTP is also supported

### System certificates

* EAP certificate - so Radius clients (Switches, APs, VPN) trust it
* CA certificates to verify clients certs
* Admin certificate for management
* Active Directory - ?
* SAML
* Radius DTLS -
* Гостевой портал
* Pxgrid - интеграция с SIEM и МСЭ
* Замена сертификата требует перезапуска - только ночью

Цикл жизни сертификатов:

1. Само подписанный сертификат
2. Импортировать корпоративные корневые сертификаты
3. Сгенерировать CSR
4. Получить подписанный сертификат
5. Привязать полученный сертификат к сервисам
6. Обновить сертифмкаты прежде чем они просрочатся
7. Мониторинг просрочки

### Components

* Device
* Device groups: locations, types
* Device profiles
* Device admin policy sets
* Shell profiles
* Command sets
* Allowed protocols

### Renew certs

* The most dangerous is EAP Radius cert - it can ruin Wi-fi and VPN - renew them first
* Then admin mgmt certs - they are less dangerous
* Monitor nodes are the less dangerous
* Backup old cert before
* On main node go to Administration > System > Certificates
* Choose proper node
* Prepare certificate in PEM format + key in separate file - chain is not required
* ISE server certificate is needed to be imported to all MAC laptops before - or wifi will not work
* Before import disable ISE node on F5
* Click Import, specify files + fiendly name
* Choose usage the same as for previous cert
* Click OK
* Everything will be restarted!!!
* Verify VPN and Wi-fi after this

### CLI

* show running config
* Reset GUI admin passwords: `application reset-passwd ise admin`
* Reset CLI admin password: `password`
* List all ISE processes and their statuses: `show application status ise`
* Configure DNS server: `config ip name-server 192.168.139.115`
* Show version: `show application version ise`
* Show interface: `show interface`
* Show routes: `show ip route`
* Reboot: `reload`
* `Show timezone`
* `show timezones`
* `configure; clock timezone`
* Show info required for license: `show udi`
* show ntp

## Workflow

* Client sends request to NAD
* NAD sends Radius request to ISE PSN
  * Credentials
  * Certificates
  * SAML
  * Device profiling
* PSN sends authorization to NAD
  * Access=permit
  * VLAN=20
  * SGT=Employee
  * ACL=Corp-access

### Radius policies

* `Policy > Policy Sets`
* Policy Set consists of Conditions, Authentication Policies, Authorization Policies and Allowed Protocols
* Policy set looks at first packet of Radius request and based on its parametres decides which Policy Set to use and which authentication protocols are allowed
* `RADIUS Access-Request > Conditions > Allowed Protocols > Authentication Policy > Authorization Policy`
* Allowed protocols can be configured in `Policy Sets > Policy elements > Results`
* Authentication policy is scanned one by one like FW policy, if one is matched, lower rules are not scanned
* Auth policy has Conditions and `Identity Source Squence` - so its main purpose is to `specify the user database`
* `Administration > Identity Management > Identity Source Squence` - consist of several Authentication Search List (External Identity Sources)
* `Administration > Identity Management > External Identity Sources` - consists of several AD servers
* One policy for all global protect connections
* Policies are served based on devices from which request arrived, protocol: TACACS or Radius, Radius Service Type
* When Palo Alto sends user via Radius, it also sends domain, thus it filters users
* Authentication in a policy can check many domains, so users from different domains can connect
* Devices in Policy are set via Device Type and written in the form: All Device Types#Company#PAN FWs#Global\_Protect, all devices in this folder which sends Radius request will fall under the policy
* Plus in a policy we specify allowed protocols: `Policy > Policy Elements > Results > Authentication > Allowed Protocols`
* Here we specify which Auth protocols are allowed:

### Conditions

* `Policy > Policy elements > Conditions`
* Determine which Authentication and Authorization Policies will be applied
* Inside Authentication and Authorization policies themselves
* Policy Sets conditions:
  * Network Protocol: Radius or Tacacs
  * Device Type, Device Location - IP addresses of switch or AP
  * Radius-NAS-Port-Type - Ethernet or Wireless
  * Radius Service Type - Framed for VPN, Wired, Wireless

### Allowed protocols

* PAP/ASCii
* CHAP
* MS-CHAPv1
* MS-CHAPv2
* EAP-MD5
* EAP-TLS
* LEAP
* PEAP
* EAP-FAST
* EAP-TTLS
* TEAP

### Maitenance

Restart services

```
application stop ise
application start ise
show application status ise
```

### Devices

`Administartion > Network Resources > Network Devices`

* IP address - may be mask - wide range of IPs
* Devices profile
* Location
* Device Type
* Radius settings
  * Shared secret
  * CoA Port
* Tacacs settings
  * Shared secret
* SNMP settings - ?
* Trustsec settings

### Timeouts

* Work Centers -> Device Administration -> Settings -> Connection Settings.
* TACACS Protocol Session Timeout should be the default value of 5 minutes or less.
* TACACS Connection Timeout should be the default value of 10 minutes or less.
* Work Centers -> Device Administration -> Policy Elements -> Results -> TACACS Profiles.
* Any TACACS+ Shell Profile with "Shell" type should have "Idle Time" set to "10" minutes or less.

### Web based authentication with redirection

Portal types

* admin portal
* sponsor portal
* guest portal

## RADIUS

* RADIUS (Remote Authentication Dial-In User Service) is one of the fundamental AAA (Authentication, Authorization, Accounting) protocols in networking
* UDP port 1812 - auth, 1813 - accounting, no retransmission state beyond NAS implementation
* Radius does not provide the ability to control which commands can be executed - Only supports authorization after authentication is complete (not dynamic real-time policy during session)
* Radius encrypts only password - No end-to-end encryption
* Radius uses PAP, CHAP, MS-CHAP, EAP methods for authentication
* Radius combines auth and author in one reply in the form of AV pairs
* 1645 auth and 1646 accounting - old style
* Radius server cannot send requests to radius client, so RFC 3576 and RFC 5176 were created, so called Dyncamic Authorization Extensions or CoA - Change of Authorization
* With these extensions we can disable port or disconnect user for example or request reauthentication
* CoA - server initiated authorization update
* Radius packet is a bunch of Attribute Value Pairs
* EAP, PAP, MSCHAP are encapsulated in the form of AVP as well

Use cases:

* 802.1X wired and wireless networks
* Wi-Fi enterprise authentication
* VPN authentication
* Device management access (TACACS+ is more common for CLI)
* Captive portals
* Accounting & billing systems

### AP to NAC EAP-TLS workflow

**Based on real world PCAP**

* Every packet in a session ends with `AVP Message-Authenticator` - HMAC-MD5 hash calculated over the entire RADIUS packet using the shared secret between the NAD and the RADIUS server - so both are sure that they `know shared secret` - Verify packet integrity - Verify packet authenticity - Prevent packet modification
* AP sends `Access Request` packet with `many Attribute Value Pairs` + `Identity` as an EAP message - `client sends` it in EAP message to AP
* NAC replies with `Access Challenge` and assigns AVP `State` - this will become unique session ID + in `EAP AVP` it requests `EAP-TLS`
* Also `Access Challenge` packet specifies which EAP method NAC wants to use, only `one method can be specified` - NAC decides it based on policy which considers AVPs in a first packet from AP: MAC address, SSID, AP IP address, etc...
* AP sends again Access Request with `many AVPs` including `EAP meesages` with `TLS Client Hello` inside it
* NAC replies with `Server Hello` including certificate
* AP sends `Client Certificate`
* NAC approves it or sends an error

```
=======================================================================================================
        AP (NAD) ↔ ISE (RADIUS)
         EAP-TLS OVER RADIUS (NO CLIENT VIEW)
=======================================================================================================

                AP / NAD                              ISE
                  |                                   |
                  |  Access-Request                   |
                  |---------------------------------->|
                  |  AVPs:                            |
                  |   - NAS-IP-Address                |
                  |   - NAS-Identifier                |
                  |   - NAS-Port-Type                 |
                  |   - Calling-Station-ID (MAC)      |
                  |   - Called-Station-ID (SSID/AP)   |
                  |   - Service-Type                  |
                  |   - EAP-Message (Identity)        |
                  |   - Message-Authenticator         |
                  |                                   |
                  |                 Access-Challenge  |
                  |<----------------------------------|
                  | AVPs:                             |
                  |   - State (session-id)            |
                  |   - EAP-Message (EAP-TLS Start)   |
                  |   - Message-Authenticator         |
                  |                                   |
                  |  Access-Request                   |
                  |---------------------------------->|
                  |  AVPs:                            |
                  |   - NAS-IP-Address                |
                  |   - NAS-Identifier                |
                  |   - Calling/Called-Station-ID     |
                  |   - EAP-Message (TLS ClientHello) |
                  |   - State                         |
                  |   - Message-Authenticator         |
                  |                                   |
                  |                 Access-Challenge  |
                  |<----------------------------------|
                  |  AVPs:                            |
                  |   - State                         |
                  |   - EAP-Message (TLS ServerHello  |
                  |     + Server Certificate)         |
                  |   - Message-Authenticator         |
                  |                                   |
                  |  Access-Request                   |
                  |---------------------------------->|
                  |  AVPs:                            |
                  |   - NAS-IP-Address                |
                  |   - NAS-Identifier                |
                  |   - Calling/Called-Station-ID     |
                  |   - EAP-Message (Client Cert)     |
                  |   - State                         |
                  |   - Message-Authenticator         |
                  |                                   |
                  |            Access-Accept / Reject |
                  |<----------------------------------|
                  |  AVPs:                            |
                  |   - EAP-Success / Failure         |
                  |   - SSL error                     |
                  |   - VLAN / ACL / Policy           |
                  |   - Message-Authenticator         |
                  |                                   |

========================================================================================================
```

*
*
* We configure on NAS, for example on VPN gateway:
  * Radius server IP
  * Shared Secret
  * Port - 1812
  * Authentication method: EAP methods, PAP, CHAP...
  * CA certificate to verify Radius server certificate
* Shared secret is used to calculate authenticator fields both from server and client, so both know that other part knows secret
* NAS collects user credentials → sends a `RADIUS Access-Request`
* Access request consists of `many Attribute Value Pairs`
* The password never appears in the Access-Request if EAP based Auth methods are used (EAP-TLS, PEAP + EAP-MSCHAPv2...)
* The password stays inside the EAP conversation, `not in RADIUS fields`
* RADIUS does not natively understand EAP methods
* Instead, RADIUS carries EAP inside the EAP-Message attribute as a transport

```
EAP-Message: <raw EAP frame>
Message-Authenticator: <HMAC>
```

* The RADIUS server (like ISE, FreeRADIUS, Azure AD) terminates EAP
* RADIUS itself does not interpret PEAP, EAP-TLS, EAP-TTLS logic, EAP is only encapsulated inside RADIUS
* RADIUS natively supports `PAP, CHAP, and MS-CHAPv2`
* Only PAP sends a user password in the Access-Request in the form of `User-Password attribute`, CHAP, MSCHAP do not use password as well, they use challenges
* So `RADIUS Access-Request` may contain a little bit different `Attribute Value Pairs`, depending on who sent the request
* Example of request from VPN Gateway:
  * NAS-Port-Type = Virtual
  * Framed-IP-Address (the IP assigned to client or requested)
  * Calling-Station-Id = client IP
  * Connect-Info = SSL/IPsec parameters
  * Service-Type = Framed-User

```
RADIUS Protocol
    Code: Access-Request (1)
    Identifier: 0x4b
    Length: 152
    Authenticator: 3c5d76996e8fbdc642114f9b3b2b884a
    Attribute Value Pairs
        User-Name: johndoe
        NAS-IP-Address: 10.1.1.10
        NAS-Identifier: vpn-gw01
        NAS-Port: 0
        NAS-Port-Type: Virtual (5)
        Service-Type: Framed (2)
        Calling-Station-Id: 203.0.113.55
        Called-Station-Id: vpn.company.com
        Framed-IP-Address: 10.50.10.25
        Connect-Info: "SSL VPN, TLS1.2"
        Tunnel-Type: VPDN (3)
        Tunnel-Medium-Type: IPv4 (1)
        EAP-Message: 02 01 00 12 01 6a 6f 68 6e 64 6f 65
        Message-Authenticator: 06:91:f3:0e:18:be:22:44:...
```

* Example of request from 802.1X Switch
  * NAS-Port (physical interface number)
  * NAS-Port-Type = Ethernet
  * Calling-Station-Id = client MAC
  * EAP-Message (fragmented during EAP-TLS)
  * Service-Type = Framed
  * Called-Station-Id = MAC of switch interface

```
RADIUS Protocol
    Code: Access-Request (1)
    Identifier: 0x22
    Length: 210
    Authenticator: 8b0eae3db88511a3c11adb3f5acdd922
    Attribute Value Pairs
        User-Name: 00-1C-42-BE-12-01
        NAS-IP-Address: 10.10.1.2
        NAS-Identifier: access-sw01
        NAS-Port: 50112
        NAS-Port-Type: Ethernet (15)
        Service-Type: Framed (2)
        Calling-Station-Id: 00-1C-42-BE-12-01
        Called-Station-Id: 00-25-90-AA-BB-CC
        EAP-Message:
            02 03 00 1a 01 00 00 16 30 14 30 12 06 ...
        Message-Authenticator: 77:13:ba:55:92:ae:6f:...
        Cisco-AVPair: "device-traffic-class=voice"
```

* Example of request from Router for Administrative Login
  * Service-Type = Login
  * NAS-Port-Type = Virtual or Async
  * NAS-Port identifies CLI session
  * User-Name = admin login username
  * No EAP
  * User password via PAP
* Often includes NAS-Port-Id = “tty0”, "vty1", etc

```
RADIUS Protocol
    Code: Access-Request (1)
    Identifier: 0x17
    Length: 128
    Authenticator: 22d3b8fa72bb001e2a11230d49d951ab
    Attribute Value Pairs
        User-Name: admin
        User-Password: <encrypted>
        NAS-IP-Address: 192.168.2.1
        NAS-Identifier: core-rtr01
        NAS-Port: 501
        NAS-Port-Type: Virtual (5)
        NAS-Port-Id: vty1
        Service-Type: Login (1)
        Calling-Station-Id: 192.168.2.44
        Acct-Session-Id: 00000023
        Message-Authenticator: 1c:ab:f1:77:1d:9e:bc:...
```

* Thus initial packet contains a lot of useful information: NAS IP-address, Username, User password, vendor specific Attribute Value Pairs
* This informaytion may be used to identify which policy will be used to access the request
* After first packet, if EAP is used, there is a series of packets to build the EAP tunnel
* All of this is carried inside:
* `RADIUS Access-Request (client → server)`
* `RADIUS Access-Challenge (server → client)`
* Next, there is another series of packets for inner method authentication, for example MSCHAPv2
* These MSCHAPv2 exchanges are also transported using:
* `RADIUS Access-Request`
* `RADIUS Access-Challenge`
* Example of `MSCHAPv2 in EAP in Radius`

```
Code: Access-Challenge
Identifier: 0x08
AVPs:
    EAP-Message:
        01 08 00 2a 1a 01
        <MSCHAPv2 Challenge: 16-byte ServerChallenge>
    State: 0x987634ab3829
    Message-Authenticator: <value>

Code: Access-Request
Identifier: 0x09
AVPs:
    User-Name: "johndoe"
    State: 0x987634ab3829
    EAP-Message:
        02 09 00 3a 1a 02
        <MSCHAPv2 Response: PeerChallenge + NT-Response>
    Message-Authenticator: <value>
```

* Only after inner authentication succeeds, the RADIUS server sends: `Access-Accept` with MS-MPPE keys (for VPN encryption keys), VLAN attributes, etc.
* MPPE keys (Microsoft Point-to-Point Encryption keys) are the session encryption keys used by PPTP and some L2TP/IPsec VPNs to encrypt PPP traffic
* If EAP is not used, then immediately after request NAC sends reply `Access-Accept/Reject`
* All final authorization happens in the last Access-Accept packet
* Examples of `authorization attributes`:
  * VLAN assignment (Tunnel-Private-Group-ID)
  * Access control lists (Filter-Id, Cisco-AVPair)
  * Session timeout
  * QoS policies (WLAN-QoS-Profile)
  * Framed-IP-Address
  * MPPE keys for VPN encryption
* Example of RADIUS Access-Accept (802.1X)

```
RADIUS Protocol
    Code: Access-Accept (2)
    Identifier: 0x22
    Length: 180
    Authenticator: c515f2a8060b15d9f0c4b9ca795a8312
    Attribute Value Pairs
        EAP-Message: 03 04 00 04        <-- EAP Success
        Message-Authenticator: 11:a8:...:de
        Tunnel-Type: VLAN (13)
        Tunnel-Medium-Type: IEEE-802 (6)
        Tunnel-Private-Group-Id: "20"
        Cisco-AVPair: "device-traffic-class=voice"
        Class: 4953452d53455353494f4e2d32333038 ("ISE-SESSION-2308")
        Session-Timeout: 86400
```

* Example of RADIUS Access-Accept (Router Login)

```
RADIUS Protocol
    Code: Access-Accept (2)
    Identifier: 0x17
    Length: 120
    Authenticator: 003fc47c11bc88357bd1fe7fddf3a881
    Attribute Value Pairs
        Service-Type: Login (1)
        Class: "corp-admins"
        Reply-Message: "Welcome admin"
        Filter-Id: "ADMIN_PRIV15"
        Idle-Timeout: 600
```

* After Access-Accept, authentication is over and no more RADIUS messages are exchanged for that session—unless `reauth or CoA occurs`
* 802.1X Reauthentication / Re-Auth Timer, Switch/AP periodically sends: `Access-Request → Access-Accept`

### Packet Types

Authentication

* Access-Request
* Access-Accept
* Access-Reject
* Access-Challenge (used to trabsport additional data: EAP, token codes, OTP, MSCHAP)

Accounting

* Accounting-Request (Start / Interim / Stop)
* Accounting-Response

CoA / DM (RFC 5176)

* CoA-Request / CoA-ACK / CoA-NAK
* Disconnect-Request / Disconnect-ACK / Disconnect-NAK

### Attributes

User Identification Attributes

* User-Name (1) - Example: User-Name = "jdoe" - Used in: PAP only (never for EAP)
* User-Password (2) - Encrypted using shared secret (only for PAP). - example: User-Password = "encrypted" - Used in: PAP only (never for EAP)

Network Access Server (NAS) Attributes

* NAS-IP-Address (4) - Example: NAS-IP-Address = 10.1.10.1 - Meaning: IP of switch, AP, VPN gateway sending request
* NAS-Identifier (32) - Example: NAS-Identifier = "SWITCH-1" - Meaning: Hostname or identifier of the NAS
* NAS-Port (5) - Example: NAS-Port = 10113 - Meaning: Physical port or logical port number
* NAS-Port-Type (61) - Example: Ethernet (15) for wired, Wireless-802.11 (19) for Wi-Fi, Virtual (5) for VPN - Used for: Policy rules

Service-Type (6)

* Common values:
* 1 = Login - SSH/Terminal/Telnet sessions
* 2 = Framed - 802.1X authentication for wired/wireless networks, PPP, PPPoE, and VPN connections
* 5 = Call Check - MAB
* Example: Service-Type = Framed

EAP Attributes

* EAP-Message (79) - Example: EAP-Message = 0x02000005... - Contains EAP-TLS/PEAP/etc
* Message-Authenticator (80) - Example: Message-Authenticator = 0x45a8... - HMAC-MD5 integrity check for EAP - Used in: All EAP methods

Calling/Called Attributes

* Calling-Station-Id (31) - Example: Calling-Station-Id = "AA-BB-CC-DD-EE-FF" - Meaning: Client MAC address for 802.1X/Wi-Fi
* Called-Station-Id (30) - Example (Wi-Fi): - Called-Station-Id = "88-AC-F1-01-02-03:CorpWiFi" - Meaning: AP MAC + SSID

Framed Attributes (mostly for VPN)

* Framed-IP-Address (8) - This is typically sent in Accept packet - Example: Framed-IP-Address = 192.168.10.55 - IP address for client, instead of DHCP
* Framed-MTU (12) - Example: Framed-MTU = 1400
* Framed-Protocol (7) - Example: Framed-Protocol = PPP (1) - Mostly for VPN/PPP

Vendor-Specific Attributes (VSA)

* Vendor-Specific (26) - Contains nested vendor attributes - Example showing a Cisco AVPair: Cisco-AVPair = "shell:roles=network-admin"
* VSA examples by vendor: Cisco: VLAN, ACLs, roles - Aruba: Aruba-User-Role - Palo Alto: Filter-Id for group mapping - Microsoft: MS-CHAP attributes

Authorization (Accept Packet) Attributes

* Filter-Id (11) - Example: Filter-Id = "StudentPolicy" - Common for VPN and WLAN ACL assignment
* Tunnel-Medium-Type (65) - Example: Tunnel-Medium-Type = 6 (802) - Required for VLAN assignment
* Tunnel-Type (64) - Example: Tunnel-Type = VLAN (13)
* Tunnel-Private-Group-ID (81) - Example: Tunnel-Private-Group-Id = "30" - Means VLAN 30

Accounting Attributes

* Acct-Status-Type (40) - Values: Start (1), Stop (2), Interim-Update (3)
* Acct-Session-Id (44) - Example: Acctime.12345abcd
* Acct-Input-Octets (42), Acct-Output-Octets (43) - Traffic counters

### Security Model

* RADIUS uses a shared secret and MD5-based hashing
* The password in Access-Request is obfuscated using MD5 + secret (not actual encryption)
* Entire packet is NOT encrypted
* EAP payloads (EAP-TLS etc.) are carried inside RADIUS but security comes from TLS, not RADIUS
* Modern deployments rely on EAP-TLS or PEAP for true security

### CoA

* Change of Authorization (CoA) port is used to send dynamic policy updates to network devices after initial authentication
* Part of the RADIUS protocol and is defined in the IETF RFC 5176
* After an initial authentication, Cisco ISE can use CoA to dynamically update the authorization of a session (e.g., changing VLAN assignment or access control list (ACL) permissions)
* The default CoA port for RADIUS is UDP port 1700. This is the port through which CoA messages are sent to network devices, such as switches or wireless controllers
* CoA Types:
  * Re-Auth (Reauthentication): Forces the endpoint to reauthenticate using the same credentials but applying new authorization policies
  * Port-Bounce: Disconnects the client (causing a reauthentication) by momentarily shutting down the port (used in wired scenarios)

### Accounting

* Shows when user connects, disconnects, how much data sent/received
* When a user/session begins, the Network Access Server (NAS) sends an Accounting-Start packet to the RADIUS server
* During a session, the NAS may send Interim-Update packets at intervals (e.g., every 5 minutes) - with bytes sent/received for example
* When the session ends, the NAS sends Accounting-Stop
* Standard RADIUS accounting cannot log user commands, so it is useless for admin accounting

### Trobleshooting client certificate authentication

* Client uses EAP-TLS and certificate for authentication instead of username and password
* ISE rejects user certificate and says `CA is uknown`
* Allthough ISE has all CA certs
* We take traffic capture on ISE nodes
* Next we search in pcap file requests regarding particular endpoint: `radius.Calling_Station_Id contains "80-75-BF-71-26-FB"`
* We will see only packets from AP to NAC
* In these packets we check Radius Attribute `State` and filter based on it, so we will see the whole session
* There we can see error TLS message
* Reason: `Administration > Cerificates > Trusted Certificates > CA Certificate options` should have `Trust for client authentication` Enabled

## Cisco switch configuration for 802.1X

Port can be configured in different modes:

* single host - only one host connected - one MAC address
* multi-host - many MAC addresses - first MAC open the door and then others can work as well
* multi-domain - domains voice and data, when phone and PC on one port, auth of one device on voice VLAN and one device on data vlan
* multi-auth - ever single mac address should be authenticated

Verify configuration

* Show all dot1x configured ports: `show dot1x all`
* Show all dot1x authentications for particular port: `show authentication sessions int gig0/7`
* show interface status
* show authentication int gig0/7
* debug radius authentication

Switch configuration

```
aaa new-model
aaa authentication login default enable

#Enable dot1x globally
dot1x system-auth-control

#Enable ip device tracking, this command allows for the any source in the provided dACL to be replaced with the IP address of the single device connected to the port.
ip device tracking

#Enable AAA via Radius
aaa authentication dot1x default group radius
aaa authorization network default group radius
aaa accounting dot1x default start-stop group radius

#Configure Radius server
radius server ise
     address ipv4 192.168.139.114 auth-port 1812 acct-port 1813
     key test
aaa group server radius ise-group
     server name ise

[Optional]
#Configure radius server load balancing
radius-server load-balance method least-outstanding batch-size 5

#Enable use of vendor specific attributes
radius-server vsa send authentication
radius-server vsa send accounting

#Enable 3 VSAs
radius-server attribute 8 include-in-access-req - include supplicant IP in a request
radius-server attribute 6 on-for-login-auth - login request uncludes Service-Type
radius-server attribute 25 access-request include - Class

#Enable change of authorization
aaa server radius dynamic-author
client ise_ip server-key shared_secret

#Configure actions in case of failures
authentication event fail action next-method
authentication event server dead action authorize
authentication event server dead action authorize voice
authentication event server alive action reinitialize

#Configure violation action
authentication violation restrict

#Configure Interface
int gig0/7
switchport host or switchport mode access & spanning-tree portfast
authentication host-mode multi-auth
authentication open - open mode for testing
authentication periodic
authentication timer reauthenticate server - let server decide how often to reauthenticate
dot1x pae authenticator
dot1x timeout tx-period 10 - supplicant retry timeout
authentication port-control auto
do debug readius authentication
no shutdown

#Test
test aaa group  ise-group bob passwd new-code
```

## Cisco switch configuration for MAB

```
#Let ISE understand that it is mac address
radius-server attribute 6 on-for-login-auth
radius-server attribute 25 access-request include

#Enable mab
mab

#Authentication order
authentication order mab dot1x

#Authentication priority
authentication priority dot1x mab
```

## TACACS

* Tacacs was initially created to control access to Unix terminals, then Cisco created Tacacs+, mostly used for device administration
* Tacacs+ uses TCP port 49
* Tacacs+ encryptes entire payload
* All the devices that will be controlled and audited by TACACS device administration, should have TACACS secrets set
* Enable on a node: `Administration > Deployment > Node > Enable Device Admin Service`

### ISE logic

* Device admin policy triggers based on Device Type, Location, Protocol, Username
* Then it enforces a set of rules of Authorization policy
* These rules add additional conditions
* These rules apply Command Sets + Shell Profiles

### Add device for TACACs auth

`Administartion > Network Resources > Network Devices`

* Device Profile
* Network Device Group:
  * Location
  * IPSEC - ?
  * Device Type
* TACACS shared secret

### Device Admin Policy Sets

`Work Centers > Device Administration Policy Sets`

* Policy Name
* Conditions
  * Protocol
  * User
  * Device Type
  * Device Location
* Allowed protocol
* Authentication Policy
* Authorization Policy
* Authorization Policy - Local Exceptions
* Authorization Policy - Global Exceptions

Authorization Policy

* Rules
  * Name
  * Conditions
    * Users
    * Groups
  * Command sets
  * Shell Profiles

### Shell profiles

`Device Administration / Policy Elements / Results / TACACS Profiles`

* List of atttributes - that's all

### TACACS command sets

* Usually allow all
* allow/deny
* Command
* Arguments

### Logs

`Operations > TACACS > Live Logs`

* Each successfull login generates 2 logs: Authentication and Authorization
* All details are available:
  * Authentication Policy
  * Authorization Policy
  * Shell profile
  * Response at

### Monitor amount of requests

`Operations > Reports > Reports > Device Administration`

### Switch configuration

```
aaa new-model - enable aaa
tacacs-server host 192.168.139.125
Switch(config)#aaa authentication login default group tacacs+ local
aaa authorization commands 15 default group tacacs+ local
aaa authorization config-commands
aaa authorization exec default group tacacs+ local
aaa accounting commands 15 default start-stop group tacacs+
```

## PXGrid

* Used to send info from ISE to all other devices, for example FTDsed to send info from ISE to all other devices, for example FTD

## MACsec

* To protect segment between PC and switch.
* Confindetiality and integrity check of each of the frames
* Macsec key agreement - MKA - between PC and switch
* Different frame type - new 802.1AE Header + CMD field + ICV field
* It can be extended to protect data berween switches
* It uses hop by hop encryption
* Security Assosation Protocol - SAP - for encryption between two switches

## Trustsec

* Trustsec allows control and filter traffic based on Security Group Tags.
* Every user gets its own tag after authentication and tag is injected into Ethernet frame

## Design

* 2 F5s in 2 different DataCenters - both have the same Anycast address - 10.255.255.3
* Every F5 points to 2 VMs with Tacacs module in the same data centre
* Request goes to the closest to the client F5, based on routing to Anycast address
* So we have 4 VMs: 2 in each data center
* It is better to use app level monitor on F5, because sometimes Tacacs service stuck and keeps replying to to TCP requests
* The same for Radius

## Upgrade

* Split CLI upgrade will be used. 22 hours in total
* Example is based on the following example:
  * Primary PAN in DC1
  * Primary MnT in DC1
  * Radius node in DC1
  * Radius node in DC1
  * Tacacs node in DC1
  * Secondary PAN in DC2
  * Secondary MnT in DC2
  * Radius node in DC2
  * Radius node in DC2
  * Tacacs node in DC2
  * F5 in DC1: balances between 2 Radius nodes + forwards traffic to 1 Tacacs node + sends BGP anycasts for both Radius(10.255.255.4) and Tacacs(10.255.255.3) VSs - Tacacs VS port - 49/TCP - Radius ports - 1812, 1813 UDP
  * F5 in DC2 - all the same, but for nodes in DC2

### BACKUP

* VM snapshots cannot be used as backups
* Create a configuration backup of all nodes, save them as text files: `show running configuration`
* Obtain a backup of the Cisco ISE configuration and operational data: `Administration > Maintenance > Backup and Restore`
* Backup System Logs from the Primary Administration Node: `backup-logs backup-name repository repository-name encryption-key { hash | plain } encryption-key name`
* Export all local certificates with keys for each node: `Administration > Certificates > Certificate Management > System Certificates`
* Record certificate configuration
* Export all Trusted Certificates on the PAN, record certificate configuration: `Administration > Certificate Management > Certificates > Trusted Certificates`

### PRE-CHECKS / VALIDATION

* Create TAC case in advance and assign an engineer
* Download URT: `http://software.cisco.com/download/home/283801620/type/283802505/release/3.4.0`
* Lunch it on a Secondary Admin Node: `application install ise-urtbundle-3.4.0.<build#>-1.0.0.SPA.x86_64.tar.gz reponame`
* Verify that all checks passed, if something is wrong, correct all the issues
* Do the Health Checks: `Administration > System > Health checks`
* Purge endpoints database and operational data just before the upgrade, if data is sent to SIEM it is `safe to remove` all data, the less data is stored, the quicker upgrade will be: `Administration > Identity Management >Settings > Endpoint Purge`, `Administration > System > Maintenance > Operational Data Purging`
* Check all certificates validity in:

```
Administration > Certificate Management > Certificates > System Certificates
Administration > Certificates > Certificate Management >  Trusted Certificates
Administration > Certificates > Certificate Authority > Certificate Authority Certificates
```

* If there are expired certificates, export them and then delete
* Disable Scheduled Backups and Automatic Failover

```
Administration > Backup and Restore 
Administration  > System > Deployment > PAN failover
```

* Assign AD engineer in advance, to join AD after upgrade, if it will be required
* Download upgrade bundle and patch 6 in advance

```
Upgrade bundle for upgrading ISE version 3.1, 3.2, 3.3 to 3.4. 
ise-upgradebundle-3.1.x-3.3.x-to-3.4.0.608b.SPA.x86_64.tar.gz
Cisco Identity Services Engine Software Patch Version 3.4.0.608-Patch6-26042117
ise-patchbundle-3.4.0.608-Patch6-26042117.SPA.x86_64.tar.gz
```

* Upload it to repository in advance
* Verify that repository is accessible from all nodes: `show repository repo_name`
* Verify console access to all VMs
* Verify VM resources: 24 CPU, 600 GB, 96 GB RAM
* On all nodes in advance run command: `application upgrade prepare ise-upgradebundle-3.1.x-3.3.x-to-3.4.0.608b.SPA.x86_64.tar.gz repo_name`
* So image is dowloaded in advance or it takes too much time

### IMPLEMENTATION

Sequence:

* Wave 1: Upgrade Secondary PAN (DC2) - it becomes PAN for new deployment - it disappears from old deployment completely
  * Check Smart Licensing - in a new deployment
  * Test connection to AD in a new deployment
* Wave 2: Upgrade Secondary MnT in DC2 - it becomes secondary MnT for new deployment
  * Make upgraded secondary MnT primary MnT for new deployment in PAN GUI
  * Drain from F5: PSNs Radius 1 DC1, Radius 1 DC2, Tacacs DC2 - use `force offline` - not disable, or it will keep accepting sessions and keep advertising VS route, kill all connections manually, monitor connections on F5 just in case
* Wave 3: Upgrade PSNs Radius 1 DC1, Radius 1 DC2, Tacacs DC2
  * Check in Deployment status that upgraded PSNs are in sync
  * Test connection to AD
  * Enable back on F5 PSNs Radius 1 DC1, Radius 1 DC2, Tacacs DC2
  * Drain from F5: Radius 2 DC1, Radius 2 DC2, Tacacs DC1 - Force offline, kill connections manually, monitor connections
  * Test Wi-Fi, VPN, Tacacs
* Wave 4: Upgrade PSNs Radius 2 DC1, Radius 2 DC2, Tacacs DC1
  * Check in Deployment status that upgraded PSNs are in sync
  * Test connection to AD
  * Enable back on F5 Radius 2 DC1, Radius 2 DC2, Tacacs DC1
  * Test Wi-Fi, VPN, Tacacs
  * Make primary PAN in old deployment a secondary MNT in addition, or last MNT in old deployment will not upgrade
* Wave 5: Upgrade MnT in DC1
* Wave 6: Upgrade Primary PAN (DC1)
  * Make PAN DC1 primary PAN
  * Make MnT DC1 Primary MnT
  * Test deployment status
  * Test connection to AD
  * Final test Wi-Fi, VPN, Tacacs

Upgrade process - the same for all nodes

```
application upgrade prepare ise-upgradebundle-3.1.x-3.3.x-to-3.4.0.608b.SPA.x86_64.tar.gz P5sec01 - should be done in advance to save time
application upgrade proceed
show application status ISE
show version
Administration > System > Health checks
```

Tests

* Connect MAC to WI-FI in Campus
* Connect Windows laptop to Wi-Fi in Campus
* Connect Windows Laptop and Tablets to Wi-Fi in Distribution centers
* Connect to VPN
* Connect to Cisco switch via SSH
* Check logs

Test the AD: `Administration > Identity Management > External Identity Sources > Active Directory`

Install patch

Sequence

* Wave 1: Primary PAN in DC1
* Wave 2: Primary MnT in DC1, Radius node 1 in DC1, Tacacs node in DC1, Seconday PAN in DC2, Radius node 1 in DC2
* Wave 3: Radius node 2 in DC1, Secondary MnT node in DC2, Radius node 2 in DC2, Tcacs node in DC2

Install patch 6 command: `patch install ise-patchbundle-3.4.0.608-Patch6-26042117.SPA.x86_64.tar.gz repo_name`

After each wave perform checks:

```
show application status ISE
show version
Administration > System > Health checks
```

Enable scheduled backups back: `Administration > System > Backup and Restore`

### BACKOUT

* Install previous version to VM
* The process is essentially the same as building a brand-new ISE node
* Deploy a new ISE OVA matching the rollback version or Reimage Existing VM from ISO
* Install required patch
* Configure Repository
* Upload backups: `application restore ISE_CONFIG repository <repo>`
