[SRU] Error validating X-Service-Token
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Ubuntu Cloud Archive | Status tracked in Bobcat | |||||
Antelope |
Fix Released
|
Undecided
|
Unassigned | |||
Bobcat |
Fix Released
|
Undecided
|
Unassigned | |||
Ussuri |
Fix Committed
|
High
|
Unassigned | |||
Victoria |
Fix Committed
|
High
|
Unassigned | |||
Wallaby |
Fix Committed
|
High
|
Unassigned | |||
Xena |
Fix Committed
|
High
|
Unassigned | |||
Yoga |
Fix Committed
|
High
|
Unassigned | |||
Zed |
Fix Committed
|
High
|
Unassigned | |||
keystonemiddleware |
Fix Released
|
Undecided
|
Jorge Merlino | |||
python-keystonemiddleware (Ubuntu) | Status tracked in Mantic | |||||
Focal |
Fix Committed
|
High
|
Unassigned | |||
Jammy |
Fix Committed
|
High
|
Unassigned | |||
Lunar |
Fix Released
|
Undecided
|
Unassigned | |||
Mantic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
This bug can cause a race condition for long running services that reuse their token (eg. Kubernetes Cinder CSI plugin) when the following occurs:
1 [service] Asks nova to attach a volume to a server
2 ...the user's token expires
3 [service] Asks cinder if the volume has been attached
4 [nova] Asks cinder to attach the volume
In step 3 the token is marked as invalid in the cache and step 4 fails even if the token is accompanied by a valid service token. The key is that step 3 has to happen before step 4 which is not frequent hence the race condition.
Also, the client will ask for a new user token if it is not authorized in the calls in steps 1 or 3 but if the token is marked as invalid in step 3 then step 4 fails and the volume becomes stuck in "detaching" status.
[Test Plan]
It hard to reproduce this bug as it depends on the timing of packets and the token expiration. I was able to reproduce by reducing the token expiration to 60 seconds and running a go script that is constantly attaching and detaching volumes. Even then it may take some time for the bug to occur.
The code used is here: https:/
The openstack auth information should be set in lines 99-105 and then the script should be called with 3 parameters: the id of a volume and the ids of two servers. The script attaches and detaches the volume between those two servers.
[Where problems could occur]
The patch removes code that work as an optimization in order to save the time needed for rechecking invalid tokens. So it should not add problems beside the loss of the optimization. The new code will return all tokens from the cache for validation instead of throwing an exception. If the token is actually invalid it will be detected later on.
tags: | added: sts |
description: | updated |
description: | updated |
Changed in keystonemiddleware: | |
assignee: | nobody → Jorge Merlino (jorge-merlino) |
Changed in python-keystonemiddleware (Ubuntu Mantic): | |
status: | New → Fix Released |
Changed in python-keystonemiddleware (Ubuntu Lunar): | |
status: | New → Fix Released |
description: | updated |
description: | updated |
summary: |
- Error validating X-Service-Token + [SRU] Error validating X-Service-Token |
Changed in python-keystonemiddleware (Ubuntu Jammy): | |
importance: | Undecided → High |
status: | In Progress → Triaged |
Changed in python-keystonemiddleware (Ubuntu Focal): | |
importance: | Undecided → High |
status: | New → Triaged |
Fix proposed to branch: master /review. opendev. org/c/openstack /keystonemiddle ware/+/ 860481
Review: https:/