Proposal for OpenAPI Extension: x-sensitive-data #4330
cristigirbovan
started this conversation in
Enhancements
Replies: 1 comment
-
This seems reasonable to me. As proposed, I don't think this would be documented in the OpenAPI spec but rather in the OAI extensions registry. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
This proposal introduces a standardized way to define sensitive data fields in OpenAPI specifications using the x-sensitive-data extension. By integrating this directly into API contracts, we enable automatic data masking, hashing, and redaction across various API tools, including logging systems, API gateways, and security scanners.
Problem Statement
Currently, OpenAPI lacks a standard way to identify and handle sensitive fields such as passwords, personal identifiable information (PII), or financial data. API providers must manually implement security policies, leading to inconsistencies and potential security gaps. This proposal addresses:
We introduce x-sensitive-data as an optional extension for OpenAPI Schema Objects. This extension allows defining sensitive fields, specifying masking strategies, and enabling annotation-based processing where applicable.
3.1 Example OpenAPI Usage
4.1 Masking Strategies - examples
Strategy Description
4.2 How It Works in API Tools
For languages like Java, TypeScript, and Python, we propose introducing standardized annotations that can be mapped to OpenAPI x-sensitive-data fields. Example:
Frameworks (Spring, FastAPI, Express) can use these annotations to automatically generate OpenAPI definitions with x-sensitive-data fields.
Beta Was this translation helpful? Give feedback.
All reactions