Add Kubernetes Exit-Code CREs: 137 (OOMKilled), 127 (Command Not Found), 134 (SIGABRT), 139 (SIGSEGV)#137
Merged
Lyndon-prequel merged 5 commits intoprequel-dev:mainfrom Sep 5, 2025
Conversation
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
tonymeehan
approved these changes
Aug 29, 2025
Contributor
|
LGTM! |
RaghavArora14
added a commit
to RaghavArora14/cre
that referenced
this pull request
Sep 9, 2025
- Add CRE-2025-0140: Supabase Realtime Invalid Config - Add CRE-2025-0141: Supabase Disk Full Migration - Add CRE-2025-0142: Supabase SSL Certificate Missing - Update test logs for Kubernetes exit code CREs (134, 137, 139) - Include Kubernetes exit code YAML files from PR prequel-dev#137
tonymeehan
pushed a commit
that referenced
this pull request
Sep 29, 2025
…he Troubleshooting Guide & Write a CRE Rule (#153) * feat: Add 10 Supabase self-hosted CRE rules for high-severity failures - Add CRE-2025-0130: Postgres container port conflict - Add CRE-2025-0131: JWT secret missing or invalid - Add CRE-2025-0132: Database connection timeout - Add CRE-2025-0133: Storage S3 misconfiguration - Add CRE-2025-0134: Realtime service invalid config - Add CRE-2025-0135: Migration SQL syntax errors - Add CRE-2025-0136: Auth service port conflict - Add CRE-2025-0137: Disk full during migration - Add CRE-2025-0138: API rate limit exceeded - Add CRE-2025-0139: SSL certificate missing Each rule includes realistic test logs and proper detection patterns. Updated taxonomy with Supabase-specific tags and categories. Closes #131 * fix: Add window parameter to Supabase CRE rules and create data-sources.yaml - Added required 'window: 5m' parameter to all 10 Supabase CRE set rules - Fixed validation errors for CRE-2025-0130 through CRE-2025-0139 - Created comprehensive data-sources.yaml documenting all log sources - Rules now pass preq validation and generate proper detection reports Addresses bounty #131 requirements for working CRE rules and data sources configuration. * fix: Remove duplicate port-binding tag from tags.yaml - Removed duplicate port-binding tag that was causing build failure - Original port-binding tag already exists at line 108 - Fixes make command error: 'Duplicate name kind=tags name=port-binding' * fix: Remove invalid 'docker' tag from CRE rules - Removed 'docker' tag from CRE-2025-0130 and CRE-2025-0136 - Fixed build failure: 'Unknown tag tag=docker' - All tags now properly validated against tags.yaml * fix: Add missing JWT tag to tags.yaml - Added JWT tag definition to resolve 'Unknown tag tag=jwt' error - JWT tag now properly validates in CRE-2025-0131 - Enables local testing: Get-Content test.log | preq.exe -r rule.yaml * fix: Remove duplicate 'auth' tag from CRE-2025-0131 - Removed invalid 'auth' tag from JWT secret rule - 'authentication' tag already covers this functionality - Tested locally with preq - validation passes - Rule generates proper detection reports * fix: Replace invalid '0' characters in base58 rule IDs - Fixed 7 CRE rules with invalid base58 rule IDs containing '0' - CRE-2025-0132: SB3DbConn3ct10nT1m30ut SB3DbConn3ct11nT1m31ut - CRE-2025-0133: SB4St0r4g3S3M1sc0nf1g SB4St1r4g3S3M1sc1nf1g - CRE-2025-0134: SB5R34lt1m3C0nf1gErr0r SB5R34lt1m3C1nf1gErr1r - CRE-2025-0135: SB6M1gr4t10nSyntaxErr0r SB6M1gr4t11nSyntaxErr1r - CRE-2025-0136: SB7Auth0P0rtC0nfl1ctErr SB7Auth1P1rtC1nfl1ctErr - CRE-2025-0137: SB8D1skFullMigrat10nErr SB8D1skFullMigrat11nErr - CRE-2025-0139: SB10SSLCertM1ss1ngErr0r SB11SSLCertM1ss1ngErr1r All rules now pass base58 validation and generate proper detection reports. Tested locally with preq - all validation passes successfully. * fix: Remove all unknown/invalid tags from Supabase CRE rules COMPREHENSIVE TAG AUDIT & FIXES: - CRE-2025-0133: 'cloud-provider-problem' 'infrastructure' - CRE-2025-0135: removed 'database-problem' and 'syntax' tags - CRE-2025-0132: removed 'database-problem' tag - CRE-2025-0138: removed 'api-problem' and 'ddos' tags All invalid tags replaced with existing valid tags from tags.yaml. Tested locally with preq - all rules now pass validation successfully. No more 'unknown tag' build failures. * fix: FINAL tag validation - all 39 unique tags now valid COMPREHENSIVE TAG AUDIT COMPLETE: Fixed last 3 invalid tags found by systematic validation: - CRE-2025-0133: removed 'credentials' tag (covered by 'api-key') - CRE-2025-0138: 'kong' 'proxy' - CRE-2025-0139: 'kong' 'proxy' - CRE-2025-0134: removed 'websocket' tag (covered by 'realtime') VALIDATION COMPLETE: All 39 unique tags verified against tags.yaml All rules tested locally with preq - 100% validation success No more 'unknown tag' build failures possible ACHIEVEMENT UNLOCKED: 100% Tag Compliance! * fix: ULTIMATE tag validation - removed final 'sql' tag ABSOLUTE FINAL TAG FIX: Removed invalid 'sql' tag from CRE-2025-0135 ULTIMATE VALIDATION COMPLETE: All 38 unique tags verified valid ZERO invalid tags remaining across all 10 CRE rules Comprehensive validation script confirms 100% compliance BULLETPROOF: No more tag validation failures possible! READY FOR BOUNTY! * fix: Resolve test failures for CRE-2025-0130 and CRE-2025-0137 TEST FIXES APPLIED: CRE-2025-0130: Fixed source mapping and regex patterns for port conflict detection - Changed source: cre.log.docker cre.log.supabase - Updated test.log format: docker supabase-db - Simplified regex patterns for better matching - NOW DETECTS: 1 problem (as expected by tests) CRE-2025-0137: Fixed source mapping and value field for disk full detection - Changed source: cre.log.postgres cre.log.supabase - Changed value: 'postgres' 'migration' (matches log content) - NOW DETECTS: 1 problem (as expected by tests) Both rules now pass local preq validation and should pass automated tests. Tests expect exactly 1 problem detection per rule - ACHIEVED! * Add Supabase CREs 140-142 and resolve conflicts - Add CRE-2025-0140: Supabase Realtime Invalid Config - Add CRE-2025-0141: Supabase Disk Full Migration - Add CRE-2025-0142: Supabase SSL Certificate Missing - Update test logs for Kubernetes exit code CREs (134, 137, 139) - Include Kubernetes exit code YAML files from PR #137 * Delete rules/cre-2025-0134/supabase-realtime-invalid-config.yaml * Delete rules/cre-2025-0137/supabase-disk-full-migration.yaml * Delete rules/cre-2025-0139/supabase-ssl-certificate-missing.yaml
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi team,
This PR contributes four Kubernetes CREs centered on high-signal container exit codes that commonly break workloads. Each CRE ships with a reproducible script compatible with Preq.
Reproducible Repo with Readme(private): https://github.com/amanycodes/k8s-exit-codes
Prequel Playground Links:
137
134
127
139
Detection Approach
These CREs use the exit-code TSV scanner (
kubectl … | jq … | @tsv) and pipe the result to Preq.Exit Codes
Exit 137 (OOMKilled)
Exit 127 (command not found / bad entrypoint)
Exit 134 (SIGABRT / assertion failure)
Exit 139 (SIGSEGV / segmentation fault)
Looking forward to any feedback! Happy to tweak severities, tags, or matchers.