Agents DoS Keystone when tokens don't validate

Bug #1454432 reported by Ryan Bak
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Monasca
Fix Committed
High
Ryan

Bug Description

The forwarder tries to reuse tokens, and gets a new one whenever the api reports auth failure for the one it had, which sounds great until the tokens never validate for some reason. Assuming the forwarder runs every 5 seconds, on 50 compute nodes and assuming ~4 vms with different tenants per node the forwarder will make 5 (4 + default tenant) token refresh requests per run. So that's 50*5/5=50 tokens per second or almost 3000/min.

We encountered this recently during a deploy which changed a role name for the monasca-agent. The deploy updated the roles in keystone before it got to the monasca-api. This resulted in the agents getting tokens that the monasca-api didn't recognize as valid because it didn't know about the new role name.

The agent should have some mechanism preventing it from refreshing tokens this often.

Ryan Bak (ryanmbak)
summary: - Agents cause DOS attack on Keystone when tokens don't validate
+ Agents DoS Keystone when tokens don't validate
Ryan (ryan-brandt)
Changed in monasca:
assignee: nobody → Ryan (ryan-brandt)
importance: Undecided → High
status: New → Triaged
Ryan (ryan-brandt)
Changed in monasca:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to monasca-agent (master)

Reviewed: https://review.openstack.org/183638
Committed: https://git.openstack.org/cgit/stackforge/monasca-agent/commit/?id=bed88841c58401e3dc134f431f547f63a79168b4
Submitter: Jenkins
Branch: master

commit bed88841c58401e3dc134f431f547f63a79168b4
Author: Ryan Brandt <email address hidden>
Date: Fri May 15 12:08:11 2015 -0600

    Add wait time to refresh tokens

    Add a random wait time between requests for a new token and
    continue attempting to send metrics while waiting.
    The Monasca client will handle retrying once, which should
    catch expired tokens.

    Closes-Bug: #1454432

    Change-Id: Ifd2e4891c24dbb0a53ad7d074f5842893ce4eedc

Changed in monasca:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.