You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Nixon Rodrigues <ni...@freestoneinfotech.com> on 2019/10/23 14:36:11 UTC

Re: Review Request 71637: ATLAS-3488 Update with Filebase auth password with ShaPasswordEncoder with salt

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71637/
-----------------------------------------------------------

(Updated Oct. 23, 2019, 2:36 p.m.)


Review request for atlas, Madhan Neethiraj, Nixon Rodrigues, Sarath Subramanian, and Vishal Suvagia.


Repository: atlas


Description
-------

This patch updates the password encoder for filebased authentication with Sha256PasswordEncoder with salt.

Updated the password in user-credentials file.


Also added utility generate password with Sha256 encoding with Salt.

 bin $ ./cputil.py -g -u admin -p admin

Your encrypted Password is  : a4a88c0872bf652bb9ed803ece5fd6e82354838a9bf59ab4babb1dab322154e1


Diffs
-----

  addons/falcon-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/hbase-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/hive-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/impala-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/kafka-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/sqoop-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/storm-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  distro/src/conf/users-credentials.properties 3fc3bb172 
  intg/src/test/resources/users-credentials.properties 3fc3bb172 
  webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java e9fd2044a 
  webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c 
  webapp/src/main/java/org/apache/atlas/web/security/AtlasFileAuthenticationProvider.java f177fd4ee 
  webapp/src/test/java/org/apache/atlas/web/security/FileAuthenticationTest.java fe2060a2b 
  webapp/src/test/resources/users-credentials.properties 3fc3bb172 


Diff: https://reviews.apache.org/r/71637/diff/2/


Testing
-------

tested Atlas login with valid and invalid username/password.


https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1488/console


Thanks,

Nixon Rodrigues


Re: Review Request 71637: ATLAS-3488 Update with Filebase auth password with ShaPasswordEncoder with salt

Posted by Sarath Subramanian <sa...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71637/#review218369
-----------------------------------------------------------




webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 33 (patched)
<https://reviews.apache.org/r/71637/#comment306055>

    remove unused import



webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 78 (patched)
<https://reviews.apache.org/r/71637/#comment306056>

    nit: remove additional new line



webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 109 (patched)
<https://reviews.apache.org/r/71637/#comment306057>

    nit: }catch  => } catch



webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java
Lines 24 (patched)
<https://reviews.apache.org/r/71637/#comment306058>

    remove unused imports 24 and 25



webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java
Lines 141 (patched)
<https://reviews.apache.org/r/71637/#comment306054>

    nit: delete additional new lines 141, 142


- Sarath Subramanian


On Oct. 23, 2019, 7:36 a.m., Nixon Rodrigues wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71637/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2019, 7:36 a.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj, Nixon Rodrigues, Sarath Subramanian, and Vishal Suvagia.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch updates the password encoder for filebased authentication with Sha256PasswordEncoder with salt.
> 
> Updated the password in user-credentials file.
> 
> 
> Also added utility generate password with Sha256 encoding with Salt.
> 
>  bin $ ./cputil.py -g -u admin -p admin
> 
> Your encrypted Password is  : a4a88c0872bf652bb9ed803ece5fd6e82354838a9bf59ab4babb1dab322154e1
> 
> 
> Diffs
> -----
> 
>   addons/falcon-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/hbase-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/hive-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/impala-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/kafka-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/sqoop-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/storm-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   distro/src/conf/users-credentials.properties 3fc3bb172 
>   intg/src/test/resources/users-credentials.properties 3fc3bb172 
>   webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java e9fd2044a 
>   webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c 
>   webapp/src/main/java/org/apache/atlas/web/security/AtlasFileAuthenticationProvider.java f177fd4ee 
>   webapp/src/test/java/org/apache/atlas/web/security/FileAuthenticationTest.java fe2060a2b 
>   webapp/src/test/resources/users-credentials.properties 3fc3bb172 
> 
> 
> Diff: https://reviews.apache.org/r/71637/diff/2/
> 
> 
> Testing
> -------
> 
> tested Atlas login with valid and invalid username/password.
> 
> 
> https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1488/console
> 
> 
> Thanks,
> 
> Nixon Rodrigues
> 
>


