salt-api user token lifetime?

173 views
Skip to first unread message

Heinz Meier

unread,
Jan 16, 2022, 6:17:50 AM1/16/22
to salt-...@googlegroups.com
Hi,

from the docs I learned that the salt-api used tokens to authentication for script automation. These tokens have a default lifetime of 12 h.

I want to trigger a salt-run from netbox. When I generate the token manually and add the token in netbox, this webhook will only work for 12 hours. After that I would have to generate a new token.

Is there any possibility to extend the lifetime of the token?

Michael

Phipps, Thomas

unread,
Jan 16, 2022, 1:27:35 PM1/16/22
to salt-...@googlegroups.com
you can create a token for your netbox system using https://docs.saltproject.io/en/latest/ref/runners/all/salt.runners.auth.html#salt.runners.auth.mk_token using token_expire to set a very long token time. token_expire being the number of seconds until the token expires.

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/CAFFTi_%2BimKJhrn%2B2GzwKqSmXAssrw-7itmsJpix4VQFM7dfN9g%40mail.gmail.com.

Anthony Martinet

unread,
Jan 17, 2022, 5:24:28 AM1/17/22
to salt-...@googlegroups.com
May I suggest using https://github.com/saltstack/pepper ?
This lib will deal with token & auth so you wouldnot need to worry about it.

-- Anthony Martinet


Reply all
Reply to author
Forward
0 new messages