Sanitize SQL queries
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Xác định phần instrumentation của sentry-jdbc và sentry-android-sqlite, bao gồm các entry point SupportSQLiteOpenHelper và SQLiteDriver, đồng thời xem xét SqlSanitizerWithSummary.jflex của OpenTelemetry Java làm cơ sở tham khảo trước đó. Được xem là hoàn tất khi mọi câu lệnh đều tạo ra các mô tả span mang tính cấu trúc an toàn mà không làm lộ các literal hoặc comment, với phạm vi kiểm thử bao gồm input malformed, dialect, secret-canary, fuzz/độ bền vững và hiệu năng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Kotlin
- Star
- 1.4k
- Fork
- 478
- Merge trung bình
- 3 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 70
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/sentry-java
-
Bug Java Platform: Java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsentry/sentry-java#6138 · 1 bình luận ·
-
Feature Java Platform: Java Spans
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-java#5984 · 1 bình luận ·
-
Android Task Traces
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-java#5376 · 1 bình luận ·
-
Android Docs Errors
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
getsentry/sentry-java#5375 · 1 bình luận ·
-
Android good first issue Task User Feedbacks
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-java#5354 · 1 bình luận ·
Tất cả issue của getsentry/sentry-java
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
index-request triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Anthonyy232/Paperize#614 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
🌑 nextgen
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
CCBlueX/LiquidBounce#9214 · 1 bình luận ·