breakfixlearn.com

SCOR 350-701 v2.0Domain 2 Network Security · topics 2.7

Secure Network Management: SNMPv3, NETCONF, RESTCONF, NTP & Syslog

Every management protocol has an insecure past and a secure replacement: SNMPv3 authPriv, NETCONF and RESTCONF over SSH and HTTPS, authenticated NTP and syslog over TLS. How each works, how to configure it on IOS XE, and how to read its failures.

Exam topics in this module

  • 2.7Configure secure network management of perimeter security and infrastructure devices such as SNMPv3, NetConf, RestConf, APIs, secure syslog, and NTP with authentication

Also touches 2.2 2.5 2.6

hands-on labSNMPv3 Lab: authPriv, snmpwalk and snmpsetBuild SNMPv3 authPriv on IOS XE, walk the router from Linux, then rename it with one snmpset · 45 to 60 min hands-on labNETCONF and RESTCONF Lab: YANG Data with curl and PythonTurn on RESTCONF and NETCONF, check the YANG processes, then read the router with curl, requests and ncclient · 45 to 60 min hands-on labAuthenticated NTP Lab: HMAC-SHA-256 Between Two RoutersMake one router an authenticated NTP server and watch the other go from stratum 16 to synchronized · 30 to 45 min
show ip route | toc (9 sections)
  1. How to think about management protocols
  2. SNMPv3
  3. NETCONF, RESTCONF and YANG
  4. APIs on security devices
  5. NTP with authentication
  6. Secure syslog
  7. A hardened management plane, end to end
  8. Quick reference
  9. Labs for this module

How to think about management protocols

Every device has three planes. The data plane forwards user traffic, the control plane builds the tables (OSPF, BGP, STP), and the management plane is how people and tools reach and run the device. The AAA notes covered who may log in. This topic covers everything else that talks to the management plane: monitoring, automation, time and logs.

The old versions of these protocols were built for trusted networks. They send data in cleartext and trust whoever answers:

Old wayWhat an attacker on the path can do
SNMPv1 / v2c with community stringsRead the "password" from one packet, then read, or with read-write, change the device
CLI screen-scraping over TelnetCapture credentials and every command
Unauthenticated NTPPretend to be the time server and move the clock, which breaks certificates and log correlation
Syslog over UDP 514Read logs in transit, forge log entries, or simply drop them

Each secure replacement adds the same three properties to management traffic:

  • Confidentiality: encryption, so a sniffer sees nothing useful.
  • Integrity: a keyed hash or TLS, so tampering is detected.
  • Authentication: proof of who is talking, in one or both directions.

Then two habits on top: restrict who can reach it (ACLs, out-of-band management) and give it trusted time (authenticated NTP), because logs and certificates are only as good as the clock.

Secure management at a glance: SNMPv1/v2c to SNMPv3 authPriv on UDP 161/162, CLI scraping to NETCONF on SSH 830 and RESTCONF on HTTPS 443, open NTP to authenticated NTP on UDP 123, and syslog on UDP 514 to syslog over TLS on TCP 6514
Secure management at a glance: SNMPv1/v2c to SNMPv3 authPriv on UDP 161/162, CLI scraping to NETCONF on SSH 830 and RESTCONF on HTTPS 443, open NTP to authenticated NTP on UDP 123, and syslog on UDP 514 to syslog over TLS on TCP 6514. Select the image to open it full size.
ProtocolJobInsecure → securePort
SNMPv3Monitor and change device statev1/v2c community strings → v3 users with authPrivUDP 161 (polls), 162 (traps, informs)
NETCONFModel-driven configurationCLI scraping → structured YANG data over SSHTCP 830
RESTCONFModel-driven configuration over HTTP→ structured YANG data over HTTPSTCP 443
NTP with authenticationTrusted, synchronized timeOpen NTP → keyed HMAC on every packetUDP 123
Secure syslogShip logs to a collectorUDP 514 cleartext → syslog over TLSTCP 6514

SNMPv3

SNMP in 90 seconds

