aiceflower opened a new pull request, #5460: URL: https://github.com/apache/linkis/pull/5460
## Summary Replace the legacy DES-based session ticket encryption with AES-256-GCM (AEAD). Solves DES 56-bit weak cipher and the lack of integrity/anti-tamper protection in one change. ## Changes ### New `TicketCipher` class - AES-256-GCM (NoPadding) — confidentiality + integrity (GCM AEAD) - PBKDF2WithHmacSHA256 key derivation — deterministic across JVM vendors (unlike SHA1PRNG in AESUtils) - Auto-detects V2 (GCM) vs legacy V1 (DES) on decrypt — backward compatible - V2 enabled/disabled via constructor toggle ### Config switch - `linkis.ticket.cipher.v2.enabled=true` (default) — new tickets issued in AES-GCM format - Set to `false` to fall back to legacy DES if downstream systems have not yet upgraded - Decryption always auto-detects both formats regardless of switch state ### Callers switched - `ServerConfiguration.getUsernameByTicket` / `getTicketByUsername` - `ProxyUserSSOUtils` proxy ticket encryption/decryption ## Affected files - `linkis-commons/linkis-common/.../TicketCipher.java` (new, 147 lines) - `linkis-commons/linkis-module/.../ServerConfiguration.scala` (+58/-9) - `linkis-commons/linkis-module/.../ProxyUserSSOUtils.scala` (1 file, +4/-4) ## Rollback Set `linkis.ticket.cipher.v2.enabled=false` to revert to DES for new tickets. Existing V2 tickets continue to be accepted on decrypt regardless. ## Deployment impact | Scenario | Impact | |---|---| | Default (V2 on) | New tickets in GCM; old DES tickets still accepted | | Rollback (V2 off) | New tickets in DES; existing V2 tickets still accepted | | Mixed-version cluster | All instances must be on this PR or later for V2 to work | 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
