Upgrade 20.04, twistcli Status: 401 Unauthorized

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Upgrade 20.04, twistcli Status: 401 Unauthorized

L3 Networker

Given upgrade Prisma Cloud SaaS from 19.11 to 20.04

And Administrator role

And old API key deactivated

And new API key created

And new twistlock binary downloaded to workstation

When I invoke twistcli images scan --token $token --details --address https://us-east1.cloud.twistlock.com/us-1-111574323 iarcgisserver:latest

Then it replies Status: 401 Unauthorized
GET https://us-east1.cloud.twistlock.com/us-1-111574323/api/v1/version failed.
Error:

However, Given the same criteria above

When I invoke curl --request GET --url https://us-east1.cloud.twistlock.com/us-1-111574323/api/v1/version --header 'accept: application/json; charset=UTF-8' --header "x-redlock-auth: $token"
Then it replies "20.04.163"

 

What am I doing wrong?

 

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org
1 accepted solution

Accepted Solutions

L3 Networker

Can I recognize this problem and its solution?

 

twistlock apis SUCCEED to authorize with prisma cloud token

curl --request POST \
--url https://api.prismacloud.io/login \
--header 'accept: application/json; charset=UTF-8' \
--header 'content-type: application/json; charset=UTF-8' \
--data '{"username":"ur_key","password":"ur_secret","customerName":"ur_mnemonic"}'

twistcli FAIL to authorize with prisma cloud token, you must use a twistlock token.

curl -sk https://us-east1.cloud.twistlock.com/us-1-111574323/api/v1/authenticate -H 'Content-Type: application/json' -d '{"username":"ur_key","password":"ur_secret"}'

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org

View solution in original post

2 REPLIES 2

L3 Networker

Can I recognize this problem and its solution?

 

twistlock apis SUCCEED to authorize with prisma cloud token

curl --request POST \
--url https://api.prismacloud.io/login \
--header 'accept: application/json; charset=UTF-8' \
--header 'content-type: application/json; charset=UTF-8' \
--data '{"username":"ur_key","password":"ur_secret","customerName":"ur_mnemonic"}'

twistcli FAIL to authorize with prisma cloud token, you must use a twistlock token.

curl -sk https://us-east1.cloud.twistlock.com/us-1-111574323/api/v1/authenticate -H 'Content-Type: application/json' -d '{"username":"ur_key","password":"ur_secret"}'

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org

L0 Member

 

If you are downloading `twistcli` make sure you have the right API endpoints. Use /.../api/v.../authenticate on the specific instance relevant to your tenant.

 

https://europe-west3.cloud.twistlock.com/eu-2-143566881/api/v30.02/util/arm64/twistcli and https://europe-west3.cloud.twistlock.com/eu-2-143566881/api/v30.02/util/twistcli
download successfully with the Authorization: header.

 

Authorization: Bearer <jwt>

  • 1 accepted solution
  • 7449 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!