• In the previous lesson, you saw a Python script that sent a PATCH to R1.
    That script used auth=("admin", "cisco123") and verify=False.

    Let's see what each piece does, and why those lines matter in production.

    What You Already Saw in Your RESTCONF Lab

    Here is the script from the RESTCONF lesson, the one that reads the GigabitEthernet1 configuration:

    import requests
    import urllib3
    urllib3.disable_warnings()
    
    url = "https://192.168.1.1/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=1"
    headers = {
        "Accept": "application/yang-data+json"
    }
    
    response = requests.get(url, headers=headers,
                            auth=("admin", "cisco123"),
                            verify=False)

    Three lines in that script touch security:

    • The https:// URL — your traffic uses an encrypted transport

    • auth=("admin", "cisco123") — your script proves who is calling

    • verify=False — your script skips checking the router's certificate (you should never do that in production)

    REST Is a Convention, Not a Shield

    REST is a set of rules for how a script and a router talk to each other over HTTP.
    It says: GET to read, POST to create, PATCH to modify.

    But REST says nothing about how to protect that conversation.
    REST defines structure, not security. Encryption and authentication are layers added on top of REST.

    Answer the question below

    Does REST itself provide any built-in protection for the data exchanged?

    Three Security Questions for Every Call

    When your script sends an HTTPS request to R1, three questions must be answered before the call is safe:

    Three security questions: Can anyone read it on the way (Confidentiality), Who is calling (Identity), Can they do that action (Authorization)

    Figure 1 – The three security questions

    Each question is answered by one section of this lesson.
    Miss any one of them and the API is exposed to threat.

    Answer the question below

    What single letter on http makes the URL use an encrypted transport?