Nova sends an "X-Service-Token" header when "send_service_user_token" is disabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Undecided
|
Harshavardhan Metla |
Bug Description
Description
===========
In the interaction between nova-api and cinder, it is possible to enable the required check of service_user tokens.
When I try to explicitly turn off the sending of the user’s service token and enable the mandatory check of its availability on the receiving side, I do not get the expected error because the X-Service-Token header is still sent by nova-api.
Steps to reproduce
==================
cinder includes required token checking:
[keystone_
...
service_token_roles = admin
service_
in nova, token sending is explicitly disabled and the user service is not set:
[service_user]
send_service_
verification is performed on the example of the operation of volume attach:
openstack server add volume 0801102f-
Expected result
===============
with this configuration, error 401 is expected
Actual result
=============
no errors occur and the attach operation is successful.
multiple checks were made including the option to completely restart the servers
Environment
===========
CentOS 7
release: train
nova: 15.1.0
cinder: 5.0.0
Logs & Configs
==============
we intercept requests that go to the cinder port (8776) and we see that 192.168.50.81.49226 (which is the nova-api process) sends requests with the X-Service-Token header (which we previously disabled in nova.conf). Full log (req/res) of adding volume in attachment.
[root@centos ~]# tcpdump -i enp2s0f0 -n -S -s 1024 -A 'tcp dst port 8776'
06:20:21.870330 IP 192.168.50.81.49226 > 192.168.50.80.8776: Flags [P.], seq 1696694971:
E....5@
.9/..7..GET /v3/27c47772a3f
Host: 192.168.50.80:8776
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: application/json
User-Agent: python-cinderclient
X-Service-Token: gAAAAABeMrv1SxD
X-Auth-Token: gAAAAABeMrv0vSJ
X-OpenStack-
06:20:22.184182 IP 192.168.50.81.49226 > 192.168.50.80.8776: Flags [.], ack 922606483, win 65, options [nop,nop,TS val 3748036 ecr 3644604], length 0
E..4.6@
.90..7..
06:20:22.547486 IP 192.168.50.81.49226 > 192.168.50.80.8776: Flags [P.], seq 1696695677:
E....7@
.92/.7..GET / HTTP/1.1
Host: 192.168.50.80:8776
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: nova-api keystoneauth1/
X-Service-Token: gAAAAABeMrv1SxD
X-Auth-Token: gAAAAABeMrv0vSJ
06:20:22.553939 IP 192.168.50.81.49226 > 192.168.50.80.8776: Flags [.], ack 922607474, win 71, options [nop,nop,TS val 3748405 ecr 3644974], length 0
E..4.8@
.925.7..
06:20:22.564940 IP 192.168.50.81.49226 > 192.168.50.80.8776: Flags [P.], seq 1696696271:
E....9@.@..
..2Q..2P.
.92@.7..POST /v3/27c47772a3f
Host: 192.168.50.80:8776
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: application/json
User-Agent: python-cinderclient
X-Service-Token: gAAAAABeMrv1SxD
X-Auth-Token: gAAAAABeMrv0vSJ
OpenStack-
Content-Type: application/json
X-OpenStack-
Content-Length: 147
Changed in nova: | |
assignee: | nobody → Harshavardhan Metla (harsha24) |
I was able to reproduce the problem on current master. Regardless of the setting of send_service_ user_token nova sends the service token.
with [service_ user]/send_ service_ user_token = false
08:03:59.263531 IP aio.56768 > aio.http: Flags [P.], seq 3136635724: 3136636434, ack 282222251, win 512, options [nop,nop,TS val 548278802 ecr 548278802], length 710: HTTP: GET /volume/ v3/57abc7a114c3 41708f5dea1a657 16e2d/volumes/ f122d57f- 8273-48f3- a2fb-5335fcd15b 3f HTTP/1.1 .@..!.. y...y.. ..P..CL. .^..... w@..... v3/57abc7a114c3 41708f5dea1a657 16e2d/volumes/ f122d57f- 8273-48f3- a2fb-5335fcd15b 3f HTTP/1.1 Request- ID: req-e57eaa48- ff8e-4e50- a6fc-a054b899dd 9d 0nCxAoorJJxf0Ph Yq-siT8WrygdGzY g50Wg73kimG5khj P5FaUm4Un2yIcpw 0NJtsNpuy5gVT7y T6T33AY9ZJNJh7J yKWoKxH3r4R16Qp TsWISL54ctrYycQ Od1X2AeMmk_ rP7GvsxvihytwtW NLOXKJBf2rrXbbL l0C5X-I 0OJ1IJe6GDPu7fy JEmGsm8P82L2N2Z ek8BA5J0EF1v4iZ sH2ljWXqC- r1-zF4tMf_ QOmoBdD2o9rFgpu aoWlWwj0IyvgNlk c0nv8tn0RbGmpei 00Lf17- CMsfOTIxkrXF7JU ikDZGwvTNXzJ5CE ycYDIUjqcDkbN9- 6BsEx8
E.....@
... ...GET /volume/
Host: 192.168.121.129
User-Agent: python-cinderclient
Accept-Encoding: gzip, deflate
Accept: application/json
Connection: keep-alive
X-OpenStack-
X-Auth-Token: gAAAAABemBFu99R
X-Service-Token: gAAAAABemBFv2zK
with [service_ user]/send_ service_ user_token = true
09:02:06.437197 IP aio.57272 > aio.http: Flags [P.], seq 2567770992: 2567771702, ack 287109253, win 512, options [nop,nop,TS val 551765985 ecr 551765985], length 710: HTTP: GET /volume/ v3/57abc7a114c3 41708f5dea1a657 16e2d/volumes/ f122d57f- 8273-48f3- a2fb-5335fcd15b 3f HTTP/1.1 .@.Q... y...y.. ..P...p. ....... w@..... v3/57abc7a114c3 41708f5dea1a657 16e2d/volumes/ f122d57f- 8273-48f3- a2fb-5335fcd15b 3f HTTP/1.1 Request- ID: req-a77e52e6- b623-42c0- a6ec-e18691a1a4 bc 9lI3ECL_ zksQz1egSMytu4m G6vnWExq1HQBIFN 4O60hEJAgLLXOpC gpKDKX4VmVCDl4q Mgt8aBShGrC4eYm cjctIOuUbXlY9Tz gUxZAs8z6bKgDq5 OLbEgSgnCUIQAtv nY2f7vrmvFa2HAu cckXv7JUbYNhU4U Y15cFAR3U8 Evu4g3DJRerexgH EoiaOwHXPV6wgGY 10iG3RFbFbENqcV 1DNnFVUveX07i5Z ltABJqx0EXfb4Jl 1AsYzBjUS2zxFEK X8-niStTnEMsqpv Q2yfH9TPnldxh2S l4Y9WgxlgrvQLaP MXMLe7loIJhhuj3 HTkKAuGsmyouifO ThI
E...r&@
.G. .G.GET /volume/
Host: 192.168.121.129
User-Agent: python-cinderclient
Accept-Encoding: gzip, deflate
Accept: application/json
Connection: keep-alive
X-OpenStack-
X-Auth-Token: gAAAAABemB8N2IX
X-Service-Token: gAAAAABemB8Oypd