SNMP (Simple Network Management Protocol) is how a monitoring system reads data from network devices, and optionally changes settings on them.

  • Manager (NMS): the monitoring station that asks the questions.
  • Agent: the SNMP process on the managed device that answers.
  • Ports: the agent listens on UDP 161 for polls. The manager listens on UDP 162 for notifications (traps and informs).

The data lives in the MIB (Management Information Base), a hierarchical tree of managed objects. Each object has an OID (object identifier), a dotted path to one spot in the tree:

1          iso
1.3        org
1.3.6      dod
1.3.6.1    internet
1.3.6.1.2  mgmt
1.3.6.1.2.1        mib-2
1.3.6.1.2.1.1      system
1.3.6.1.2.1.1.1.0  sysDescr   text description of the device
1.3.6.1.2.1.1.5.0  sysName    the device hostname

A MIB is the collection; an OID is one leaf in it. The trailing .0 marks a single-value (scalar) object.

Operations: Get (one object), GetNext (the next object, which is how a walk steps through the tree), GetBulk (many at once, v2c and later), Set (change a value: the dangerous one), Response, and Trap / Inform (device-initiated alerts).

NotificationDeliveryTrade-off
TrapFire and forget, no acknowledgementCheap, but can be lost
InformAcknowledged and retransmittedReliable, costs more memory and traffic

Why only SNMPv3 belongs in production

VersionIdentityConfidentialityIntegrityVerdict
v1Community stringNone: cleartextNoneObsolete
v2cCommunity stringNone: cleartextNoneAdds GetBulk and informs, still cleartext
v3Username (USM)AES (or DES / 3DES)HMAC + replay protectionThe only secure choice

With v1 and v2c, the community string travels in the clear. One captured packet, or a guess of the defaults public and private, gives an attacker SNMP access. SNMPv3 replaces that with two models:

  • USM, the User-based Security Model: who you are, and the cryptography protecting your messages (authentication and privacy keys).
  • VACM, the View-based Access Control Model: what you may see or change (views bound to groups).

SNMPv3 security levels

LevelAuthenticationEncryptionIOS keywordUse it when
noAuthNoPrivUsername onlyNonenoauthPractically never
authNoPrivHMAC-MD5 or SHANoneauthIntegrity matters, secrecy doesn't
authPrivHMAC-MD5 or SHAAES (128/192/256), DES or 3DESprivAlways, in production
  • Authentication is a keyed hash (HMAC). It proves the message came from a real user and wasn't altered.
  • Privacy encrypts the payload, so a sniffer sees ciphertext.
  • Prefer SHA over MD5 and AES over DES. Newer IOS XE releases also offer SHA-2 authentication and AES-256; check snmp-server user ? on your release.
  • Passphrases need at least 8 characters (an SNMPv3 rule enforced by Net-SNMP tools).

How the pieces connect

SNMPv3 configuration is four objects in a chain. A user belongs to a group, a group points at views, and an ACL limits which hosts may talk at all.

SNMPv3 building blocks: an ACL limits which hosts may connect, a view selects the MIB subtree, a group sets the minimum security level and the read and write views, and a user holds the authentication and privacy keys
SNMPv3 building blocks: an ACL limits which hosts may connect, a view selects the MIB subtree, a group sets the minimum security level and the read and write views, and a user holds the authentication and privacy keys. Select the image to open it full size.
ObjectCommandAnswers the question
ACLip access-list standardWhich NMS source IPs may speak SNMP at all?
Viewsnmp-server viewWhich part of the MIB tree is visible? (included / excluded subtrees)
Groupsnmp-server groupWhat minimum security level, which read and write views, from which hosts?
Usersnmp-server userWho is this, which group are they in, and what are their keys?

Two more ideas the exam likes:

  • Engine ID. Every SNMPv3 agent has a unique engine ID. Passphrases are localized: hashed together with the engine ID to make the real keys. If the engine ID changes, existing users stop working and must be recreated. show snmp user prints the engine ID for that reason.
  • The group sets the minimum level. A group created with priv requires authPriv. A client that asks for authNoPriv is refused.

The configuration

