-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC] Symfony Security rework tracking issue #30914
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
Comments
Following your comment on #28868, I wanted to add what I wrote there about authentication. The current implementation considers authentication as a binary state (authenticated / not authenticated), and we use additional roles and rules (IS_AUTHENTICATED_FULLY) to determine the amount of trust we give to the authenticated principal. The main issue is that we use authorization to describe something purely related to authentication. Something interesting could be to change this idea of binary status and replace it with a level of trust (e.g. an authentication through a form_login gives you 100 points). Having a 2FA form / using the remember me feature / having multiple factors could have an impact on this level of trust (e.g. using login_form + 2fa gives you a total of 150 points, using remember me gives you a total of 80 points, ...). We could use this mecanism to ease authentication controls by defining, for instance, a minimal level of trust either using firewalls or path based security rules. This would give a lot of flexibility to craft advanced authentication mecanisms. |
@quentinus95 interesting thoughts. You should however remember that the process of authentication itself is handled by Tokens, so the process of how an authentication chain ends up at a certain level of trust should be handled there. This is even already being improved by the proposal at #30765. In a nutshell right now we're pretty limited with the RememberMeToken granting
|
Updated RFC with some minor things:
|
@curry684 , this is a great list, thank you! I have some thoughts:
|
Relevant comment on password rehashing: #31019 (comment) |
@vudaltsov first one is already on the list as manual authentication, second one added, thanks! @teohhanhui given that in that issue "the framework" has made a choice on the subject I'm not seeing an RFC item there. It's of course a valid discussion but not something to have here right now I think. |
Hmm interesting, thanks 👍 |
For login throttling you could also consider device cookies: https://www.owasp.org/index.php/Slow_Down_Online_Guessing_Attacks_with_Device_Cookies That would need some state about logins saved somewhere, but I suppose implementing the functionality and leaving an interface for the user to implement storage -possibly with adding defaults in e.g. DoctrineBridge- might work. |
Hi 👋 I was thinking about the OAuth provider, what about using the Any idea? |
Is this the right issue to note that |
I'm going to work on the JWT part. |
for this id like to propose a new contract, as we're heading for |
I have an internal web app at work that requires impersonation chaining. the current impl supports only one impersonation and there are issues when you impersonate yourself (you shouldn't be allowed to do so). so it might be useful to be in the wild, but defaulting to allow a single impersonation in the chain. I'll try to experim this feature internally (and bug fixing) and if it were to be implemented in the base code, i'll be willing to implement it in the component. |
Could we have new Symfony contracts for the token interface and the user interface if applicable? What do you think? |
With the merge of the new experimental security (ref #33558), the following boxes can be ticked 😃 Authentication
Users
|
Nice work! I don't think you need me to physically tick them right? edit: ticked them off in case you do 😉 |
@curry684 I don't have special permissions for the symfony/symfony repository. So either you or a core team member can tick them. edit: thanks a lot for the quick response! |
From the original post:
This feature has been implemented in the maker bundle |
Another user related function would be email verification. This is also a WIP and should be ready soon. |
Cheers, updated OP! |
@curry684 We just merged this in a few moments ago - another check mark on the list |
@jrushlow checked off 😄 |
So after a long ride, I think it's time to close this issue. Starting with this issue, the security component has received lots of attention the past 2 years. I'm happy to see that almost all items on this list are ticked off. The remaining ones are either on the list for 5.4 in specialized issues or already fixed by a community bundle (which we may or may not merge in Symfony one day). Thanks a lot for everyone that has in some way been part of this long journey! |
Regarding password validators, I think we can consider it covered too:
|
It's been a happy ride indeed 👍 See you next FOSSA event 😉
@stof is the discouragement explicit and complete now? I'm fully aware requiring 'complex passwords' has been discouraged for good reasons for several years in most policies, however to my knowledge it has always been recommended to require some basic level of entropy by disallowing dictionary words, excessively short passwords and common 'canned' passwords like |
@curry684 see https://pages.nist.gov/800-63-3/sp800-63b.html#memsecretver
|
From the same link I was actually right:
Given that we cover minimum length and breach lists I agree it's enough and the rest is optionally pluggable. The confusion was in what 'complexity' entails, I consider disallowing dictionary words a complexity thing. |
Thank you to everyone who's contributed, it's great to have these improvements in Symfony! |
After discussions at EU FOSSA Hackathon we have some ideas on how to rework the Security component. I'm writing this "tracker issue" to gather up the info and choices made thus far.
The biggest functional issues have been discussed frequently over the years (#10316 and others) that the authentication makes some shortcut assumptions no longer valid in 2019:
The Symfony Security component was originally based on the Java Spring Security framework, but has deviated over the years. Today Spring Security has both fixed some structural issues that Symfony has (the notion of principals versus users and no central assumption that passwords and roles exist) and has some features that are currently lacking or hacky at best (structural support for OpenID/OAuth, support for 2FA). Conclusion for now is that most of the current Security component, especially authorization, is mostly fine and does not need a lot of work, and it wouldn't be all that hard to fix the authentication parts, and more strongly decouple authentication and authorization, by taking some current inspiration from Spring again.
Once these changes are propagated a lot of other features related to authentication should be easier to implement. Wishlists have been assembled:
Authentication
Social login (login in the app using Google, Facebook, GitHub, Twitter, etc.) and generic OAuth support([WIP][Security] OAuth2 component #31952 (comment))Two-factor (or multi-factor) authentication([Security] Native support for 2FA #28868 (comment))Authorization
Users
Dropping the notion of users at the lowest level must not mean DX suffers and developers need to write a lot of boilerplate again. In fact directly implementing
PrincipalInterface
should likely be considered an advanced subject, and we should provide a layer with abstract and stock implementation of common user-based scenarios:Allow to easily differentiate anonymous users and logged in users.([Security] Removed anonymous in the new security system #36574 (comment))make::reset-password
)$security->login(‘username’)
)Non-wishlist
/cc @wouterj @derrabus @linaori @sstok
The text was updated successfully, but these errors were encountered: