pxGrid Setup Guide
Overview
pxGrid requires mutual TLS authentication. This guide covers certificate generation, client registration, and service subscription.
Prerequisites
-
ISE 2.4+ with pxGrid enabled
-
CA certificate trusted by ISE (e.g., Vault PKI)
-
OpenSSL or similar for certificate generation
Step 1: Generate Client Certificate
Using Vault PKI
# Generate pxGrid client certificate
vault write -format=json pki_int/issue/pxgrid-client \
common_name="pxgrid-netapi" \
ttl="8760h" > /tmp/pxgrid-cert.json
# Extract certificate and key
jq -r '.data.certificate' /tmp/pxgrid-cert.json > ~/.pxgrid/client.pem
jq -r '.data.private_key' /tmp/pxgrid-cert.json > ~/.pxgrid/client.key
jq -r '.data.ca_chain[]' /tmp/pxgrid-cert.json > ~/.pxgrid/ca-chain.pem
# Set permissions
chmod 600 ~/.pxgrid/client.key
Using OpenSSL
# Generate key
openssl genrsa -out ~/.pxgrid/client.key 2048
# Generate CSR
openssl req -new -key ~/.pxgrid/client.key \
-out ~/.pxgrid/client.csr \
-subj "/CN=pxgrid-netapi/O=Domus Digitalis"
# Sign with your CA
openssl x509 -req -in ~/.pxgrid/client.csr \
-CA ca.pem -CAkey ca.key -CAcreateserial \
-out ~/.pxgrid/client.pem -days 365
Step 2: Import CA into ISE
ISE must trust your client certificate’s CA.
-
ISE Admin > Administration > System > Certificates > Trusted Certificates
-
Import your CA certificate
-
Enable for "Trust for client authentication and pxGrid"
# Verify via API
curl -sk -u "${ISE_AUTH}" \
"https://${ISE_PAN_IP}:9060/ers/config/certificate?filter=name.CONTAINS.pxgrid" \
-H "Accept: application/json"
Step 3: Enable pxGrid in ISE
-
ISE Admin > Administration > pxGrid Services > Settings
-
Enable pxGrid
-
(Optional) Enable automatic approval for new clients
Step 4: Register Client
Activate Account
PXGRID_CERT="$HOME/.pxgrid/client.pem"
PXGRID_KEY="$HOME/.pxgrid/client.key"
curl -sk --cert "${PXGRID_CERT}" --key "${PXGRID_KEY}" \
"https://${ISE_PAN_IP}:8910/pxgrid/control/AccountActivate" \
-H "Content-Type: application/json" \
-d '{}'
Response:
{
"accountState": "ENABLED",
"version": "2.0.0.13"
}
If accountState is PENDING, approve in ISE Admin UI.
Step 5: Lookup Services
# List all available services
curl -sk --cert "${PXGRID_CERT}" --key "${PXGRID_KEY}" \
"https://${ISE_PAN_IP}:8910/pxgrid/control/ServiceLookup" \
-H "Content-Type: application/json" \
-d '{"name": ""}' | jq '.services[].name'
Common services:
| Service | Description |
|---|---|
com.cisco.ise.session |
Session directory (sessions, SGT) |
com.cisco.ise.config.anc |
Adaptive Network Control |
com.cisco.ise.trustsec |
TrustSec SGT/SXP data |
com.cisco.ise.radius |
RADIUS failure events |
com.cisco.ise.system |
System health events |
Step 6: Get WebSocket Credentials
Get Pub/Sub Node
SERVICE_RESPONSE=$(curl -sk --cert "${PXGRID_CERT}" --key "${PXGRID_KEY}" \
"https://${ISE_PAN_IP}:8910/pxgrid/control/ServiceLookup" \
-H "Content-Type: application/json" \
-d '{"name": "com.cisco.ise.session"}')
PUBSUB_NODE=$(echo "$SERVICE_RESPONSE" | jq -r '.services[0].properties.wsPubsubService')
NODE_NAME=$(echo "$SERVICE_RESPONSE" | jq -r '.services[0].nodeName')
echo "Pub/Sub Node: $PUBSUB_NODE"
echo "Node Name: $NODE_NAME"
Step 7: Subscribe to Events
Using Python
import websocket
import ssl
import json
import base64
PUBSUB_URL = "wss://ise-01:8910/pxgrid/ise/pubsub"
CERT_FILE = "/home/user/.pxgrid/client.pem"
KEY_FILE = "/home/user/.pxgrid/client.key"
NODE_NAME = "pxgrid-netapi"
SECRET = "your-access-secret"
# Create auth header
auth = base64.b64encode(f"{NODE_NAME}:{SECRET}".encode()).decode()
ws = websocket.create_connection(
PUBSUB_URL,
sslopt={
"cert_reqs": ssl.CERT_REQUIRED,
"certfile": CERT_FILE,
"keyfile": KEY_FILE,
},
header=[f"Authorization: Basic {auth}"]
)
# Subscribe to session topic
subscribe_msg = {
"type": "SUBSCRIBE",
"subscriptionId": "session-sub-1",
"serviceName": "com.cisco.ise.session",
"topic": "/topic/com.cisco.ise.session"
}
ws.send(json.dumps(subscribe_msg))
# Receive events
while True:
result = ws.recv()
print(json.loads(result))
Troubleshooting
Certificate Not Trusted
# Verify cert chain
openssl verify -CAfile ~/.pxgrid/ca-chain.pem ~/.pxgrid/client.pem
# Check ISE trusted certs
curl -sk -u "${ISE_AUTH}" \
"https://${ISE_PAN_IP}/api/v1/certs/trusted-certificate" \
-H "Accept: application/json" | jq '.response[].friendlyName'