Agent Configuration using Swagger
GuardMode provides an interactive Swagger (OpenAPI) interface that allows administrators to view available endpoints, inspect request and response formats, and execute API calls directly from a browser. This simplifies the process of testing configuration and integrating GuardMode into automated workflows.
Accessing the Swagger UI​
The Swagger interface is served by the GuardMode Agent on the port 5000 , the same as the API.
Each connection to Swagger requires authorization. This process requires credentials set up during installation:
- Setting up Basic Authentication on Windows
- Setting up Basic Authentication on Linux.
Alternatively, to update your basic authentication credentials, run
./Catalogic.GuardMode.Agent config update basic-authentication --username {username} --password {password}
Authorizing as a Swagger User​
- Open a web browser and navigate to:
http://<GuarMode Agent IP>:5000/swagger
![[image expected here]](/assets/images/swaggger-api_v1-fd241de6e9c295a4c487594fe0f08c17.png)
- Select API v1 from the dropdown in the topbar. API v2 is for backward compatibility only.
- Click the Authorize button and provide the same credentials as in Step 1.
![[image expected here]](/assets/images/swagger-authorization_modal-30410a684e9af40fa248a0a1f515aa47.png)
- Click Authorize, then close the dialog window.
The padlock icons will change to the closed state.
Using Swagger​
Swagger allows you to browse available endpoints, grouped by functionality. You can view requests and response schemas, execute requests and obtain responses directly from the web browser, and generate code snippets for different languages and tools.