! 1. Only the monitoring host may speak SNMP
ip access-list standard SNMP-SERVERS
 remark NMS
 permit 10.0.0.5
!
! 2. Views: what each group can see (iso = OID 1, the whole tree)
snmp-server view SNMP-V3-RO-VIEW iso included
snmp-server view SNMP-V3-RW-VIEW iso included
!
! 3. Groups: SNMPv3, minimum authPriv, views and ACL
snmp-server group SNMP-V3-RO v3 priv read SNMP-V3-RO-VIEW access SNMP-SERVERS
snmp-server group SNMP-V3-RW v3 priv read SNMP-V3-RW-VIEW write SNMP-V3-RW-VIEW access SNMP-SERVERS
!
! 4. Users: SHA authentication, AES-128 privacy, tied to a group
snmp-server user ROSNMPUSER SNMP-V3-RO v3 auth sha <auth-pass> priv aes 128 <priv-pass> access SNMP-SERVERS
snmp-server user RWSNMPUSER SNMP-V3-RW v3 auth sha <auth-pass> priv aes 128 <priv-pass> access SNMP-SERVERS
  • iso included exposes the whole MIB. It's convenient in a lab and too broad in production: scope views to what the NMS needs (for example system and interfaces).
  • v3 priv on the group makes authPriv the minimum.
  • A group that must read and write needs both read <view> and write <view>.
  • The access keyword on both the group and the user layers the host ACL on top of the keys.

IOS XE behavior that confuses people: show snmp user, show snmp group and show snmp view return %SNMP agent not enabled until the first user (or v1/v2c community) exists. Views and groups alone don't start the agent. Verify them from show running-config | include snmp-server until then.

Verify on the device:

CommandWhat it proves
show snmp userEach user's authentication protocol (SHA), privacy protocol (AES128), group, ACL and the engine ID
show snmp groupSecurity model v3, the level, and the read / write views
show snmp viewThe views cover the subtrees you meant
show snmpPacket counters that move when the NMS polls
show snmp engineIDThe local engine ID the keys are localized to

From the monitoring host (Net-SNMP):

snmpwalk -v3 -l authPriv -u ROSNMPUSER -a SHA -A <auth-pass> -x AES -X <priv-pass> 10.0.0.1 1.3.6.1.2.1.1.5
snmpget  -v3 -l authPriv -u ROSNMPUSER -a SHA -A <auth-pass> -x AES -X <priv-pass> 10.0.0.1 1.3.6.1.2.1.1.5.0
snmpset  -v3 -l authPriv -u RWSNMPUSER -a SHA -A <auth-pass> -x AES -X <priv-pass> 10.0.0.1 1.3.6.1.2.1.1.5.0 s NEW-NAME
FlagMeaning
-v3SNMP version 3
-l authPrivSecurity level; must meet the group's minimum
-uUsername
-a SHA / -AAuthentication protocol / passphrase
-x AES / -XPrivacy protocol / passphrase

Reading SNMPv3 failures

Symptom on the NMSLikely cause
Authentication failure (incorrect password, community or key)Wrong authentication passphrase or protocol
Timeout: No ResponseWrong privacy passphrase, the source isn't permitted by the ACL (ACL denies are silent), or no SNMPv3 user matches
Error about an unsupported security levelThe request's level is below the group's minimum (e.g. authNoPriv against a priv group)
notWritable / noAccess on snmpsetThe user's group has no write view, often because the user was created in the read-only group
Everything worked, then all users failThe engine ID changed; recreate the users

show snmp user is the fastest sanity check: it shows the protocols and, most importantly, the group each user is in.

SNMP as an attack surface

WeaknessWhy it's dangerousHardening
v1 / v2c communitiesCleartext; defaults guessed instantlyRemove every snmp-server community; v3 authPriv only
Read-write accessAn attacker can change settings, shut interfaces, or copy the configuration off the device with SNMP-triggered file transfersAvoid RW unless a tool needs it; separate, tightly scoped RW users
Over-broad viewsiso included exposes the entire MIB, including information useful for reconnaissanceViews limited to the OIDs the NMS polls
No host restrictionAny source can try passwordsaccess <ACL> on groups and users; filter UDP 161 at the edge
Weak or shared keysOne leak compromises many devicesLong, unique passphrases per role; SHA and AES

