For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

The global security scope is not defined in the securityDefinitions misconfiguration detected in cod

Rule Details

Cortex AppSec Rule ID

APPSEC_OPENAPI_19

Category - Subcategory

Public Exposure - APIs

Provider

OTHER

Severity

MEDIUM

Framework

OpenAPI

Impact

This rule is checking to ensure that a global security scope is defined in the securityDefinitions of 2.0 version files in an OpenAPI framework. This is crucial for API security because failure to define this might mean that APIs may not have a standard security measure throughout their operations, which can leave them vulnerable to attacks. This can lead to unauthorized data access, data manipulation, or other forms of security breaches. Hence, it's important to have consistent security definitions in place to ensure a secure API environment.

How to Fix

To fix the issue, you should ensure that your API supports only HTTPS connections and not HTTP. This can be done by defining the 'schemes' parameter in your OpenAPI definition to only contain 'https'.

The above code is secure as it ensures all data transmitted between the client and server is encrypted. It uses the 'https' scheme for the API, which means all the data to and from the server is sent over an encrypted HTTP connection. This is important as it prevents potential attackers from intercepting or tampering with the data. [source,go]

openapi: 3.0.0 info: title: Sample API description: API description in Markdown. version: 1.0.0 servers:

  • url: https://api.example.com/v1 paths: /users: get: summary: Returns a list of users. description: Optional extended description in Markdown.


Last updated

Was this helpful?