Re: Review Request 71637: ATLAS-3488 Update with Filebase auth password with ShaPasswordEncoder with salt

Posted by Ashutosh Mestry via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71637/#review218357
-----------------------------------------------------------




webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 80 (patched)
<https://reviews.apache.org/r/71637/#comment306046>

    Refactor: Extract method, createOptions. This method will encapsulate all manipulations related to Options.



webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java
Lines 138 (patched)
<https://reviews.apache.org/r/71637/#comment306048>

    Refactor: Rename parameter loginId to salt.



webapp/src/test/java/org/apache/atlas/web/security/FileAuthenticationTest.java
Line 86 (original), 86 (patched)
<https://reviews.apache.org/r/71637/#comment306047>

    Add test that processes password in old format.


- Ashutosh Mestry


On Oct. 23, 2019, 2:36 p.m., Nixon Rodrigues wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71637/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2019, 2:36 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj, Nixon Rodrigues, Sarath Subramanian, and Vishal Suvagia.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch updates the password encoder for filebased authentication with Sha256PasswordEncoder with salt.
> 
> Updated the password in user-credentials file.
> 
> 
> Also added utility generate password with Sha256 encoding with Salt.
> 
>  bin $ ./cputil.py -g -u admin -p admin
> 
> Your encrypted Password is  : a4a88c0872bf652bb9ed803ece5fd6e82354838a9bf59ab4babb1dab322154e1
> 
> 
> Diffs
> -----
> 
>   addons/falcon-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/hbase-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/hive-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/impala-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/kafka-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/sqoop-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/storm-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   distro/src/conf/users-credentials.properties 3fc3bb172 
>   intg/src/test/resources/users-credentials.properties 3fc3bb172 
>   webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java e9fd2044a 
>   webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c 
>   webapp/src/main/java/org/apache/atlas/web/security/AtlasFileAuthenticationProvider.java f177fd4ee 
>   webapp/src/test/java/org/apache/atlas/web/security/FileAuthenticationTest.java fe2060a2b 
>   webapp/src/test/resources/users-credentials.properties 3fc3bb172 
> 
> 
> Diff: https://reviews.apache.org/r/71637/diff/2/
> 
> 
> Testing
> -------
> 
> tested Atlas login with valid and invalid username/password.
> 
> 
> https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1488/console
> 
> 
> Thanks,
> 
> Nixon Rodrigues
> 
>


Re: Review Request 71637: ATLAS-3488 Update with Filebase auth password with ShaPasswordEncoder with salt

Posted by Nixon Rodrigues <ni...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71637/
-----------------------------------------------------------

(Updated Oct. 30, 2019, 9:40 a.m.)


Review request for atlas, Madhan Neethiraj, Nixon Rodrigues, Sarath Subramanian, and Vishal Suvagia.


Changes
-------

Update patch with review comments from Madhan.


Bugs: ATLAS-3488
    https://issues.apache.org/jira/browse/ATLAS-3488


Repository: atlas


Description
-------

This patch updates the password encoder for filebased authentication with Sha256PasswordEncoder with salt.

Updated the password in user-credentials file.


Also added utility generate password with Sha256 encoding with Salt.

 bin $ ./cputil.py -g -u admin -p admin

Your encrypted Password is  : a4a88c0872bf652bb9ed803ece5fd6e82354838a9bf59ab4babb1dab322154e1


Diffs (updated)
-----

  addons/falcon-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/hbase-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/hive-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/impala-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/kafka-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/sqoop-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/storm-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  distro/src/conf/users-credentials.properties 3fc3bb172 
  intg/src/test/resources/users-credentials.properties 3fc3bb172 
  webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java e9fd2044a 
  webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c 
  webapp/src/main/java/org/apache/atlas/web/security/AtlasFileAuthenticationProvider.java f177fd4ee 
  webapp/src/test/java/org/apache/atlas/web/security/FileAuthenticationTest.java fe2060a2b 
  webapp/src/test/resources/users-credentials.properties 3fc3bb172 


Diff: https://reviews.apache.org/r/71637/diff/4/