SNMPv3: exam traps

  • Agent UDP 161, notifications UDP 162.
  • v3 adds authentication, encryption, integrity and replay protection. v2c adds GetBulk and informs but is still cleartext.
  • Levels: noAuthNoPriv < authNoPriv < authPriv. The group sets the minimum.
  • Order of objects: view → group → user, with an ACL limiting hosts.
  • USM = users and crypto. VACM = views and access.
  • Keys are localized to the engine ID; change it and users must be rebuilt.
  • Trap = unacknowledged. Inform = acknowledged.

NETCONF, RESTCONF and YANG

From screen-scraping to model-driven management

For decades, "automating" a router meant a script that logged in, typed CLI commands and tried to parse the text that came back. One changed word in the output broke the script. Model-driven programmability replaces that: the device exposes its configuration and state as structured data, defined by a formal YANG model, which a program can read and write reliably.

YANG (RFC 7950) is a data modeling language, a schema that defines the structure, data types and constraints of configuration and state. YANG is the "what". NETCONF and RESTCONF are the "how".

Model familyExampleTrait
Standardietf-interfaces, OpenConfig (openconfig-*)Vendor-neutral: the same automation works across vendors, but covers fewer features
NativeCisco-IOS-XE-nativeDevice-specific: exposes every IOS XE feature, but only on Cisco

NETCONF

  • RFC 6241, over SSH on TCP 830 (an SSH subsystem, separate from the CLI on port 22).
  • Encoding: XML.
  • Operations are RPCs in a persistent session: <get>, <get-config>, <edit-config>, <copy-config>, <delete-config>, <lock> / <unlock>, and with the candidate datastore <validate> and <commit>.
  • Datastores: running, startup and candidate. Stage a whole change in the candidate, validate it, then commit it in one step or discard it. That transaction is NETCONF's main advantage. (On IOS XE the candidate datastore is turned on with netconf-yang feature candidate-datastore.)
  • Every session starts with a <hello> in which the device lists its capabilities: every protocol feature and YANG module it supports.

RESTCONF

  • RFC 8040, over HTTPS on TCP 443, so it needs the device's secure HTTP server.
  • Encoding: JSON or XML, chosen with the Accept and Content-Type headers (application/yang-data+json or application/yang-data+xml).
  • Stateless: each request stands alone, with no session, lock or commit.
  • URLs follow the model: https://<device>/restconf/data/<module>:<container>, for example /restconf/data/ietf-interfaces:interfaces.
HTTP methodActionCLI analogy
GETRead configuration or stateshow
POSTCreate a new resourceadd
PUTCreate or replace a resourceoverwrite
PATCHMerge changes into a resourcechange part of it
DELETERemove a resourceno ...

NETCONF vs. RESTCONF

NETCONF vs. RESTCONF as two stacks over the same YANG models: NETCONF uses RPCs, XML and SSH on port 830 with transactions; RESTCONF uses HTTP methods, JSON or XML and HTTPS on port 443, stateless
NETCONF vs. RESTCONF as two stacks over the same YANG models: NETCONF uses RPCs, XML and SSH on port 830 with transactions; RESTCONF uses HTTP methods, JSON or XML and HTTPS on port 443, stateless. Select the image to open it full size.
NETCONFRESTCONF
RFC62418040
Transport and portSSH, TCP 830HTTPS, TCP 443
EncodingXMLJSON or XML
OperationsRPCs (<get-config>, <edit-config>, <commit>)HTTP methods (GET, POST, PUT, PATCH, DELETE)
Datastoresrunning, candidate, startupRunning (no candidate or commit)
Transactions and lockingYesNo
SessionPersistent, statefulStateless, per request
Data modelYANGYANG
Enable on IOS XEnetconf-yangip http secure-server + restconf
Best forBulk, transactional automationQuick reads and changes, web integration

Memory hook: NETCONF = SSH / 830 / XML / transactions. RESTCONF = HTTPS / 443 / JSON / HTTP methods.

