dependency-track icon indicating copy to clipboard operation
dependency-track copied to clipboard

Reset admin password documentation

Open ioggstream opened this issue 1 year ago • 1 comments

Current Behavior

I was not able to find the documentation to reset the admin password.

Proposed Behavior

Document how to generate a ManagedPassword.

IF you are interested I could integrate the project documentation e.g., inserting the following example python script that does the job

from hashlib import sha512
import bcrypt

password = input("password: ")
prehash = sha512(password.encode()).hexdigest().encode()
salt = bcrypt.gensalt(rounds=14, prefix=b'2a')
phash = brcrypt.hashpw(prehash, salt)
print(phash)

Checklist

ioggstream avatar Mar 20 '24 15:03 ioggstream

Thanks a lot for your help. I was able to reset a lost dependency-track admin password thanks to your help. Still, I would like to mention a few mistakes in above script:

  • Line 0: the above Python required bcrypt module: pip install py-bcrypt
  • Line 5: the bcrypt.gensalt() function only takes one argument, and no = statement in the args.
  • Line 6: typo "bcrypt"

Here is what worked for me:

pip install py-bcrypt
python3
from hashlib import sha512
import bcrypt

password = input("password: ")
prehash = sha512(password.encode()).hexdigest().encode()
salt = bcrypt.gensalt(14)
phash = bcrypt.hashpw(prehash, salt)
print(phash)

redadrien avatar Jun 20 '24 12:06 redadrien