spring-projects / spring-projects/spring-security

Strict Two way TLS enabling using CN name Validation

Open
#9,302 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: web type: enhancement
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 -

  1. Client Sends Request
  2. 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)
  3. Server asks for a certificate from the client
  4. Client represent the certificate
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.