Design proposal to Non-Interactive password update for REST client
This email is about openbmc/openbmc#1714 ( REST API to update root password )
Goal is to do Non-interactive password updates to enable a REST client to update the root password.
My proposal is to use getspent(3) and putspent(3) and here is the flow.
REST client will provide a method that takes std::string as parameter.
The Provider at the BMC will receive the password and does these:
- Executes getspent(3) for "root" and gets the entries.
- Parses the sp_pwdp and extracts encryption method , salt.
- Makes a call to crypt(3) with the extracted salt and `user
input` and generates encrypted pass-code
- Populates the structure and calls putspent(3) to update the password
Please let me know your opinion on this.
Thank you,
!! Vishwa !!
Could chpasswd be used for that?
________________________________
From: openbmc <[email protected]> on behalf of vishwa <[email protected]>
Sent: Friday, August 11, 2017 11:18:48 AM
To: OpenBMC Maillist
Subject: Design proposal to Non-Interactive password update for REST client
This email is about openbmc/openbmc#1714 ( REST API to update root password )
Goal is to do Non-interactive password updates to enable a REST client to update the root password.
My proposal is to use getspent(3) and putspent(3) and here is the flow.
REST client will provide a method that takes std::string as parameter.
The Provider at the BMC will receive the password and does these:
- Executes getspent(3) for "root" and gets the entries.
- Parses the sp_pwdp and extracts encryption method , salt.
- Makes a call to crypt(3) with the extracted salt and `user
input` and generates encrypted pass-code
- Populates the structure and calls putspent(3) to update the password
Please let me know your opinion on this.
Thank you,
!! Vishwa !!
Sorry, I should have mentioned that I had looked at that option.
For chpasswd, I need to fork a process but with putspent I can do in same process.
Quoted 32 lines · Kenneth Wilke
Could chpasswd be used for that?
------------------------------------------------------------------------
*From:* openbmc <[email protected]> on behalf of vishwa <[email protected]> *Sent:* Friday, August 11, 2017 11:18:48 AM
*To:* OpenBMC Maillist
*Subject:* Design proposal to Non-Interactive password update for REST client
This email is about openbmc/openbmc#1714 ( REST API to update root
password )Goal is to do Non-interactive password updates to enable a REST client to update the root password.
My proposal is to use
getspent(3)andputspent(3)and here is the flow.REST client will provide a method that takes
std::stringas parameter.The Provider at the BMC will receive the password and does these:
- Executes
getspent(3)for "root" and gets the entries.
- Parses thesp_pwdpand extractsencryption method,salt.
- Makes a call tocrypt(3)with the extractedsaltand `user
input` and generates encrypted pass-code
- Populates the structure and callsputspent(3)to update the passwordPlease let me know your opinion on this.
Thank you,
!! Vishwa !!
Makes sense, sounds like a good route to me
________________________________
From: vishwa <[email protected]>
Sent: Friday, August 11, 2017 12:11:01 PM
To: Kenneth Wilke; OpenBMC Maillist
Subject: Re: Design proposal to Non-Interactive password update for REST client
Sorry, I should have mentioned that I had looked at that option.
For chpasswd, I need to fork a process but with putspent I can do in same process.
On 08/11/2017 10:20 PM, Kenneth Wilke wrote:
Could chpasswd be used for that?
________________________________
From: openbmc <[email protected]><mailto:[email protected]> on behalf of vishwa <[email protected]><mailto:[email protected]>
Sent: Friday, August 11, 2017 11:18:48 AM
To: OpenBMC Maillist
Subject: Design proposal to Non-Interactive password update for REST client
This email is about openbmc/openbmc#1714 ( REST API to update root password )
Goal is to do Non-interactive password updates to enable a REST client to update the root password.
My proposal is to use getspent(3) and putspent(3) and here is the flow.
REST client will provide a method that takes std::string as parameter.
The Provider at the BMC will receive the password and does these:
- Executes getspent(3) for "root" and gets the entries.
- Parses the sp_pwdp and extracts encryption method , salt.
- Makes a call to crypt(3) with the extracted salt and `user
input` and generates encrypted pass-code
- Populates the structure and calls putspent(3) to update the password
Please let me know your opinion on this.
Thank you,
!! Vishwa !!
Quoted 6 lines · vishwa
This email is about openbmc/openbmc#1714 ( REST API to update root password )
Goal is to do Non-interactive password updates to enable a REST client to update the root password.
Quoted 7 lines
My proposal is to use
getspent(3)andputspent(3)and here is the flow.REST client will provide a method that takes
std::stringas parameter.The Provider at the BMC will receive the password and does these:
- Executes
getspent(3)for "root" and gets the entries.
Make sure you're using getspent_r for this.
Should be done based on any user, not just 'root'. We might only support 'root' now but will want to easily add support for other users in the near future.
Quoted 1 line
- Parses the
sp_pwdpand extractsencryption method,salt.
Is there a portable way to do this? Is there any library that exists already?
Tom and I spoke previously about a possible non-standard crypt algorithm in order to satisfy some of the requirements of IPMI RMCP+'s authentication protocol without storing plaintext passwords. Please follow up with him and see if what you are proposing here will mesh with what he was planning.
Quoted 2 lines
- Makes a call to
crypt(3)with the extractedsaltand `user
input` and generates encrypted pass-code
The salt can/should be random for each password, shouldn't it? It sounds like you are attempting to reuse the salt from the previous password and that is not required nor preferred to the best of my knowledge.
Quoted 8 lines
- Populates the structure and calls
putspent(3)to update the passwordPlease let me know your opinion on this.
Thank you,
!! Vishwa !!
Signature · 1 line
Patrick Williams
Quoted 7 lines · Patrick Williams
Quoted 6 lines · vishwa
This email is about openbmc/openbmc#1714 ( REST API to update root password )
Goal is to do Non-interactive password updates to enable a REST client to update the root password.
Quoted 8 lines
Quoted 7 lines
My proposal is to use
getspent(3)andputspent(3)and here is the flow.REST client will provide a method that takes
std::stringas parameter.The Provider at the BMC will receive the password and does these:
- Executes
getspent(3)for "root" and gets the entries.Make sure you're using
getspent_rfor this.
Sure
Quoted 4 lines
Should be done based on any user, not just 'root'. We might only support 'root' now but will want to easily add support for other users in the near future.
Okay. I will have [User] and [Password] in the yaml.
Quoted 3 lines
Quoted 1 line
- Parses the
sp_pwdpand extractsencryption method,salt.Is there a portable way to do this? Is there any library that exists already?
I tried to look for that and did not find. I will continue looking.
Quoted 5 lines
Tom and I spoke previously about a possible non-standard crypt algorithm in order to satisfy some of the requirements of IPMI RMCP+'s authentication protocol without storing plaintext passwords. Please follow up with him and see if what you are proposing here will mesh with what he was planning.
I told Tom about this and he would get back to me.
BTW, I put the proposal of using crypt() after looking at:
https://github.com/shadow-maint/shadow/blob/master/src/passwd.c#L245
and
https://github.com/shadow-maint/shadow/blob/6fbc11ce2178205968c37853db752729359c9893/lib/encrypt.c
Quoted 7 lines
Quoted 2 lines
- Makes a call to
crypt(3)with the extractedsaltand `user
input` and generates encrypted pass-codeThe salt can/should be random for each password, shouldn't it? It sounds like you are attempting to reuse the salt from the previous password and that is not required nor preferred to the best of my knowledge.
Okay. I can generate a random string from [a-zA-Z0-9./] as needed by crypt()
Quoted 8 lines
Quoted 8 lines
- Populates the structure and calls
putspent(3)to update the passwordPlease let me know your opinion on this.
Thank you,
!! Vishwa !!
Tom and I talked and we should be fine with my current proposal.
Here is what we talked:
There would be a new encryption algorithm which would be denoted by some number ( Like 1 is for MD5 ) and crypt(3) would be enhanced to handle that. Since my proposal does not interpret the number and uses AS IS to generate the hash, we should be fine.
Quoted 62 lines · vishwa
Quoted 7 lines · Patrick Williams
Quoted 6 lines · vishwa
This email is about openbmc/openbmc#1714 ( REST API to update root password )
Goal is to do Non-interactive password updates to enable a REST client to update the root password.
Quoted 8 lines
Quoted 7 lines
My proposal is to use
getspent(3)andputspent(3)and here is the flow.REST client will provide a method that takes
std::stringas parameter.The Provider at the BMC will receive the password and does these:
- Executes
getspent(3)for "root" and gets the entries.Make sure you're using
getspent_rfor this.Sure
Quoted 4 lines
Should be done based on any user, not just 'root'. We might only support 'root' now but will want to easily add support for other users in the near future.
Okay. I will have [User] and [Password] in the yaml.
Quoted 3 lines
Quoted 1 line
- Parses the
sp_pwdpand extractsencryption method,salt.Is there a portable way to do this? Is there any library that exists already?
I tried to look for that and did not find. I will continue looking.
Quoted 5 lines
Tom and I spoke previously about a possible non-standard crypt algorithm in order to satisfy some of the requirements of IPMI RMCP+'s authentication protocol without storing plaintext passwords. Please follow up with him and see if what you are proposing here will mesh with what he was planning.
I told Tom about this and he would get back to me.
BTW, I put the proposal of using
crypt()after looking at:https://github.com/shadow-maint/shadow/blob/master/src/passwd.c#L245
and
https://github.com/shadow-maint/shadow/blob/6fbc11ce2178205968c37853db752729359c9893/lib/encrypt.c
Quoted 7 lines
Quoted 2 lines
- Makes a call to
crypt(3)with the extractedsaltand `user
input` and generates encrypted pass-codeThe salt can/should be random for each password, shouldn't it? It sounds like you are attempting to reuse the salt from the previous password and that is not required nor preferred to the best of my knowledge.
Okay. I can generate a random string from [a-zA-Z0-9./] as needed by
crypt()Quoted 9 lines
Quoted 9 lines
- Populates the structure and calls
putspent(3)to update the
passwordPlease let me know your opinion on this.
Thank you,
!! Vishwa !!
If the non-standard crypt algorithm is supported, then the /etc/security/policy.conf would have be updated with a custom identifier. The custom crypt algorithm would interpret the id appropriately and invoke the custom algorithm to generated the hash.
In the current implementation, it doesn't seem to have a way to plugin a custom algorithm to the standard crypt function.
https://docs.oracle.com/cd/E23824_01/html/821-1456/secsys-15.html
Quoted 70 lines · vishwa
Tom and I talked and we should be fine with my current proposal.
Here is what we talked:
There would be a new encryption algorithm which would be denoted by some number ( Like 1 is for MD5 ) and crypt(3) would be enhanced to handle that. Since my proposal does not interpret the number and uses AS IS to generate the hash, we should be fine.
Quoted 62 lines · vishwa
Quoted 7 lines · Patrick Williams
Quoted 6 lines · vishwa
This email is about openbmc/openbmc#1714 ( REST API to update root password )
Goal is to do Non-interactive password updates to enable a REST client to update the root password.
Quoted 8 lines
Quoted 7 lines
My proposal is to use
getspent(3)andputspent(3)and here is the flow.REST client will provide a method that takes
std::stringas parameter.The Provider at the BMC will receive the password and does these:
- Executes
getspent(3)for "root" and gets the entries.Make sure you're using
getspent_rfor this.Sure
Quoted 4 lines
Should be done based on any user, not just 'root'. We might only support 'root' now but will want to easily add support for other users in the near future.
Okay. I will have [User] and [Password] in the yaml.
Quoted 3 lines
Quoted 1 line
- Parses the
sp_pwdpand extractsencryption method,salt.Is there a portable way to do this? Is there any library that exists already?
I tried to look for that and did not find. I will continue looking.
Quoted 5 lines
Tom and I spoke previously about a possible non-standard crypt algorithm in order to satisfy some of the requirements of IPMI RMCP+'s authentication protocol without storing plaintext passwords. Please follow up with him and see if what you are proposing here will mesh with what he was planning.
I told Tom about this and he would get back to me.
BTW, I put the proposal of using
crypt()after looking at:and
Quoted 7 lines
Quoted 2 lines
- Makes a call to
crypt(3)with the extractedsaltand `user
input` and generates encrypted pass-codeThe salt can/should be random for each password, shouldn't it? It sounds like you are attempting to reuse the salt from the previous password and that is not required nor preferred to the best of my knowledge.
Okay. I can generate a random string from [a-zA-Z0-9./] as needed by
crypt()Quoted 9 lines
Quoted 9 lines
- Populates the structure and calls
putspent(3)to update the
passwordPlease let me know your opinion on this.
Thank you,
!! Vishwa !!
Tom and I talked and my current proposal would still be fine per the discussion as the idea is to have crypt() link to custom crypto lib.