Skip to content

Commit eeaf3e4

Browse files
committed
fix: add global security definition to OpenAPI spec (Checkov CKV_OPENAPI_4/5)
Add top-level `security` field to swagger.json and swagger.yaml referencing both `ApiKeyAuth` and `OIDCAuth`, making the default auth posture explicit. Override with empty `security: []` on the intentionally unauthenticated `/healthz` and `/readyz` probe endpoints. https://claude.ai/code/session_019MwPKHBP2JU8AZN1roUhQQ
1 parent 201a67b commit eeaf3e4

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

packages/engine/internal/server/docs/swagger.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@
622622
"system"
623623
],
624624
"summary": "Liveness probe",
625+
"security": [],
625626
"responses": {
626627
"200": {
627628
"description": "OK",
@@ -641,6 +642,7 @@
641642
"system"
642643
],
643644
"summary": "Readiness probe",
645+
"security": [],
644646
"responses": {
645647
"200": {
646648
"description": "OK",
@@ -1040,5 +1042,9 @@
10401042
"name": "Authorization",
10411043
"in": "header"
10421044
}
1043-
}
1045+
},
1046+
"security": [
1047+
{"ApiKeyAuth": []},
1048+
{"OIDCAuth": []}
1049+
]
10441050
}

packages/engine/internal/server/docs/swagger.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ paths:
633633
description: OK
634634
schema:
635635
$ref: '#/definitions/server.HealthResponse'
636+
security: []
636637
summary: Liveness probe
637638
tags:
638639
- system
@@ -647,9 +648,13 @@ paths:
647648
description: Service Unavailable
648649
schema:
649650
$ref: '#/definitions/server.ReadyzResponse'
651+
security: []
650652
summary: Readiness probe
651653
tags:
652654
- system
655+
security:
656+
- ApiKeyAuth: []
657+
- OIDCAuth: []
653658
securityDefinitions:
654659
ApiKeyAuth:
655660
description: 'Bearer API key. Format: "Bearer mk_..."'

0 commit comments

Comments
 (0)