Sanitize SQL queries
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 42/100
Direzione di ricerca
Individua la strumentazione di sentry-jdbc e sentry-android-sqlite, inclusi i punti di ingresso SupportSQLiteOpenHelper e SQLiteDriver, e prendi in esame SqlSanitizerWithSummary.jflex di OpenTelemetry Java come precedente. Il lavoro è completato quando tutte le istruzioni producono descrizioni strutturali sicure degli span senza esporre letterali o commenti, con copertura per input malformati, dialetti, secret-canary, fuzz/robustezza e prestazioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem Statement
Our JDBC and Android SQLite integrations currently use caller-provided SQL directly as the span description. If a customer interpolates values instead of using placeholders, literals and comments can contain PII, credentials, or other sensitive data and are sent to Sentry. The Java SDK has no SQL sanitizer today.
Solution Brainstorm
Introduce a shared internal SQL analyzer used by sentry-jdbc and sentry-android-sqlite.
Requirements:
- Sanitize every statement, including prepared-statement text.
- Replace literal values with placeholders while preserving SQL structure and existing parameter markers.
- Remove or redact line and block comments.
- Handle database dialect differences conservatively.
- Never fall back to, attach, or log the original query if analysis fails; fail closed to safe structural metadata.
- Use sanitized query text as the transaction-based span description.
- Cover JDBC, SupportSQLiteOpenHelper, and SQLiteDriver instrumentation.
- Add malformed-input, dialect, secret-canary, fuzz/robustness, and performance tests.
OpenTelemetry Java's Apache-2.0 JFlex SqlSanitizerWithSummary.jflex is strong prior art and can likely be adapted, but should not be vendored unchanged: OTel preserves comments, may skip sanitization for prepared statements, and preserves unknown fragments. Vendoring requires source attribution and a THIRD_PARTY_NOTICES.md entry.
- Lingua principale
- Kotlin
- Stelle
- 1.4k
- Fork
- 478
- Merge medio
- 3g 2h
- PR unite (30g)
- 70
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-java
-
Improvement Java Platform: Java
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
getsentry/sentry-java#6145 · 1 commento ·
-
Bug Java Platform: Java
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-java#6138 · 1 commento ·
-
Feature Java Platform: Java Spans
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
getsentry/sentry-java#5984 · 1 commento ·
-
Android Task Traces
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
getsentry/sentry-java#5376 · 1 commento ·
-
Android Docs Errors
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
getsentry/sentry-java#5375 · 1 commento ·
Tutte le issue di getsentry/sentry-java
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
johanhaleby/occurrent#1120 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
2 rename bugs Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ankidroid/Anki-Android#21999 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
openwallet-foundation/multipaz#2028 ·