> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec-openapi-7.md).

# The path scheme is supports unencrypted HTTP connections misconfiguration detected in code

## Rule Details

|                        |                        |
| ---------------------- | ---------------------- |
| Cortex AppSec Rule ID  | APPSEC\_OPENAPI\_7     |
| Category - Subcategory | Public Exposure - APIs |
| Provider               | OTHER                  |
| Severity               | HIGH                   |
| Framework              | OpenAPI                |

## Impact

This rule is checking to ensure that the path scheme of the application programming interface (API) does not support unencrypted HTTP connections. An unencrypted HTTP connection means that all data transmitted between the user and the website is sent in plaintext, which can be easily intercepted and read by third parties. This presents a significant security risk as sensitive data like personal information, passwords, credit card details, etc., could be exposed and exploited. Thus, it's extremely important to use encrypted connections, like HTTPS, to secure data in transit and protect against possible attacks.

## How to Fix

**OpenAPI**

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'.

```yaml
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.
```

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec-openapi-7.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
