4.6 Configure and verify NETCONF and RESTCONF
Router(config)# netconf-yangRouter# show netconf-yang sessions Router# show platform software yang-management processRouter(config)# restconf
5.3 Describe REST API security
HTTPS / TLS
REST APIs should use HTTPS, not plain HTTP.
TLS provides encryption, integrity, and server authentication.
Authentication
- Verifies who the client is.
- Common methods:
- username/password
- API key
- token
- OAuth 2.0 / bearer token
- Cisco APIs often return a token after authentication, which is then included in later requests.
Authorization
Determines what an authenticated user/application is allowed to do.
Think RBAC / least privilege.
Authentication ≠ authorization.
Tokens
Usually sent in an HTTP header, commonly:
Authorization: Bearer <token>
Tokens may expire and need renewal.
Better than repeatedly sending credentials with every request.
Certificates
HTTPS relies on digital certificates.
The client should validate the server certificate to avoid connecting to an impersonated server.
Self-signed certificates may appear in labs but are less trustworthy unless explicitly trusted.
Sensitive data
Do not expose passwords, tokens, API keys, or credentials in:
URLs logs source code public repositories Least privilege
API accounts should receive only the permissions required for their task.
6.1 Interpret basic Python components and scripts
Idk just read it
6.3 Describe the high-level principles and benefits of a data modeling language, such as YANG
Yet Another Next Generation (YANG)= Data models are used
to describe whatever can be configured on a device, everything that can be monitored on a device, and all the administrative actions that can be executed on a device, such as resetting counters or rebooting the device. This includes all the notifications that the device is capable of generating. All these variables can be represented within a YANG model.
list = the name of something with multiple instances/items
key = uniquely name of the item in the list
leaf = single data field
type = allowed data type
enumeration = value must come from predefined choices
config false = read-only/state data, not configurable
Network Configuration Protocol (NETCONF)
NETCONF is an automation protocol that uses YANG data models to describe device configurations
- Runs over SSH, TLS, and not commonly Simple Object Access Protocol (SOAP)
- Uses paths in the data tree to describe resources, instead of OIDs like SNMP
- Either the complete configuration transaction succeeds, or it doesn’t get committed
- NETCONF should reject the configuration rather than leaving you with half of the requested configuration.
NETCONF Operation Description
- <get> Requests running configuration and state information of the device
- <get-config> Requests some or all of the configuration from a datastore
- <edit-config> Edits a configuration datastore by using CRUD operations
- <copy-config> Copies the configuration to another datastore
- <delete-config> Deletes the configuration
Representational State Transfer (REST) CONF RESTCONF
The main difference is how they talk to the device.
Both can manipulate YANG-modeled data, but they use different mechanisms:
NETCONF = sophisticated network-config protocol using SSH/XML.
RESTCONF = simpler web/API-style access to YANG data using HTTPS and JSON/XML.
netconf = RPC, restconf = http
6.7 Compare agent vs agentless orchestration tools
- Puppet
- Puppet server communicates with devices with agents, puppet clients
- Changes and automation tasks are executed in a puppet console
- Then shared with server and puppet agents
- Each Puppet Agent communicates with the Puppet Server on a unique TCP port
- Code is called Manifests
- Server pushes manifests to clients using SSL and require certificates for secure communication between server and clients
- Chef
- Open source config-management tool
- End devices are called clients, not agents
- Written in ruby and ErlangChanges can be pushed to devices
- Those devices can check in with server and pull to see if there is any change in configuration
- Cookbooks and recipes
- Cookbook is a collection of code or files
- Recipe is code for configuration change
- Cookbook is the whole package, recipe is one set of config changes inside that cookbook
- Salt/SaltStack
- Built on Python
- Masters and minions
- Beacons are agents that live on minions,
- Pillars/grains
- Grains = facts about the minion
- Pillars = data provided by the Salt master that the minion should use
- Can be different for each minion








