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.
fix(iceberg): resolve P0 critical security vulnerabilities and improvements #5878
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
base: master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
fix(iceberg): resolve P0 critical security vulnerabilities and improvements #5878
Changes from 1 commit
4abfcaa0093113b9659ad7042b0d8ce4bd8d54624a2c35063d804d7980b6ab3eca8bc6ed296146d440e9da0916269f07503b8f2e2850a89df877d15a171cb956e51eea1dce29c0c5627363e26d02ba04d637224d0df1cb287f306c5496feb0dda4faf4ce8430bba23e32825307a955e230e2a2bd36083a18f453982baff64b638b74cc3a8892941a0e1ed1fa29f1522c49ae25b1c148dd7b163413e92fcFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
…ovements This commit addresses critical security vulnerabilities and code quality issues identified in the comprehensive code review of the Iceberg storage implementation. ## P0 Critical Security Fixes (BLOCKING) ### 1. SQL Injection Prevention via Identifier Validation (Issue 017) ✅ - Added `validate_sql_identifier()` function with regex validation - Validates all feature view names, column names, table identifiers - Blocks SQL reserved words and special characters - Prevents injection attacks like: `fv.name = "features; DROP TABLE--"` - Location: sdk/python/feast/infra/offline_stores/contrib/iceberg_offline_store/iceberg.py - Tests: 6/6 passing (TestSQLIdentifierValidation) ### 2. Credential Exposure Prevention (Issue 018) ✅ - Replaced SQL SET commands with DuckDB parameterized queries - Credentials no longer visible in logs, error messages, or query history - Added AWS environment variable fallback support - Uses `con.execute("SET s3_access_key_id = $1", [credential])` pattern - Location: sdk/python/feast/infra/offline_stores/contrib/iceberg_offline_store/iceberg.py - Tests: 6/6 passing (TestCredentialSecurityFixes) ## Additional Fixes Completed ### 3. Append-Only Documentation (Issue 004) ✅ - Added comprehensive "Storage Management and Compaction" documentation - Includes manual/automated compaction scripts and schedules - Storage growth monitoring guidance with triggers - Production best practices for Iceberg online store - Location: docs/reference/online-stores/iceberg.md ### 4. Verified Created Timestamp Deduplication (Issue 008) ✅ - Confirmed fix from commit d36083a is working correctly - Uses created_timestamp as tiebreaker in pull_latest_from_table_or_query - Test coverage verified and passing - Marked TODO as resolved ### 5. Redundant Logger Import Cleanup (Issue 023) ✅ - Removed duplicate `import logging` shadowing module-level logger - Improved code consistency across online store module - Location: sdk/python/feast/infra/online_stores/contrib/iceberg_online_store/iceberg.py ## Test Coverage All new tests passing: - SQL identifier validation: 6/6 tests ✅ - Credential security: 6/6 tests ✅ - Total new test coverage: 12 tests ## Files Modified **Security Fixes:** - sdk/python/feast/infra/offline_stores/contrib/iceberg_offline_store/iceberg.py (+180 lines) - validate_sql_identifier() function - SQL reserved words list - Parameterized credential configuration - Environment variable fallback support **Documentation:** - docs/reference/online-stores/iceberg.md (+137 lines) - Storage management section - Compaction strategies and schedules - Monitoring guidance **Code Quality:** - sdk/python/feast/infra/online_stores/contrib/iceberg_online_store/iceberg.py (-2 lines) - Removed redundant logger import **Tests:** - sdk/python/tests/unit/infra/offline_store/test_iceberg_offline_store_fixes.py (+203 lines) - TestSQLIdentifierValidation (6 tests) - TestCredentialSecurityFixes (6 tests) - test_sql_identifier_validation_in_feature_view_name - test_sql_identifier_validation_in_column_names - test_sql_identifier_validation_in_timestamp_field **TODO Status:** - todos/017-pending-p0-unvalidated-sql-identifiers.md (resolved) - todos/018-pending-p0-credentials-in-sql-set.md (resolved) - todos/004-pending-p1-append-only-duplicates.md (resolved) - todos/008-pending-p2-missing-created-timestamp-dedup.md (resolved) - todos/023-pending-p2-redundant-logger-import.md (resolved) ## Impact **Security:** - ✅ Eliminates SQL injection vulnerabilities - ✅ Prevents credential exposure in logs - ✅ Production-ready security posture **Code Quality:** - ✅ Comprehensive test coverage for security fixes - ✅ Improved code consistency - ✅ Better operational guidance ## Remaining Work The following TODOs hit API quota limits and remain pending: - P1: 019 (MOR double-scan), 020 (TTL validation), 021 (exception handling) - P1: 022 (missing test coverage), 016 (duplicate function) - P2: 002, 006, 007, 009-015 (various improvements) These will be addressed in follow-up commits. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.