0

In my secrets folder I have these files

-rw-r--r--  1 root root  272 Oct  2 11:07 hudson.console.AnnotatedLargeText.consoleAnnotator
-rw-r--r--  1 root root   48 Sep 23 11:40 hudson.console.ConsoleNote.MAC
-rw-r--r--  1 root root   32 Sep 23 11:42 hudson.model.Job.serverCookie
-rw-r--r--  1 root root  272 Sep 23 11:39 hudson.util.Secret
-rw-r--r--  1 root root   32 Sep 23 11:16 jenkins.model.Jenkins.crumbSalt
-rw-r--r--  1 root root  256 Sep 23 11:16 master.key
-rw-r--r--  1 root root  272 Sep 23 11:16 org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
-rw-r--r--  1 root root  272 Sep 23 11:49 org.jenkinsci.plugins.workflow.log.ConsoleAnnotators.consoleAnnotator
-rw-r--r--  1 root root   48 Sep 23 11:39 org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices.mac

In my case hudson.utils.secrets is binary

od -h hudson.util.Secret 
0000000 5f25 eee1 0763 1b49 c074 ee22 af85 4e10
0000020 00cf dd32 b568 fae3 257a 8d6e 1e56 d995

I installed groovy,I looked at HOW TO DECRYPT FROM CREDENTIALS What should I do?

2
  • 1
    The question you linked to does in fact have an answer for this question. As documented in this answer, you can use the script console to fetch credentials from the credentials store before decrypting them; you don't have to find the credentials in the filesystem manually.
    – jayhendren
    Nov 18, 2022 at 17:14
  • 1
    Also, hudson.util.Secret, as far as I'm aware, does not have any secrets or credentials inside of it. Credentials are stored in credentials.xml, which is located one folder up from hudson.util.Secret.
    – jayhendren
    Nov 18, 2022 at 17:20

1 Answer 1

0

Jenkins uses string interpolation to take password as input and it uses AES to encrypt and protect secrets, credentials, and their respective encryption keys.

So, using direct or simple approach will not work. Although you can try to assign the password to a string variable and the print it in log it works in most the cases until the password itself is saved after encrypting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.