-
Notifications
You must be signed in to change notification settings - Fork 12
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
Password length requirements no longer meet NZISM #52
Comments
We might need to make PasswordValidator configurable via YAML instead of using |
We’d also want to think about the UX for if someone logs in with a no-longer-compliant password. Do we force a reset? |
It's not really core team - We should try to get this in for CWP 2.2. We can just remove the milestone. |
PR #53 |
Not fixed in CWP 2.2.0-rc1 |
🤔 does the test pass on kitchen sink? |
The PR was merged into master, which is probably why this is "not fixed". I'm just setting up a local environment to verify that before I cherry pick it into 2.2 |
oh, whoops! That's my bad with the targeting. |
https://github.com/silverstripe/recipe-core/blob/4.3/app/_config.php this file is coming through because we don't have an equivalent file to override it with. The config in that file is taking precedence over the YAML in #53 Patched in cwp-recipe-core and I've cherry-picked #53 back into the 2.2 branch. All working now! |
Sorry, that recipe patch hasn't fixed it yet. The silverstripe/recipe-core file is still being copied in first and taking precedence. |
The problem is that this file is not extensible: https://github.com/silverstripe/recipe-core/blob/4.3/app/_config.php It gets loaded first by composer, and the file gets copied into app/_config.php first, then all subsequent recipes will ignore their own _config.php files because it already exists. The logic in this file is executed after the config manifests are built, and after all module _config.php files, so we can't override it at the moment. I thought we could move the password requirements from a PHP file into YAML config, but since it'll exist in user project code it'd also get loaded after modules, so the CWP config would need to say I've raised an issue at silverstripe/recipe-plugin#12 since we don't have a way of controlling the priority of project files between recipes. TBH I think the only way we can fix this is to move the password requirements out of user code (via a recipe) and put them into default YAML config in framework. Then user code can extend if they want to (with config), as well as CWP. I'm going to make PRs to do this and we can decide later if we want to. |
Ok new pull requests are up, ready for discussion |
This probably need a docs update, will do that shortly |
Docs PR added silverstripe/silverstripe-framework#8600 |
I found a bug, new PR at silverstripe/recipe-core#35 |
🤔 I would have thought that framework using injector if one is not set should cover that... |
@NightJar yeah, but Injector doesn't |
True, but here it sets config so it does To be clear I'm not particularly caring about reintroducing the setting method in silverstripe/recipe-core#35 - I'm just puzzled as to why it's necessary - it seems like it shouldn't be (if nothing else replaces the defined service linked above)... I wonder if there's anything deeper at play. Oh derp - sorry getting confused between ... Like this? How come this doesn't work? :/ |
@NightJar injector has() won’t return true with config only, it needs to have an instance created already for it to return true. Config only is not enough |
Here's a unit test to show what I mean. Framework has the passwords.yml config in it. public function testInjectorHas()
{
$this->assertFalse(Injector::inst()->has(PasswordValidator::class));
Member::set_password_validator(PasswordValidator::singleton());
$this->assertTrue(Injector::inst()->has(PasswordValidator::class));
} |
If this is true then there's a bug in framework.
If there is not an already loaded spec, then So in both cases So for the configuration in edit: Say like... not being included in |
All PRs merged again =) |
We require 8 chars min length, but NZISM requires 10 since at least v2.4 (Nov 2015) - see archive.
Context: silverstripe/silverstripe-framework#8522. Tracking this separately for CWP, because we might need to handle this faster or in a different way. In open source, it's a matter of opinion. In CWP, it's a compliance issue. Note that agencies can choose to increase those requirements on their own instances, but is about setting compliant defaults.
https://www.nzism.gcsb.govt.nz/ism-document/#1858
This also aligns with OWASP guidance: https://www.owasp.org/index.php/Authentication_Cheat_Sheet#Password_Length
217ddec#diff-8a7315557cd9f672e36f7e8f0ce2c29e removed the password requirements from CWP, because they're now part of recipe-core: https://github.com/silverstripe/recipe-core/blob/4/app/_config.php#L8
Pull requests
The text was updated successfully, but these errors were encountered: