Repository navigation
Make the key algorithm and key size of new tenant keystores configurable - #4643
madurangasiriwardena merged 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughTenant keystore configuration now specifies an algorithm and key size. ChangesTenant Keystore Key Settings
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Feature Merge Risk: ⚪ Minimal · up to No demonstrated issue blocks merging. Confirm that both tenant keystore generators use the configured settings as part of normal integration validation. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new APIs preserve RSA-2048 defaults and reject unsupported algorithms and nonblank invalid sizes. No introduced security vulnerability was established. However, downstream key-generation integration and failure handling were not available to verify, so the change does not yet establish end-to-end enforcement. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the purpose and approach, includes configuration details, and links a related issue. However, most template sections remain as prompts or placeholders, including user stories, release note, documentation, automation test results, security checks, and test environment. Resolution Complete the missing template sections. Add user stories, a release note, documentation links or an N/A explanation, training and marketing applicability, unit and integration test details, security-check results, samples, related PRs, migration details or an N/A explanation, tested environments, and learning notes. Use N/A with a brief reason for sections that do not apply. Full details: Docstring CoverageExplanation Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
Add [keystore.tenant] key_algorithm and key_size, rendered as KeyAlgorithm and KeySize under Security.TenantKeyStore in carbon.xml. They default to RSA and 2048 next to keystore.tenant.type, and apply only to tenants created after they are set. Add KeystoreUtils.getTenantKeyAlgorithm() and getTenantKeySize(), so that the tenant keystore generators in carbon-multitenancy and carbon-identity-framework share one implementation of reading and validating these values. Only RSA is supported. The key size must be a multiple of 1024 between 2048 and 8192. An invalid value throws a CarbonException instead of falling back to a smaller key.
0fc1375 to
9e1e09e
Compare
Purpose
Tenant keystores are generated with a hardcoded RSA-2048 key. Some deployments must use asymmetric keys with different size of bits. The primary keystore (
[keystore.primary]) does not cover non-super tenants, so their keys cannot meet that requirement today.This PR adds the configuration and one shared, validated API. carbon-multitenancy and carbon-identity-framework use it when they generate tenant keystores and tenant context keystores.
wso2/product-is#28544
Approach
carbon.xml.j2: renderKeyAlgorithmandKeySizeunderSecurity.TenantKeyStorewhen[keystore.tenant] key_algorithmandkey_sizeare defined.default.json: defaultkeystore.tenant.key_algorithmtoRSAandkeystore.tenant.key_sizeto2048, next tokeystore.tenant.type. Products that merge this file (product-is merges it as the base for its owndefault.json) get the defaults without changes.KeystoreUtils:getTenantKeyAlgorithm()returns the configured algorithm. The default isRSA. OnlyRSAis supported. This method is the extension point for EC later.getTenantKeySize()returns the configured size. The default is2048. The value must be a multiple of 1024 between 2048 and 8192.CarbonExceptionwith a clear message. It never falls back to a smaller key.Configuration:
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning