Aggressive validation for security group names in Nova EC2 API

Bug #1000673 reported by Alexej Ababilov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Alexej Ababilov

Bug Description

Currently EC2 API in nova forces security group names to match '^[-a-zA-Z0-9_ ]+$' (https://code.launchpad.net/~davewalker/nova/validate_groupname_create_security_group/+merge/68197). However, Amazon and Eucalyptus allow far more symbols - here is an example for Amazon:

$ euca-add-group 'f(sg)!@#$%^&*' -d 'test name'
GROUP f(sg)!@#$%^&* test name

According to Eucalyptus source, the security group name is not validated - all symbols are acceptable.

This nova behavior can break client libraries. For instance, jclouds usually creates groups like jclouds#spam-eggs.dbnode.1#eu-west-1. This library was finally patched on 2012-03-27 (https://github.com/jclouds/jclouds/issues/330, https://github.com/jclouds/jclouds/commit/49e475edcd6dbf706250c05c90210476d7e43900), but the same problem can occur for any client that was developed for Amazon or Eucalyptus and tries to interact with nova.

Native Nova API (nova.api.openstack.contrib.security_groups) doesn't perform any validation. So, we can create a group like "group/1" (the name is send in JSON during creation) that should not cause problems since API calls expect IDs (not names) in URLs.

I propose to allow using ASCII characters from 0x20 to 0x7E in security group names in Nova EC2 API - that includes spaces, letters, digits, and symbols like ! " # $ % & ' ( ) * + and so on.

Tags: ec2
Changed in nova:
status: New → Triaged
importance: Undecided → Medium
tags: added: ec2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/7584

Changed in nova:
assignee: nobody → Alessio Ababilov (aababilov)
status: Triaged → In Progress
Revision history for this message
Dave Walker (davewalker) wrote :

The restrictive nature matches the EC2 API as documented. The fact that other implementations are more lienant is their mistake. It's more concerning that jcloud are _relying_ on a bug in the implementation is worrying.

That being said, I'm not upset that Openstack's implementation will match others, so crack on.

Thanks.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/7584
Committed: http://github.com/openstack/nova/commit/a8d9bf7705d01fc40a652e7e35624a1488d3a44f
Submitter: Jenkins
Branch: master

commit a8d9bf7705d01fc40a652e7e35624a1488d3a44f
Author: Alessio Ababilov <email address hidden>
Date: Fri May 25 19:27:39 2012 +0300

    [PATCH] Allow [:print:] chars for security group names

    Fixes bug #1000673

    Change-Id: Id1b23d6a0f8d328f65b66f947e8937fa1914a5db

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-2 → 2012.2
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.