Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunAsManager replacement #11331

Open
3 tasks
jzheaux opened this issue Jun 3, 2022 · 5 comments
Open
3 tasks

RunAsManager replacement #11331

jzheaux opened this issue Jun 3, 2022 · 5 comments
Assignees
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Jun 3, 2022

RunAsManager can add to or change the existing authentication for the duration of a message, a request, or a method call.

It overloads the authority string to include instructions to Spring Security as to what authorities to temporarily grant. It is primarily designed to work with the @Secured annotation and with the access XML attribute when not using expressions.

As a first step to supporting this with the authorization manager API, we should:

  • Improve AuthorizationFilterParser to support use-expressions="false"
  • Improve AuthorizationFilterParser to adapt the Supplier<Authentication> for RUN_AS attributes
  • Improve @Secured method handling to adapt the Supplier<Authentication> for RUN_AS attributes

UPDATE: Let's wait on these subtasks. This isn't the way that we want to do impersonation and privilege escalation going forward, and so I don't really want to support a legacy way in a new API. I'll leave this ticket open for investigating what this support should look like going forward.

It's worth considering whether a new contract is needed like Supplier<Authentication> adapt(Supplier<Authentication> authentication, T context) that can be supplied to alter how the adaptation is performed.

@jzheaux jzheaux added in: core An issue in spring-security-core type: enhancement A general enhancement labels Jun 3, 2022
@jzheaux jzheaux added this to the 5.8.x milestone Jun 3, 2022
@jzheaux jzheaux self-assigned this Jun 3, 2022
@jzheaux
Copy link
Contributor Author

jzheaux commented Jun 3, 2022

For now, I'm taking off the 5.8.x milestone, pending the team's upcoming 5.8 planning meeting.

@jzheaux jzheaux removed this from the 5.8.x milestone Jun 3, 2022
@rwinch rwinch added this to the 5.8.x milestone Jun 3, 2022
@rwinch
Copy link
Member

rwinch commented Jun 3, 2022

Sorry I wasn't clear when we met what I was looking for. Let's leave this on 5.8.s as you had very valid reasons for us needing to include it. Specifically we will be deprecating the old RunAsManager behavior without a replacement for users to migrate to before moving to Security 6.0. This fits into our theme of deprecations for 5.x and ensuring we provide a way to opt into their replacements before 6.0x to ease migrations.

@mkjensen
Copy link

Any hints to how one should proceed if wanting to implement impersonation and/or privilege escalation with Spring Security 6?

@abccbaandy
Copy link

@s-jepsen
Copy link

s-jepsen commented Aug 5, 2024

Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants