Skip to content

feat: sanitize sensitive data in spec-renderer [KHCP-20404]#860

Draft
sharmaadityaHQ wants to merge 6 commits into
mainfrom
feat/khcp-20404
Draft

feat: sanitize sensitive data in spec-renderer [KHCP-20404]#860
sharmaadityaHQ wants to merge 6 commits into
mainfrom
feat/khcp-20404

Conversation

@sharmaadityaHQ
Copy link
Copy Markdown
Contributor

@sharmaadityaHQ sharmaadityaHQ commented Apr 27, 2026

Summary

This PR aims to implement mechanisms to sanitize sensitive data in spec-renderer.

Why?

Prevent data leakage, requested by customer (InteliiTrans).

Jira - https://konghq.atlassian.net/browse/KHCP-20404

Consuming app PR - https://github.com/kong-konnect/portal/pull/2333

Demo

Screen.Recording.2026-04-28.at.1.59.32.AM.mov

ValeryG
ValeryG previously approved these changes Apr 27, 2026
export type SensitiveDataMaskType = 'full' | 'regex' | 'hash' | 'remove'

export interface XSensitiveData {
mask: SensitiveDataMaskType
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a comment above the property

}

export interface SecuritySchemeMaskRule {
location: 'header' | 'query' | 'cookie'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a comment above the property

path: '/search',
request: {
query: [
// @ts-ignore
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need descriptions after ts-ignore

@sharmaadityaHQ sharmaadityaHQ marked this pull request as draft April 29, 2026 20:15
@kongponents-bot
Copy link
Copy Markdown
Collaborator

🔴 PR audit failed. 🔴

🔥 Renovate Security PRs detected.

There are 1 open renovate security PRs older than 3 days.

This PR cannot be merged until all renovate security PRs created more than 3 days ago are resolved.

🔥 PNPM Audit issues detected.

┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ fast-uri vulnerable to path traversal via              │
│                     │ percent-encoded dot segments                           │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ fast-uri                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ <=3.1.0                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=3.1.1                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ .>@commitlint/cli>@commitlint/load>@commitlint/config- │
│                     │ validator>ajv>fast-uri                                 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-q3j6-qgpj-74h6      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ fast-uri vulnerable to host confusion via              │
│                     │ percent-encoded authority delimiters                   │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ fast-uri                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ <=3.1.1                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=3.1.2                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ .>@commitlint/cli>@commitlint/load>@commitlint/config- │
│                     │ validator>ajv>fast-uri                                 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-v39h-62p7-jpjc      │
└─────────────────────┴────────────────────────────────────────────────────────┘
2 vulnerabilities found
Severity: 2 high

PR with those issues cannot be merged.

How to resolve:

  • Check open renovate PRs for updates to the dependencies mentioned in the audit report
  • try to update dependencies listed in the audit report to the latest versions
  • use pnpm audit --fix to automatically fix issues

@kongponents-bot
Copy link
Copy Markdown
Collaborator

Install the preview package from this PR

@kong/spec-renderer@pr-860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants