Repository navigation
fix(ingest): inspect unverified OMS bundle contents #795
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
Merged
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
153b8a3
fix(ingest): inspect unverified OMS bundle contents
yashrajp22 7d95757
test(ingest): retain normal findings for unsigned OMS fixtures
yashrajp22 45f5c04
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 2712948
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 88de383
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 14f6a36
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] f0d1d14
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] ac214bf
fix(oms): inspect decoded bundle content without binary false positives
yashrajp22 52d03b3
fix(oms): preserve readable Unicode in binary projections
yashrajp22 6674959
test(oms): assert detection independently of risk thresholds
yashrajp22 24d87bd
test(oms): exercise unknown base64 in SC3 eligible carrier
yashrajp22 6ecc53d
fix(oms): keep escaped duplicate-key bundles explicitly partial
yashrajp22 c43480d
style(test): format OMS regression parameters
yashrajp22 52a3f78
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 871c00e
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] dbf8453
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] f1fbee6
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 09a357f
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] e60a2b2
merge: preserve OMS projections with Python source classification
yashrajp22 bd96815
merge: preserve security fixes with latest review branch
yashrajp22 820ac92
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] a2385ee
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 6194430
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 0dfd73c
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 3748ff8
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 26a9ceb
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 1e39b85
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] e826268
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 83c838b
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 5f18791
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] a0156a8
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 71970e0
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 523e08f
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 9078100
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 364f5b3
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 89c05c5
fix: preserve analysis through malformed and alternative OMS bundles
yashrajp22 964429f
test: make unsupported certificate extension probe explicit
yashrajp22 82e5562
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] d76b502
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 7cd62bf
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] c993e53
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 84de79c
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] a46e6bf
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] cc0badd
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 17d94b2
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] d95d35b
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 37a27de
Merge branch 'main' into yashraj/scan-unverified-oms-content
github-actions[bot] 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,7 @@ | |
| observe_analyzer_findings, | ||
| ) | ||
| from skillspector.nodes.deduplicate import classification_metadata_key | ||
| from skillspector.oms import project_oms_content | ||
| from skillspector.python_ast import ( | ||
| MAX_PYTHON_AST_SOURCE_CHARS, | ||
| ParsedPythonFile, | ||
|
|
@@ -2310,9 +2311,46 @@ def _scan_all_views_detailed( | |
| started_at: float | None = None, | ||
| python_ast: ParsedPythonFile | None = None, | ||
| python_source: bool | None = None, | ||
| _oms_projected: bool = False, | ||
| ) -> tuple[list[Finding], LedgerReason | None, dict[str, int | float]]: | ||
| """Scan bounded raw windows and return any limit with observed/limit metrics.""" | ||
| started_at = time.monotonic() if started_at is None else started_at | ||
| runtime_limit = MAX_STATIC_ANALYSIS_SECONDS_PER_ARTIFACT | ||
| if timeout_seconds is not None: | ||
| runtime_limit = min(runtime_limit, max(0.0, timeout_seconds)) | ||
|
Member
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. i dont get this logic |
||
| now = time.monotonic() | ||
| if now >= started_at + runtime_limit: | ||
| return ( | ||
| [], | ||
| LedgerReason.RUNTIME_LIMIT, | ||
| { | ||
| "observed_seconds": max(0.0, now - started_at), | ||
| "limit_seconds": runtime_limit, | ||
| }, | ||
| ) | ||
| projection = None if _oms_projected else project_oms_content(content) | ||
| if projection is not None and projection.view.name != "raw": | ||
| findings, reason, metrics = _scan_all_views_detailed( | ||
| path, | ||
| projection.view.text, | ||
| pattern_modules, | ||
| None, | ||
| max_findings=max_findings, | ||
| timeout_seconds=timeout_seconds, | ||
| started_at=started_at, | ||
| # This view is derived JSON metadata, not a Python execution surface. | ||
| python_source=False, | ||
| _oms_projected=True, | ||
| ) | ||
| for finding in findings: | ||
| finding.start_line = finding.end_line = 1 | ||
| finding.start_column = finding.end_column = None | ||
| finding.evidence["oms_projection"] = ( | ||
| "Decoded content in the original DSSE bundle; line 1 identifies the carrier." | ||
| ) | ||
| finding.evidence[_SOURCE_START_EVIDENCE] = projection.view.source_offset(0) | ||
| finding.evidence.pop(_SOURCE_END_EVIDENCE, None) | ||
| return findings, reason, metrics | ||
| ast_modules = [module for module in pattern_modules if _uses_python_ast(module)] | ||
| lexical_modules = [module for module in pattern_modules if not _uses_python_ast(module)] | ||
| if python_source is None: | ||
|
|
||
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
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.
i believe it shouldnt be hardcoded but behind feature flag