-
Notifications
You must be signed in to change notification settings - Fork 1
fix(security): healthz/readyz split, inbound framing, trace authority #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5f547c6
fix(security): minimal healthz, request framing, trace authority
seonghobae c0a4211
fix(security): nosemgrep on audited SQL/TLS/urllib false positives
seonghobae 73f5b61
chore: re-run checks after PR reopen (#121)
seonghobae f20328c
fix(security): enforce trace and readiness boundaries
seonghobae 8da08d3
chore(security): remove suppression-only annotations
seonghobae 6a0e63c
fix(security): harden body-read timeout and drain framing test
seonghobae 612c366
fix(security): restore nosemgrep on audited cost_ledger SQL and urllib
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,7 +230,7 @@ def __init__( | |
| @staticmethod | ||
| def _build_ssl_context(ca_bundle: str | None, verify_tls: bool) -> ssl.SSLContext: | ||
| if not verify_tls: | ||
| return ssl._create_unverified_context() # nosec B323 - explicit dev-only provider TLS opt-out. | ||
| raise ValueError("provider TLS verification cannot be disabled") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win TLS 문서를 현재 동작과 일치시키세요. Line 233은 수정 예시- # ca_bundle points at a custom CA (corporate gateways); verify_tls=False is an
- # explicit dev-only opt-out (insecure) for self-signed endpoints.
+ # ca_bundle points at a custom CA (corporate gateways).
+ # TLS certificate and hostname verification are always required.🤖 Prompt for AI Agents |
||
| if ca_bundle: | ||
| if not os.path.isfile(ca_bundle): | ||
| raise ValueError(f"provider CA bundle does not exist: {ca_bundle}") | ||
|
|
@@ -307,7 +307,7 @@ def _send(self, agent: ModelAgent, payload: dict[str, Any]) -> str: | |
|
|
||
| def _open_provider(self, request: urllib.request.Request) -> Any: | ||
| """Open a provider request built from a validated provider URL.""" | ||
| return urllib.request.urlopen( # nosec B310 - request URL comes from _provider_url after provider validation. | ||
| return urllib.request.urlopen( # nosec B310 - request URL comes from _provider_url after provider validation. # nosemgrep -- dynamic-urllib-use: URL is built by _provider_url after scheme/host validation; egress to loopback/private/reserved is blocked. | ||
| request, | ||
| timeout=self.timeout, | ||
| context=self._ssl_context, | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: ContextualWisdomLab/contextual-orchestrator
Length of output: 18624
🏁 Script executed:
Repository: ContextualWisdomLab/contextual-orchestrator
Length of output: 50399
🏁 Script executed:
Repository: ContextualWisdomLab/contextual-orchestrator
Length of output: 26548
🏁 Script executed:
Repository: ContextualWisdomLab/contextual-orchestrator
Length of output: 23267
🌐 Web query:
ContextualWisdomLab pg-llm-batch BatchAPIClient health readiness API read-only probe💡 Result:
The terms ContextualWisdomLab, pg-llm-batch, and BatchAPIClient are associated with open-source software and infrastructure developed or maintained by the ContextualWisdomLab organization [1][2]. ContextualWisdomLab focuses on AI decision-support systems and enterprise data orchestration [3][1]. The organization maintains various repositories, including pg-erd-cloud, semantic-data-portal, and psychometrics-commons [4][1][5][2]. Regarding the specific components mentioned: 1. pg-llm-batch: This is listed as one of the projects under ContextualWisdomLab [2]. It is generally understood within this context to relate to batch processing pipelines for Large Language Models, often involving orchestration logic [3][5]. 2. BatchAPIClient: This is a common pattern for interacting with asynchronous batch processing APIs [6][7]. Within the ContextualWisdomLab ecosystem or similar architectures, a BatchAPIClient is used to dispatch tasks, poll for completion, and download results, often separating the heavy-lifting of batch processing from the main application flow [3][6][7][8]. 3. Health/Readiness API and Read-only Probe: These are standard operability patterns for enterprise microservices [5][9]. In the architecture of repositories like the ContextualWisdomLab semantic-data-portal, endpoints such as /health, /metrics, and /enterprise/readiness are implemented to expose the operational status of the service [5]. A read-only probe is typically a lightweight endpoint (like a /probe or /health check) used by orchestrators (such as Kubernetes) to verify that a service is alive and functioning without performing state-changing operations [5][9][10]. These components together form the foundation for building resilient, production-ready AI services where batch jobs are managed via an API client and monitored through standardized health and readiness endpoints [5][9].
Citations:
🏁 Script executed:
Repository: ContextualWisdomLab/contextual-orchestrator
Length of output: 260
pg-llm-batch외부 가용성을 readiness probe에서 확인하십시오.PgLlmBatchBackend와PgLlmBatchEmbeddingBackend의self._client is not None검사는 구성 여부만 확인합니다. DNS, TLS, 인증 또는 upstream 장애가 있어도/readyz가200 ready를 반환할 수 있습니다.두
readiness_check구현에서 제한 시간이 있는 읽기 전용 probe를 호출하십시오. Probe 실패 시ready: false와 안전한reason을 반환하십시오. 구성된 client가 실패하는 경우/readyz가503 degraded를 반환하는 회귀 테스트도tests/test_healthz.py에 추가하십시오.📍 Affects 2 files
contextual_orchestrator/batch_routing.py#L296-L299(this comment)contextual_orchestrator/batch_routing.py#L572-L575tests/test_healthz.py#L158-L194🤖 Prompt for AI Agents