350-201 exam dumps

350-201 practice question 244 of 289

Cybersecurity Professional - Performing Cybersecurity Using Cisco Security Technologies. Professional level, Cisco. Free question with the correct answer and a full explanation.

350-201 Question 244

Single answer

A cybersecurity analyst is tasked with analyzing a Python script used to automate the retrieval of logs from a Cisco Secure Firewall. Below is a snippet of the script:

import requests

def get_firewall_logs(url, token):
    headers = {
        'Authorization': f'Bearer {token}'
    }
    response = requests.get(url, headers=headers)
    if response.status_code == 200:
        return response.json()
    else:
        return None

firewall_url = 'https://firewall.example.com/api/logs'
api_token = '12345abcde'
logs = get_firewall_logs(firewall_url, api_token)
if logs:
    print('Logs retrieved successfully:', logs)
else:
    print('Failed to retrieve logs')

What is the primary function of the Python script above?

  1. A

    To retrieve logs from a Cisco Secure Firewall using an API.

  2. B

    To analyze and parse logs from a local Cisco Secure Firewall log file.

  3. C

    To send logs from a Cisco Secure Firewall to a remote server.

  4. D

    To configure authentication policies on a Cisco Secure Firewall.

Show answer and explanation

Correct answer: A

Explanation

The Python script uses the 'requests' library to make an API call to a Cisco Secure Firewall endpoint. It retrieves logs by passing an authorization token in the headers and processing the response. The purpose of this script is to automate the retrieval of logs from the firewall, not to analyze, send, or configure anything else.

  • A. Correct.

    Correct. The script retrieves logs from a Cisco Secure Firewall by making an HTTP GET request to the firewall's API endpoint, using an authorization token.

  • B. Incorrect.

    Incorrect. The script does not analyze or parse logs from a local file. Instead, it retrieves logs via an API call.

  • C. Incorrect.

    Incorrect. The script retrieves logs from the firewall but does not send them to a remote server.

  • D. Incorrect.

    Incorrect. The script does not configure authentication policies; its purpose is to retrieve logs from the firewall.

Timed practice exam

Take a 350-201 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam