{"action":"created","issue":{"url":"https://api.github.com/repos/shinken-monitoring/mod-webui/issues/444","repository_url":"https://api.github.com/repos/shinken-monitoring/mod-webui","labels_url":"https://api.github.com/repos/shinken-monitoring/mod-webui/issues/444/labels{/name}","comments_url":"https://api.github.com/repos/shinken-monitoring/mod-webui/issues/444/comments","events_url":"https://api.github.com/repos/shinken-monitoring/mod-webui/issues/444/events","html_url":"https://github.com/shinken-monitoring/mod-webui/issues/444","id":131844698,"number":444,"title":"WebUI module doesn't support bcrypt in htpasswd mode","user":{"login":"TomaszUrugOlszewski","id":12463045,"avatar_url":"https://avatars.githubusercontent.com/u/12463045?v=3","gravatar_id":"","url":"https://api.github.com/users/TomaszUrugOlszewski","html_url":"https://github.com/TomaszUrugOlszewski","followers_url":"https://api.github.com/users/TomaszUrugOlszewski/followers","following_url":"https://api.github.com/users/TomaszUrugOlszewski/following{/other_user}","gists_url":"https://api.github.com/users/TomaszUrugOlszewski/gists{/gist_id}","starred_url":"https://api.github.com/users/TomaszUrugOlszewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomaszUrugOlszewski/subscriptions","organizations_url":"https://api.github.com/users/TomaszUrugOlszewski/orgs","repos_url":"https://api.github.com/users/TomaszUrugOlszewski/repos","events_url":"https://api.github.com/users/TomaszUrugOlszewski/events{/privacy}","received_events_url":"https://api.github.com/users/TomaszUrugOlszewski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-06T11:00:32Z","updated_at":"2016-02-09T04:53:52Z","closed_at":null,"body":"Hello,\r\n\r\nBasing on htpasswd help, and information on internet **bcrypt** is the most secure alghoritm (for sure better than md5). Sadly, at this moment it's not supported by WebUI2.\r\n\r\nIs it possible that in near future this feature will be added?\r\n\r\nIm not developer, but I tried to create some example implementation (POC).\r\n\r\n```\r\napt-get install python-bcrypt\r\napt-get install python-passlib\r\n```\r\n\r\n```\r\n--- /tmp/auth.py\t2016-02-06 10:03:18.852406336 +0000\r\n+++ /var/lib/shinken/modules/webui2/submodules/auth.py\t2016-02-06 10:55:40.699869530 +0000\r\n@@ -4,6 +4,7 @@\r\n \r\n import traceback\r\n import crypt\r\n+from passlib.hash import bcrypt\r\n from ..lib.md5crypt import apache_md5_crypt, unix_md5_crypt\r\n \r\n from shinken.log import logger\r\n@@ -92,6 +93,9 @@\r\n                     h = hash.split('$')\r\n                     magic = h[1]\r\n                     salt = h[2]\r\n+                elif hash[:4] == '$2y$':\r\n+                   h = hash.split('$')\r\n+                   magic = h[1]\r\n                 else:\r\n                     magic = None\r\n                     salt = hash[:2]\r\n@@ -102,6 +106,8 @@\r\n                         compute_hash = apache_md5_crypt(password, salt)\r\n                     elif magic == '1':\r\n                         compute_hash = unix_md5_crypt(password, salt)\r\n+                    elif magic == '2y':\r\n+                        compute_hash = bcrypt.verify(password, hash) and hash\r\n                     else:\r\n                         compute_hash = crypt.crypt(password, salt)\r\n                     if compute_hash == hash:\r\n``"},"comment":{"url":"https://api.github.com/repos/shinken-monitoring/mod-webui/issues/comments/181710404","html_url":"https://github.com/shinken-monitoring/mod-webui/issues/444#issuecomment-181710404","issue_url":"https://api.github.com/repos/shinken-monitoring/mod-webui/issues/444","id":181710404,"user":{"login":"mohierf","id":2932687,"avatar_url":"https://avatars.githubusercontent.com/u/2932687?v=3","gravatar_id":"","url":"https://api.github.com/users/mohierf","html_url":"https://github.com/mohierf","followers_url":"https://api.github.com/users/mohierf/followers","following_url":"https://api.github.com/users/mohierf/following{/other_user}","gists_url":"https://api.github.com/users/mohierf/gists{/gist_id}","starred_url":"https://api.github.com/users/mohierf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohierf/subscriptions","organizations_url":"https://api.github.com/users/mohierf/orgs","repos_url":"https://api.github.com/users/mohierf/repos","events_url":"https://api.github.com/users/mohierf/events{/privacy}","received_events_url":"https://api.github.com/users/mohierf/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T04:53:52Z","updated_at":"2016-02-09T04:53:52Z","body":"I will submit a PR with this modification soon ..."}}