Enabling them on IOS XE

! RESTCONF needs the HTTPS server
ip http secure-server
restconf
!
! NETCONF rides SSH: no HTTP server needed
netconf-yang

Exam trap: NETCONF does not need ip http secure-server. It runs over SSH on port 830. Only RESTCONF needs the HTTPS server.

Prerequisites: SSH must already work (hostname, domain name, RSA keys, a user, transport input ssh). RESTCONF authenticates against the HTTP server's method (ip http authentication local, or AAA), and the account needs privilege 15.

Verify:

CommandWhat it proves
show platform software yang-management processThe back-end processes are Running: nginx (RESTCONF's HTTPS front end), ncsshd (NETCONF over SSH), confd, pubd and others
show ip http server statusThe secure server is enabled on 443, with its TLS versions, ciphers and trustpoint
show netconf-yang sessionsActive NETCONF sessions: transport, username, source host
show netconf-yang datastoresWhich datastores exist and whether any is locked

Why scripts fail right after you enable it. The YANG processes take a minute or two to start. Until nginx and confd are Running, RESTCONF answers with an HTML error page instead of JSON, and a Python script that calls response.json() fails with JSONDecodeError: Expecting value: line 1 column 1 (char 0). That's a readiness problem, not a code bug. Check show platform software yang-management process, and in scripts print the status code and the start of the response before parsing.

Securing the programmability interfaces

Programmability is another door into the management plane, and a powerful one: a write to the native model can change anything.

WeaknessWhy it mattersHardening
Plain HTTP server enabledCredentials and data in cleartext on port 80no ip http server; keep only ip http secure-server
Old TLS versionsTLS 1.0 / 1.1 are deprecatedip http tls-version TLSv1.2 (or later)
Self-signed certificate, clients skipping checks (curl -k, verify=False)A man-in-the-middle can impersonate the deviceInstall a CA-signed certificate (ip http secure-trustpoint) and validate it in clients
Reachable from anywhereAnyone routable can try passwords on 443 and 830ip http access-class ipv4 <ACL>, VTY ACLs, out-of-band management
Over-privileged API accountsAn automation account can rewrite the whole configDedicated accounts, AAA authorization and accounting to a SIEM

APIs on security devices

The blueprint also says APIs. Beyond NETCONF and RESTCONF on IOS XE, Cisco's security products expose REST APIs over HTTPS:

ProductAPIHow it authenticates
Firewall Management Center (FMC)FMC REST API, with an interactive API Explorer on the FMCA token: POST credentials to the token endpoint, then send the token in the X-auth-access-token header. The token expires after 30 minutes and can be refreshed a limited number of times
Firewall Device Manager (FDM)FDM REST APIOAuth-style access token
Security Cloud ControlCloud REST APIAPI tokens created in the portal
ISEERS and OpenAPI REST APIsHTTPS with a dedicated API account

The same rules apply to every one of them:

  1. HTTPS only, with certificate validation in the client.
  2. Dedicated API accounts with only the permissions the integration needs, never a shared admin login.
  3. Tokens are secrets: short-lived, never hard-coded in scripts or committed to Git; read them from environment variables or a vault.
  4. Restrict the source of API calls to automation hosts.
  5. Log API activity so changes made by tools are as traceable as changes made by people.

NTP with authentication

Why time is a security control

NTP (Network Time Protocol, UDP 123) keeps clocks synchronized. It looks like plumbing, but trusted time underpins security:

  • Log correlation and forensics: during an incident, events from different devices only line up if their clocks agree.
  • Certificates: TLS, IKE and PKI check validity dates. A wrong clock makes a valid certificate look expired, or an expired one look valid.
  • Kerberos and one-time passwords: they tolerate only small clock differences.
  • Time-based ACLs and scheduled jobs fire at the wrong moment.

An attacker who can impersonate your NTP server can shift a device's clock and break all of these without touching the data plane. Authenticated NTP makes the client accept time only from a server that proves itself with a shared key.

Stratum

NTP sources are ranked by stratum:

StratumMeaning
0A reference clock (GPS, atomic); not on the network itself
1Directly attached to a stratum 0 source: the most authoritative on the network
2 to 15Each hop away adds 1
16Unsynchronized: "I have no trusted time"

Lower is more authoritative. A router configured with ntp master 3 serves time from its own clock as stratum 3. A client that syncs to it becomes stratum 4.

How authenticated NTP works

NTP symmetric-key authentication adds a keyed hash (HMAC) to each packet. The server signs its replies; the client checks the signature before it accepts the time.

The direction most people get backwards: in client/server mode, the client authenticates the server. The client is protecting itself from a fake time source. ntp server 10.0.0.2 key 5 means "trust time from 10.0.0.2 only if its packets are signed with trusted key 5".

NTP: a stratum ladder from a reference clock down to the lab's server at stratum 3 and client at stratum 4, and the authenticated exchange where the client checks the server's HMAC before accepting the time
NTP: a stratum ladder from a reference clock down to the lab's server at stratum 3 and client at stratum 4, and the authenticated exchange where the client checks the server's HMAC before accepting the time. Select the image to open it full size.
CommandWhereMeaning
ntp authenticateBothTurn on authentication enforcement
ntp authentication-key <n> <algorithm> <secret>BothDefine key n. Prefer hmac-sha2-256 over md5
ntp trusted-key <n>BothTrust key n; only trusted keys are accepted
ntp server <ip> key <n>ClientUse this server and require key n on its replies

All four are required. Miss one and authentication silently doesn't happen. The key number, algorithm and secret must match exactly on both ends.

Server-only commands: ntp master <stratum> (serve time from the local clock, shown as reference 127.127.1.1) and ntp source <interface> (always source NTP from the same address). In production, the server would itself sync to upstream sources rather than its own clock.

! Server (R2)
ntp master 3
ntp source GigabitEthernet1
ntp authentication-key 5 hmac-sha2-256 <secret>
ntp trusted-key 5
ntp authenticate
!
! Client (R1)
ntp authentication-key 5 hmac-sha2-256 <secret>
ntp trusted-key 5
ntp authenticate
ntp server 10.0.0.2 key 5

Two operational gotchas:

  1. clock set is a privileged EXEC command, not a configuration command. Typed at (config)#, it's rejected.
  2. NTP won't step a clock that's far off. If the offset is larger than about 1000 seconds (NTP's panic threshold), the client refuses to sync. Set the clock roughly right first.

Verify

CommandWhat it proves
show ntp statusClock is synchronized, our stratum and the reference: the go / no-go check
show ntp associationsEach peer, its stratum (st), reach and offset. A leading * means synced to that peer; ~ means configured
show ntp associations detailThe peer is authenticated, with the algorithm in use
show ntp packetsIn and out counts. Out climbing with In at 0 means the server isn't answering
debug ntp allPacket-level detail; SHA256-Match: 1 means the keys matched (0 = mismatch)
  • reach is an octal record of the last 8 polls: 1 means only the latest was answered; 377 means all 8.
  • Sync is deliberately slow: going from stratum 16 to synchronized can take several minutes.
SymptomCauseFix
SHA256-Match: 0, never syncsKey number, algorithm or secret differMake the key identical on both ends
Out climbing, In stays 0Server unreachable, UDP 123 filtered, or the server isn't serving timePing, ACLs, ntp master or upstream sync on the server
Stuck at stratum 16 with matching keysClock too far off, or simply not enough time yetclock set close to the server; wait
Syncs, but isn't authenticatedClient's ntp server is missing key <n>, or ntp authenticate / ntp trusted-key missingAdd the missing piece

Hardening time

WeaknessHardening
Unauthenticated NTPntp authenticate, trusted keys, ntp server ... key everywhere
MD5 keyshmac-sha2-256
Anyone can query or peerntp access-group (peer, serve, serve-only, query-only) and UDP 123 ACLs
NTP exposed to the internetNever serve NTP to untrusted networks; old monlist behavior enabled huge amplification DDoS attacks
A single time sourceSeveral authenticated upstream servers, so a bad one is outvoted (marked a falseticker, x)
Logs in the wrong time zoneservice timestamps log datetime msec localtime show-timezone so log lines carry the zone

Secure syslog

Why plain syslog is a liability

Classic syslog sends messages to a collector over UDP 514, in cleartext, with no authentication:

ProblemConsequence
No encryptionAnyone on the path can read logs, which leak usernames, addresses and topology
No authenticationAn attacker can impersonate the collector, or inject forged log lines to hide activity
UDPMessages are silently dropped under load, exactly when you need the record

Secure syslog runs syslog inside TLS over TCP:

NeedProvided by
ConfidentialityTLS encryption
AuthenticationCertificates, ideally mutual (device and collector both prove identity)
IntegrityTLS
Reliable deliveryTCP

The standards

RFCDefinesPort
RFC 3164Legacy "BSD" syslog formatUDP 514
RFC 5424The modern, structured syslog message format (ISO 8601 timestamps, hostname, app name, structured data)n/a
RFC 5425Syslog over TLSTCP 6514
RFC 6587Syslog over plain TCP (reliable, not encrypted)TCP

One-liner: RFC 5424 is the format; RFC 5425 is the TLS transport on TCP 6514. The exam likes to swap them.

Severity levels

logging trap <level> sets the threshold: the device sends that level and everything more severe (lower number = more severe).

LevelNameExample
0EmergenciesSystem unusable
1AlertsImmediate action needed
2CriticalCritical condition
3ErrorsError condition
4WarningsWarning condition
5NotificationsNormal but significant (interface up/down, config changes)
6InformationalInformational messages
7DebuggingDebug output

Mnemonic: Every Awesome Cisco Engineer Will Need Ice cream Daily. logging trap informational sends levels 0 to 6.

The PKI pieces

TLS needs certificates, so secure syslog touches the router's PKI:

TermWhat it is
TrustpointA named container on the router for a CA certificate and the router's own identity certificate
CA certificateThe certificate of the authority that signed the collector's certificate. Importing it lets the router trust the collector
FingerprintA hash of the CA certificate, pinned in the trustpoint so a fake CA can't be slipped in during import
CSRThe router's certificate signing request. Once the CA signs it, the collector can trust the router
Secure syslog with mutual TLS: the collector's CA certificate is copied to the router and checked against the pinned fingerprint, the router sends a certificate request, the CA signs it, the router imports its certificate, and logs then flow over TLS on TCP 6514
Secure syslog with mutual TLS: the collector's CA certificate is copied to the router and checked against the pinned fingerprint, the router sends a certificate request, the CA signs it, the router imports its certificate, and logs then flow over TLS on TCP 6514. Select the image to open it full size.

Router-side commands

! 1. Trustpoint, with the CA's fingerprint pinned
crypto pki trustpoint SYSLOG-CA
 enrollment url bootflash:
 revocation-check none
 rsakeypair SYSLOG-CA 2048
 subject-name cn=R1-syslog
 fingerprint <CA-fingerprint>
!
! 2. Trust the CA (its certificate copied to bootflash first)
crypto pki authenticate SYSLOG-CA
!
! 3. Request the router's own certificate, have the CA sign it, install it
crypto pki enroll SYSLOG-CA
crypto pki import SYSLOG-CA certificate
!
! 4. Send logs over TLS
logging trap syslog-format rfc5424
logging source-interface GigabitEthernet1
logging tls-profile SYSLOG-TLS
 tls-version TLSv1.2
logging host 10.0.0.5 transport tls profile SYSLOG-TLS
CommandRemember it as
crypto pki authenticateTrust the CA (checked against the fingerprint)
crypto pki enrollRequest my own certificate (creates the CSR)
crypto pki import ... certificateInstall my signed certificate
logging host ... transport tls profile ...Send to this collector over TLS instead of UDP 514

Use the highest TLS version both ends support. On SD-WAN-managed IOS XE routers the same commands are entered with config-transaction and commit instead of configure terminal.

Verify: show crypto pki trustpoint SYSLOG-CA status (CA authenticated, router certificate issued), show crypto pki certificates verbose SYSLOG-CA, and show logging (TLS profile and destination). On the collector, the messages should arrive, and a packet capture on TCP 6514 should show a TLS handshake followed by encrypted records, never readable log text.

SymptomCause
crypto pki authenticate rejects the CAFingerprint doesn't match, or the wrong CA file
TLS handshake fails, no logsThe router has no signed certificate, or the TLS versions don't overlap
"Certificate not yet valid" or "expired"The clock is wrong: fix NTP first
Logs arrive in cleartextA plain logging host (UDP 514) is still configured

Hardening the log pipeline

WeaknessHardening
Cleartext syslogSyslog over TLS (RFC 5425, TCP 6514)
Collector impersonationPin the CA fingerprint; validate the collector's certificate
Forged log entriesMutual TLS: the collector accepts only devices with CA-signed certificates
The collector itselfIt holds every log: harden it, restrict access, forward to a SIEM, back it up
Untrustworthy timestampsAuthenticated NTP and service timestamps log datetime msec localtime show-timezone

A hardened management plane, end to end

Everything in this topic fits on one device. A production-style baseline for an IOS XE router (values are placeholders):

! Time first: everything else depends on it
ntp authentication-key 5 hmac-sha2-256 <ntp-secret>
ntp trusted-key 5
ntp authenticate
ntp server 10.10.99.20 key 5
ntp server 10.10.99.21 key 5
service timestamps log datetime msec localtime show-timezone
!
! SNMPv3 only, scoped view, authPriv, NMS only
no snmp-server community public
ip access-list standard NMS
 permit 10.10.99.30
snmp-server view MON-VIEW system included
snmp-server view MON-VIEW interfaces included
snmp-server group MON v3 priv read MON-VIEW access NMS
snmp-server user nms-poller MON v3 auth sha <auth-pass> priv aes 128 <priv-pass> access NMS
!
! Programmability over HTTPS and SSH only, restricted
no ip http server
ip http secure-server
ip http tls-version TLSv1.2
ip http access-class ipv4 MGMT-HOSTS
ip http authentication local
restconf
netconf-yang
!
! Logs over TLS
logging trap informational
logging source-interface Loopback0
logging tls-profile SYSLOG-TLS
 tls-version TLSv1.2
logging host 10.10.99.40 transport tls profile SYSLOG-TLS

The rule behind every block: encrypt it, authenticate it, restrict who can reach it, and give it trusted time.

Quick reference

ProtocolPortSecure formKey commandsVerify
SNMPv3UDP 161 / 162authPriv (SHA + AES)snmp-server view / group / usershow snmp user
NETCONFTCP 830 (SSH)SSHnetconf-yangshow netconf-yang sessions
RESTCONFTCP 443 (HTTPS)TLSip http secure-server, restconfshow platform software yang-management process
NTPUDP 123HMAC keyntp authenticate, authentication-key, trusted-key, server ... keyshow ntp status, show ntp associations detail
SyslogUDP 514 → TCP 6514TLS (RFC 5425)crypto pki ..., logging host ... transport tlsshow logging
Exam trapAnswer
NETCONF needs the HTTPS server?No: SSH, port 830
RESTCONF encodings?JSON or XML (NETCONF: XML)
Which has transactions (candidate + commit)?NETCONF
SNMPv3 level with encryption?authPriv
What sets the minimum SNMPv3 level?The group
Who authenticates whom in NTP client/server?The client authenticates the server
Stratum 16?Unsynchronized
RFC 5424 vs. 5425?Format vs. TLS transport (TCP 6514)
logging trap warnings sends?Levels 0 to 4

Labs for this module

Three hands-on labs on a real IOS XE router, each built step by step with verify commands and real output:

  1. SNMPv3 lab: ACL, views, groups and authPriv users, then snmpwalk the router from a Linux host and change its hostname with snmpset.
  2. NETCONF and RESTCONF lab: turn on RESTCONF and NETCONF, check the YANG processes, then read interfaces, OSPF and the full config with curl and Python.
  3. Authenticated NTP lab: make one router an authenticated NTP server and another its client, then watch it go from stratum 16 to synchronized.