spring-projects / spring-projects/spring-security

SEC-3207: Dynamic method execution security

Open
#3,405 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: acl type: enhancement type: jira
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Mario Casari (Migrated from SEC-3207) said:

I would like to suggest an improvement that would easily provide an interesting additional facility using only current ACL features. Sometimes there is the need to dynamically secure method execution on a permission rather than on a role basis, using roles as containers of permissions. This is the case when the application security rules included methods execution must be completely configurable at runtime. As far as I know there is no out-of-the-box solution in Spring Security for it, but I think that this feature could be extrapolated easily from the ACL module. Since a ‘Sid’ entity could represent both a Principal and a GranthedAuthority, an ACE in which the Sid is a GrantedAuthority can be seen as a permission on an object granted to a Role, where the Role is the GrantedAuthority. If we consider a custom permission that plays the role of execute permission on methods we can associate such permission to a Method instance (to be more specific we would have to wrap the Method class to provide an ID to it) and a GrantedAuthority or directly to a Principal using the ACL API.

I explain these ideas in more details in two articles of mine, dynamically securing methods by spring security and dynamic spring security sample .
In the first the general idea is described, in the second there is a full working example.

My suggestion would be to provide the ACL package with a custom permission (method execution permission), a custom Permission Evaluator, Voter and annotation as I do in my example so as this feature would be directly available to the developers.

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 with the ACL package and ACL API, then review the proposed custom permission, PermissionEvaluator, voter, and annotation against the linked dynamic Spring Security example. The issue does not name files or tests; completion would require agreeing on the runtime-configurable method-execution design and its integration points.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authorization, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.