Splunk Observability Cloud

How to rotate a token that is expiring

ianmac
New Member

We have some tokens that are due to expire shortly.

Q1: Does the 'Default' token automatically rotate?

Q2: How do you manually rotate a token using the dashboard? (I am aware of the API option)

Q3: If the API call is the only option, what permissions are required to make the 'rotate' API call?

Thanks in anticipation.

Ian

Labels (1)
Tags (2)
0 Karma

bishida
Splunk Employee
Splunk Employee

Q1: Tokens do NOT automatically rotate.

Q2: Currently, you must use the API. There is not a way to do it in the GUI.

Q3: You must be an admin to rotate a token.

Help Rotating a Token
1) settings -> view profile -> show user api access token (This is your personal API token. You must be an admin to continue.)
2) copy your user api token
3) go to settings -> access tokens and identify the token that should be updated (such as Default)
    - Make a note of what the current value of your secret is.
4) Run a curl command from your desktop computer:
    - Note: 604800 seconds is 7 days. Using a graceful value allows the old and new secret to be valid for a short term so your secret update doesn't cause any disruption.
    - Replace YOUR-REALM with your organization's realm, such as us0, us1, eu0, etc.
    - Replace YOUR-TOKEN-NAME with the name of the token you want to rotate (such as Default)
    - Replace YOUR-USER-API-TOKEN that you noted in step 2.
 
curl -X  POST "https://api.YOUR-REALM.signalfx.com/v2/token/YOUR-TOKEN-NAME/rotate?graceful=604800" -H "Content-type: application/json" -H "X-SF-TOKEN: YOUR-USER-API-TOKEN"
 
Now your token can keep the same name, the expiration date will be refreshed to a year from now, and the secret will be new. You must copy and paste the new secret in places where you're using this token (e.g., RUM instrumentation, or OTel collector splunk-otel-collector.conf file, or Windows env variables.) Be sure to restart any collectors where you update this token secret.
0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...