Validate your Microsoft Defender for APIs alerts

Microsoft Defender for APIs offers full lifecycle protection, detection, and response coverage for APIs that are published in Azure API Management. One of the main capabilities is the ability to detect exploits of the Open Web Application Security Project (OWASP) API Top 10 vulnerabilities through runtime observations of anomalies using machine learning-based and rule-based detections.

This page will walk you through the steps to trigger an alert for one of your API endpoints through Defender for APIs. In this scenario, the alert will be for the detection of a suspicious user agent.

Prerequisites

Simulate an alert

  1. Sign in to the Azure portal.

  2. Search for and select API Management services.

    Screenshot that shows you where on the Azure portal to search for and select API Management service.

  3. Select APIs.

    Screenshot that shows where to select APIs from the menu.

  4. Select an API endpoint.

    Screenshot that shows where to select an API endpoint.

  5. Navigate to the Test tab.

  6. Select Get Retrieve resource (cashed).

  7. In the HTTP request section select the see more button.

    Screenshot that shows you where the see more button is located on the screen.

  8. Select the Copy button.

  9. Navigate and sign in to your Postman account.

  10. Select My Workspace.

  11. Select +.

  12. Enter the HTTPS request information you copied.

    Screenshot that shows you where to enter the URL you copied earlier.

  13. Select the Headers tab

  14. In the key field, enter Ocp-Apim-Subscription-Key.

  15. In the value field enter the key you copied.

  16. In the key field enter User-Agent.

  17. In the value field enter javascript:.

    Screenshot that shows where to enter the keys and their values in Postman.

  18. Select Send

    You will see a 200 OK which will let you know that it succeeded.

    Screenshot that shows the result 200 OK.

After some time, Defenders APIs will trigger an alert with detailed information about the simulated suspicious user agent activity.

Next steps

Learn how to Investigate API findings, recommendations, and alerts.