No description
Find a file
Thomas Darimont 3103e0fd0a KEYCLOAK-5244 Add BlacklistPasswordPolicyProvider (#4370)
* KEYCLOAK-5244 Add BlacklistPasswordPolicyProvider

This introduces a new PasswordPolicy which can refer to
a named predefined password-blacklist to avoid users
choosing too easy to guess passwords.

The BlacklistPasswordPolicyProvider supports built-in as
well as custom blacklists.
built-in blacklists use the form `default/filename`
and custom ones `custom/filename`, where filename
is the name of the found blacklist-filename.

I'd propose to use some of the freely available password blacklists
from the [SecLists](https://github.com/danielmiessler/SecLists/tree/master/Passwords) project.

For testing purposes one can download the password blacklist
```
wget -O 10_million_password_list_top_1000000.txt https://github.com/danielmiessler/SecLists/blob/master/Passwords/10_million_password_list_top_1000000.txt?raw=true
```
to /data/keycloak/blacklists/

Custom password policies can be configured with the SPI
configuration mechanism via jboss-cli:
```
/subsystem=keycloak-server/spi=password-policy:add()
/subsystem=keycloak-server/spi=password-policy/provider=passwordBlacklist:add(enabled=true)
/subsystem=keycloak-server/spi=password-policy/provider=passwordBlacklist:write-attribute(name=properties.blacklistsFolderUri, value=file:///data/keycloak/blacklists/)
```

Password blacklist is stored in a TreeSet.

* KEYCLOAK-5244 Encode PasswordBlacklist as a BloomFilter

We now use a dynamically sized BloomFilter with a
false positive probability of 1% as a backing store
for PasswordBlacklists.

BloomFilter implementation is provided by google-guava
which is available in wildfly.

Password blacklist files are now resolved against
the ${jboss.server.data.dir}/password-blacklists.

This can be overridden via system property, or SPI config.
See JavaDoc of BlacklistPasswordPolicyProviderFactory for details.

Revised implementation to be more extensible, e.g. it could be
possible to use other stores like databases etc.

Moved FileSystem specific methods to FileBasesPasswordBlacklistPolicy.

The PasswordBlacklistProvider uses the guava version 20.0
shipped with wildfly. Unfortunately the arquillian testsuite
transitively depends on guava 23.0 via the selenium-3.5.1
dependency. Hence we need to use version 23.0 for tests but 20.0
for the policy provider to avoid NoClassDefFoundErrors in the
server-dist.

Configure password blacklist folder for tests

* KEYCLOAK-5244 Configure jboss.server.data.dir for test servers

* KEYCLOAK-5244 Translate blacklisted message in base/login
2017-10-17 20:41:44 +02:00
adapters KEYCLOAK-5499: Use authentication token type rather than token source detection to identify interactive and non-interactive authentications. (#4488) 2017-10-16 09:38:05 +02:00
authz Remove unused imports (#4558) 2017-10-16 14:23:42 +02:00
boms Set version to 3.4.0.CR1-SNAPSHOT 2017-08-28 15:46:22 +02:00
common Remove unused imports (#4558) 2017-10-16 14:23:42 +02:00
core Remove unused imports (#4558) 2017-10-16 14:23:42 +02:00
dependencies Set version to 3.4.0.CR1-SNAPSHOT 2017-08-28 15:46:22 +02:00
distribution KEYCLOAK-5244 Add BlacklistPasswordPolicyProvider (#4370) 2017-10-17 20:41:44 +02:00
examples Keycloak 2035 2017-09-22 15:05:49 +01:00
federation KEYCLOAK-4052 - add an option to validate Password Policy for ldap user storage 2017-10-13 13:54:50 +02:00
integration Merge pull request #4209 from guitaro/feature/group-search-and-pagination 2017-09-23 20:52:19 -04:00
misc KEYCLOAK-5656 Use standard infinispan remote-store 2017-10-16 21:49:42 +02:00
model KEYCLOAK-5656 Use standard infinispan remote-store 2017-10-16 21:49:42 +02:00
proxy Set version to 3.4.0.CR1-SNAPSHOT 2017-08-28 15:46:22 +02:00
saml-core [KEYCLOAK-4374] Support SAML 2.0 AttributeValue of AnyType and nil 2017-09-27 17:12:51 +02:00
saml-core-api Set version to 3.4.0.CR1-SNAPSHOT 2017-08-28 15:46:22 +02:00
server-spi Merge pull request #4510 from glavoie/KEYCLOAK-3303 2017-09-29 17:07:45 +02:00
server-spi-private KEYCLOAK-5244 Add BlacklistPasswordPolicyProvider (#4370) 2017-10-17 20:41:44 +02:00
services KEYCLOAK-5656 Use standard infinispan remote-store 2017-10-16 21:49:42 +02:00
testsuite KEYCLOAK-5244 Add BlacklistPasswordPolicyProvider (#4370) 2017-10-17 20:41:44 +02:00
themes KEYCLOAK-5244 Add BlacklistPasswordPolicyProvider (#4370) 2017-10-17 20:41:44 +02:00
util Set version to 3.4.0.CR1-SNAPSHOT 2017-08-28 15:46:22 +02:00
wildfly KEYCLOAK-4952: Header information disclosure 2017-10-06 16:04:39 -04:00
.gitattributes KEYCLOAK-1385 Introduce end-of-line normalization 2015-07-17 13:46:51 +02:00
.gitignore KEYCLOAK-5391: Add node_modules back to repository for commons theme (#4457) 2017-09-05 14:27:19 -04:00
.travis.yml Fix Travis testsuite errors - dist=precise 2017-07-21 14:53:13 +02:00
License.html distro 2014-01-07 14:37:50 -05:00
pom.xml KEYCLOAK-5244 Add BlacklistPasswordPolicyProvider (#4370) 2017-10-17 20:41:44 +02:00
README.md Update the readme with a reference on how to report vulnerabilities (#4541) 2017-10-16 12:27:11 +02:00
travis-run-tests.sh Fix Tomcat 6 issues (#4478) 2017-09-15 09:55:42 +02:00

Keycloak

Open Source Identity and Access Management for modern Applications and Services.

For more information about Keycloak visit Keycloak homepage and Keycloak blog.

Building

Ensure you have JDK 8 (or newer), Maven 3.1.1 (or newer) and Git installed

java -version
mvn -version
git --version

First clone the Keycloak repository:

git clone https://github.com/keycloak/keycloak.git
cd keycloak

To build Keycloak run:

mvn install

This will build all modules and run the testsuite.

To build the distribution run:

mvn install -Pdistribution

Once completed you will find distribution archives in distribution.

Starting Keycloak

To start Keycloak during development first build as specified above, then run:

mvn -f testsuite/utils/pom.xml exec:java -Pkeycloak-server 

To start Keycloak from the server distribution first build the distribution it as specified above, then run:

tar xfz distribution/server-dist/target/keycloak-<VERSION>.tar.gz
cd keycloak-<VERSION>
bin/standalone.sh

To stop the server press Ctrl + C.

Reporting security vulnerabilities

If you've found a security vulnerability, please look at the instructions on how to properly report it

Help and Documentation

  • Documentation - User Guide, Admin REST API and Javadocs
  • User Mailing List - Mailing list to ask for help and general questions about Keycloak
  • JIRA - Issue tracker for bugs and feature requests

Contributing

License