spring-projects / spring-projects/spring-security
Strict Two way TLS enabling using CN name Validation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
**Currently We can have Spring Security filters utilized in order to perform 2WayTLS with CN name validations for user authorizations, but it's difficult to do the same for all the trusted CN names **
2WayTLS Steps -
- Client Sends Request
- Server represents Certificate
If the presented certificate or the signer CA is trusted by the client, it trusts the server (Also there is one DNS matching which is subjective) - Server asks for a certificate from the client
- Client represent the certificate
- If CA is trusted by the server, the handshake is complete (This step I want to put strict validation against trusting the leaf cert instead of just CA check)
There is one way to do step 5, using authorization mechanisms in spring security, by providing CN name extraction and then comparing it, but there is no convenient way of doing it, it requires to import entire security layer and manually parse each cert,
Can't we just have yaml property like client-auth: need to make it more obvious to perform the CN name validation for leaf-level verification (trusting only if certificates public key is trusted and not trust even when signing CA is trusted)
this is needed as same signer can be used for many certs and it causes unauthorized access if we only use 2 Way tls as auth mechanism
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the requested two-way TLS flow and the existing Spring Security authorization approach described in the issue. Define how a configuration property would enforce leaf-certificate or CN validation rather than signer-CA trust, and identify the tests needed to demonstrate both accepted and rejected certificates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100