'Edit a Security Group to allow specific traffic.
@note: This is a non-standard extension API, and only works for EC2.
:param      name: The name of the security group to edit
:type       name: ``str``
:param      from_port: The beginning of the port range to open
:type       from_port: ``str``
:param      to_port: The end of the port range to open
:type       to_port: ``str``
:param      cidr_ip: The ip to allow traffic for.
:type       cidr_ip: ``str``
:param      protocol: tcp/udp/icmp
:type       protocol: ``str``
:rtype: ``bool``'

def ex_authorize_security_group(self, name, from_port, to_port, cidr_ip, protocol='tcp'):

    params = {'Action': 'AuthorizeSecurityGroupIngress', 'GroupName': name, 'IpProtocol': protocol, 'FromPort': str(from_port), 'ToPort': str(to_port), 'CidrIp': cidr_ip}
    try:
        res = self.connection.request(self.path, params=params.copy()).object
        return self._get_boolean(res)
    except Exception:
        e = sys.exc_info()[1]
        if (e.args[0].find('InvalidPermission.Duplicate') == (-1)):
            raise e