Changes: https://reviews.apache.org/r/71637/diff/3-4/


Testing
-------

tested Atlas login with valid and invalid username/password.
tested Atlas login with valid user and v1 password.


https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1488/console


Thanks,

Nixon Rodrigues


Re: Review Request 71637: ATLAS-3488 Update with Filebase auth password with ShaPasswordEncoder with salt

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71637/#review218391
-----------------------------------------------------------


Fix it, then Ship it!





webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 99 (patched)
<https://reviews.apache.org/r/71637/#comment306102>

    "as input usage:" => "as input. Usage:"


- Madhan Neethiraj


On Oct. 24, 2019, 6:45 p.m., Nixon Rodrigues wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71637/
> -----------------------------------------------------------
> 
> (Updated Oct. 24, 2019, 6:45 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj, Nixon Rodrigues, Sarath Subramanian, and Vishal Suvagia.
> 
> 
> Bugs: ATLAS-3488
>     https://issues.apache.org/jira/browse/ATLAS-3488
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch updates the password encoder for filebased authentication with Sha256PasswordEncoder with salt.
> 
> Updated the password in user-credentials file.
> 
> 
> Also added utility generate password with Sha256 encoding with Salt.
> 
>  bin $ ./cputil.py -g -u admin -p admin
> 
> Your encrypted Password is  : a4a88c0872bf652bb9ed803ece5fd6e82354838a9bf59ab4babb1dab322154e1
> 
> 
> Diffs
> -----
> 
>   addons/falcon-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/hbase-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/hive-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/impala-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/kafka-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/sqoop-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/storm-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   distro/src/conf/users-credentials.properties 3fc3bb172 
>   intg/src/test/resources/users-credentials.properties 3fc3bb172 
>   webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java e9fd2044a 
>   webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c 
>   webapp/src/main/java/org/apache/atlas/web/security/AtlasFileAuthenticationProvider.java f177fd4ee 
>   webapp/src/test/java/org/apache/atlas/web/security/FileAuthenticationTest.java fe2060a2b 
>   webapp/src/test/resources/users-credentials.properties 3fc3bb172 
> 
> 
> Diff: https://reviews.apache.org/r/71637/diff/3/
> 
> 
> Testing
> -------
> 
> tested Atlas login with valid and invalid username/password.
> tested Atlas login with valid user and v1 password.
> 
> 
> https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1488/console
> 
> 
> Thanks,
> 
> Nixon Rodrigues
> 
>


Re: Review Request 71637: ATLAS-3488 Update with Filebase auth password with ShaPasswordEncoder with salt

Posted by Nixon Rodrigues <ni...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71637/
-----------------------------------------------------------

(Updated Oct. 24, 2019, 6:45 p.m.)


Review request for atlas, Madhan Neethiraj, Nixon Rodrigues, Sarath Subramanian, and Vishal Suvagia.


Changes
-------

Addressed Review comments by Madhan, Ashutosh & Sarath.

Added fallback for authentication with v1 passwords.
Added testcase for v1 password.


Bugs: ATLAS-3488
    https://issues.apache.org/jira/browse/ATLAS-3488


Repository: atlas


Description
-------

This patch updates the password encoder for filebased authentication with Sha256PasswordEncoder with salt.

Updated the password in user-credentials file.


Also added utility generate password with Sha256 encoding with Salt.

 bin $ ./cputil.py -g -u admin -p admin

Your encrypted Password is  : a4a88c0872bf652bb9ed803ece5fd6e82354838a9bf59ab4babb1dab322154e1


Diffs (updated)
-----

  addons/falcon-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/hbase-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/hive-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/impala-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/kafka-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/sqoop-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  addons/storm-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
  distro/src/conf/users-credentials.properties 3fc3bb172 
  intg/src/test/resources/users-credentials.properties 3fc3bb172 
  webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java e9fd2044a 
  webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c 
  webapp/src/main/java/org/apache/atlas/web/security/AtlasFileAuthenticationProvider.java f177fd4ee 
  webapp/src/test/java/org/apache/atlas/web/security/FileAuthenticationTest.java fe2060a2b 
  webapp/src/test/resources/users-credentials.properties 3fc3bb172 


Diff: https://reviews.apache.org/r/71637/diff/3/

Changes: https://reviews.apache.org/r/71637/diff/2-3/


Testing (updated)
-------

tested Atlas login with valid and invalid username/password.
tested Atlas login with valid user and v1 password.


https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1488/console


Thanks,

Nixon Rodrigues


Re: Review Request 71637: ATLAS-3488 Update with Filebase auth password with ShaPasswordEncoder with salt

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71637/#review218355
-----------------------------------------------------------




webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 83 (patched)
<https://reviews.apache.org/r/71637/#comment306042>

    nit: please remove empty line #83.



webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 93 (patched)
<https://reviews.apache.org/r/71637/#comment306039>

    nit: please remove empty line #93.



webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 97 (patched)
<https://reviews.apache.org/r/71637/#comment306040>

    nit:
     - "if(userName!=null) => "if (userName != null"
     - "password!=null )" => "password != null)"



webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 102 (patched)
<https://reviews.apache.org/r/71637/#comment306041>

    nit: "}else{" => "} else {"



webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 103 (patched)
<https://reviews.apache.org/r/71637/#comment306038>

    "usage:-" => "usage:"



webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
Lines 110 (patched)
<https://reviews.apache.org/r/71637/#comment306043>

    nit: '"+e.getMessage()' => '" + e.getMessage()'



webapp/src/main/java/org/apache/atlas/web/security/AtlasFileAuthenticationProvider.java
Line 67 (original), 66 (patched)
<https://reviews.apache.org/r/71637/#comment306045>

    Once this patch is applied, login attempts with existing entries in user-credentials file will fail - since  the entries would have password encrypted with earlier  approach. For backward compatibility, consider validation using earlier approach before failing the login attempt. It will be useful control is via a configuration - like:
       "atlas.authentication.method.file.v1-validation.enabled=true"
      
      String  encodedPassword = UserDao.encrypt(password, username);
      boolean isValidPassword = encodedPassword.equals(user.getPassword());
      
      if (!isValidPassword  && v1ValidationEnabled)) {
        encodedPassword = UserDao.getSha256Hash(password);
    
        isValidPassword = encodedPassword.equals(user.getPassword());
      }
      
      if (!isValidPassword) {
        logger.error("Wrong password " + username);
    
        throw new BadCredentialsException("Wrong password");
      }


- Madhan Neethiraj


On Oct. 23, 2019, 2:36 p.m., Nixon Rodrigues wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71637/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2019, 2:36 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj, Nixon Rodrigues, Sarath Subramanian, and Vishal Suvagia.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch updates the password encoder for filebased authentication with Sha256PasswordEncoder with salt.
> 
> Updated the password in user-credentials file.
> 
> 
> Also added utility generate password with Sha256 encoding with Salt.
> 
>  bin $ ./cputil.py -g -u admin -p admin
> 
> Your encrypted Password is  : a4a88c0872bf652bb9ed803ece5fd6e82354838a9bf59ab4babb1dab322154e1
> 
> 
> Diffs
> -----
> 
>   addons/falcon-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/hbase-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/hive-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/impala-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/kafka-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/sqoop-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   addons/storm-bridge/src/test/resources/users-credentials.properties 3fc3bb172 
>   distro/src/conf/users-credentials.properties 3fc3bb172 
>   intg/src/test/resources/users-credentials.properties 3fc3bb172 
>   webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java e9fd2044a 
>   webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c 
>   webapp/src/main/java/org/apache/atlas/web/security/AtlasFileAuthenticationProvider.java f177fd4ee 
>   webapp/src/test/java/org/apache/atlas/web/security/FileAuthenticationTest.java fe2060a2b 
>   webapp/src/test/resources/users-credentials.properties 3fc3bb172 
> 
> 
> Diff: https://reviews.apache.org/r/71637/diff/2/
> 
> 
> Testing
> -------
> 
> tested Atlas login with valid and invalid username/password.
> 
> 
> https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1488/console
> 
> 
> Thanks,
> 
> Nixon Rodrigues
> 
>