You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rajith Attapattu (JIRA)" <qp...@incubator.apache.org> on 2010/04/08 18:29:36 UTC

[jira] Created: (QPID-2488) ACL - error handling/bounds checking

ACL - error handling/bounds checking
------------------------------------

                 Key: QPID-2488
                 URL: https://issues.apache.org/jira/browse/QPID-2488
             Project: Qpid
          Issue Type: Bug
          Components: C++ Broker
    Affects Versions: 0.5, 0.6
            Reporter: Rajith Attapattu
            Assignee: Rajith Attapattu
             Fix For: 0.7


Qpid ACL properties maxqueuesize, maxqueuecount, policytype, ... currently accepts invalid values.
Only valid ACL rules should be applied, at the moment broker throws an exception at the point when invalid ACL rule is triggered.

How reproducible:
Always

Steps to Reproduce:
#set ACL rules vith invalid values
acl allow tester@QPID all queue maxqueuesize=18446744073709551617
acl allow tester@QPID all queue maxqueuesize=-1
acl allow tester@QPID all queue policytype=invalid_policy_type

Actual results:
ACL rules with invalid rules/values are processed without any error message. 


qpidd.log:
2009-oct-23 07:11:56 debug ACL Processing  1 allow [tester@QPID] * queue
maxqueuesize=18446744073709551617
2009-oct-23 07:11:56 debug ACL: Adding actions
{consume,publish,create,access,bind,unbind,delete,purge,update} to objects
{queue} with props { maxqueuesize=18446744073709551617 } for users
{tester@QPID}
...

Expected results:
ACL rules with invalid property values should not be processed

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Resolved: (QPID-2488) ACL - error handling/bounds checking

Posted by "Rajith Attapattu (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu resolved QPID-2488.
------------------------------------

    Resolution: Fixed

Code is reviewed and test cases are added to acl.py

> ACL - error handling/bounds checking
> ------------------------------------
>
>                 Key: QPID-2488
>                 URL: https://issues.apache.org/jira/browse/QPID-2488
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.5, 0.6
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>             Fix For: 0.7
>
>         Attachments: QPID-2488.patch, QPID-2488.test.patch
>
>
> Qpid ACL properties maxqueuesize, maxqueuecount, policytype, ... currently accepts invalid values.
> Only valid ACL rules should be applied, at the moment broker throws an exception at the point when invalid ACL rule is triggered.
> How reproducible:
> Always
> Steps to Reproduce:
> #set ACL rules vith invalid values
> acl allow tester@QPID all queue maxqueuesize=18446744073709551617
> acl allow tester@QPID all queue maxqueuesize=-1
> acl allow tester@QPID all queue policytype=invalid_policy_type
> Actual results:
> ACL rules with invalid rules/values are processed without any error message. 
> qpidd.log:
> 2009-oct-23 07:11:56 debug ACL Processing  1 allow [tester@QPID] * queue
> maxqueuesize=18446744073709551617
> 2009-oct-23 07:11:56 debug ACL: Adding actions
> {consume,publish,create,access,bind,unbind,delete,purge,update} to objects
> {queue} with props { maxqueuesize=18446744073709551617 } for users
> {tester@QPID}
> ...
> Expected results:
> ACL rules with invalid property values should not be processed

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Updated: (QPID-2488) ACL - error handling/bounds checking

Posted by "Rajith Attapattu (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu updated QPID-2488:
-----------------------------------

    Attachment: QPID-2488.patch

The attached patch adds a very basic validation model.
It basically iterates through the ACL model and verify 3 properties (namely queue-policy, max-queue-count and size).
However it's generic enough to add validation for any property.

There is room for improvement. You could validate object and action combinations and also check if properties are valid for a given object.
These are nice to have items, and will be tackled in the future.

> ACL - error handling/bounds checking
> ------------------------------------
>
>                 Key: QPID-2488
>                 URL: https://issues.apache.org/jira/browse/QPID-2488
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.5, 0.6
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>             Fix For: 0.7
>
>         Attachments: QPID-2488.patch
>
>
> Qpid ACL properties maxqueuesize, maxqueuecount, policytype, ... currently accepts invalid values.
> Only valid ACL rules should be applied, at the moment broker throws an exception at the point when invalid ACL rule is triggered.
> How reproducible:
> Always
> Steps to Reproduce:
> #set ACL rules vith invalid values
> acl allow tester@QPID all queue maxqueuesize=18446744073709551617
> acl allow tester@QPID all queue maxqueuesize=-1
> acl allow tester@QPID all queue policytype=invalid_policy_type
> Actual results:
> ACL rules with invalid rules/values are processed without any error message. 
> qpidd.log:
> 2009-oct-23 07:11:56 debug ACL Processing  1 allow [tester@QPID] * queue
> maxqueuesize=18446744073709551617
> 2009-oct-23 07:11:56 debug ACL: Adding actions
> {consume,publish,create,access,bind,unbind,delete,purge,update} to objects
> {queue} with props { maxqueuesize=18446744073709551617 } for users
> {tester@QPID}
> ...
> Expected results:
> ACL rules with invalid property values should not be processed

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2488) ACL - error handling/bounds checking

Posted by "Rajith Attapattu (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854977#action_12854977 ] 

Rajith Attapattu commented on QPID-2488:
----------------------------------------

In rev 911509 I added exception handling to ensure the broker doesn't blow off when an invalid rule is triggered during an acl lookip

> ACL - error handling/bounds checking
> ------------------------------------
>
>                 Key: QPID-2488
>                 URL: https://issues.apache.org/jira/browse/QPID-2488
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.5, 0.6
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>             Fix For: 0.7
>
>
> Qpid ACL properties maxqueuesize, maxqueuecount, policytype, ... currently accepts invalid values.
> Only valid ACL rules should be applied, at the moment broker throws an exception at the point when invalid ACL rule is triggered.
> How reproducible:
> Always
> Steps to Reproduce:
> #set ACL rules vith invalid values
> acl allow tester@QPID all queue maxqueuesize=18446744073709551617
> acl allow tester@QPID all queue maxqueuesize=-1
> acl allow tester@QPID all queue policytype=invalid_policy_type
> Actual results:
> ACL rules with invalid rules/values are processed without any error message. 
> qpidd.log:
> 2009-oct-23 07:11:56 debug ACL Processing  1 allow [tester@QPID] * queue
> maxqueuesize=18446744073709551617
> 2009-oct-23 07:11:56 debug ACL: Adding actions
> {consume,publish,create,access,bind,unbind,delete,purge,update} to objects
> {queue} with props { maxqueuesize=18446744073709551617 } for users
> {tester@QPID}
> ...
> Expected results:
> ACL rules with invalid property values should not be processed

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Updated: (QPID-2488) ACL - error handling/bounds checking

Posted by "Rajith Attapattu (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu updated QPID-2488:
-----------------------------------

    Attachment:     (was: QPID-2488.patch)

> ACL - error handling/bounds checking
> ------------------------------------
>
>                 Key: QPID-2488
>                 URL: https://issues.apache.org/jira/browse/QPID-2488
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.5, 0.6
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>             Fix For: 0.7
>
>         Attachments: QPID-2488.test.patch
>
>
> Qpid ACL properties maxqueuesize, maxqueuecount, policytype, ... currently accepts invalid values.
> Only valid ACL rules should be applied, at the moment broker throws an exception at the point when invalid ACL rule is triggered.
> How reproducible:
> Always
> Steps to Reproduce:
> #set ACL rules vith invalid values
> acl allow tester@QPID all queue maxqueuesize=18446744073709551617
> acl allow tester@QPID all queue maxqueuesize=-1
> acl allow tester@QPID all queue policytype=invalid_policy_type
> Actual results:
> ACL rules with invalid rules/values are processed without any error message. 
> qpidd.log:
> 2009-oct-23 07:11:56 debug ACL Processing  1 allow [tester@QPID] * queue
> maxqueuesize=18446744073709551617
> 2009-oct-23 07:11:56 debug ACL: Adding actions
> {consume,publish,create,access,bind,unbind,delete,purge,update} to objects
> {queue} with props { maxqueuesize=18446744073709551617 } for users
> {tester@QPID}
> ...
> Expected results:
> ACL rules with invalid property values should not be processed

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Updated: (QPID-2488) ACL - error handling/bounds checking

Posted by "Rajith Attapattu (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu updated QPID-2488:
-----------------------------------

    Attachment: QPID-2488.patch

Attached a new patch with changes suggested by Alan. 
I modified the map<acl::Property, AclProperty* > to map<acl::Property, boost::shared_ptr<AclProperty> > and fixed an indentation issue.

> ACL - error handling/bounds checking
> ------------------------------------
>
>                 Key: QPID-2488
>                 URL: https://issues.apache.org/jira/browse/QPID-2488
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.5, 0.6
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>             Fix For: 0.7
>
>         Attachments: QPID-2488.patch, QPID-2488.test.patch
>
>
> Qpid ACL properties maxqueuesize, maxqueuecount, policytype, ... currently accepts invalid values.
> Only valid ACL rules should be applied, at the moment broker throws an exception at the point when invalid ACL rule is triggered.
> How reproducible:
> Always
> Steps to Reproduce:
> #set ACL rules vith invalid values
> acl allow tester@QPID all queue maxqueuesize=18446744073709551617
> acl allow tester@QPID all queue maxqueuesize=-1
> acl allow tester@QPID all queue policytype=invalid_policy_type
> Actual results:
> ACL rules with invalid rules/values are processed without any error message. 
> qpidd.log:
> 2009-oct-23 07:11:56 debug ACL Processing  1 allow [tester@QPID] * queue
> maxqueuesize=18446744073709551617
> 2009-oct-23 07:11:56 debug ACL: Adding actions
> {consume,publish,create,access,bind,unbind,delete,purge,update} to objects
> {queue} with props { maxqueuesize=18446744073709551617 } for users
> {tester@QPID}
> ...
> Expected results:
> ACL rules with invalid property values should not be processed

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Updated: (QPID-2488) ACL - error handling/bounds checking

Posted by "Rajith Attapattu (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu updated QPID-2488:
-----------------------------------

    Attachment: QPID-2488.test.patch

Test cases to cover the new validation code.

> ACL - error handling/bounds checking
> ------------------------------------
>
>                 Key: QPID-2488
>                 URL: https://issues.apache.org/jira/browse/QPID-2488
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.5, 0.6
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>             Fix For: 0.7
>
>         Attachments: QPID-2488.patch, QPID-2488.test.patch
>
>
> Qpid ACL properties maxqueuesize, maxqueuecount, policytype, ... currently accepts invalid values.
> Only valid ACL rules should be applied, at the moment broker throws an exception at the point when invalid ACL rule is triggered.
> How reproducible:
> Always
> Steps to Reproduce:
> #set ACL rules vith invalid values
> acl allow tester@QPID all queue maxqueuesize=18446744073709551617
> acl allow tester@QPID all queue maxqueuesize=-1
> acl allow tester@QPID all queue policytype=invalid_policy_type
> Actual results:
> ACL rules with invalid rules/values are processed without any error message. 
> qpidd.log:
> 2009-oct-23 07:11:56 debug ACL Processing  1 allow [tester@QPID] * queue
> maxqueuesize=18446744073709551617
> 2009-oct-23 07:11:56 debug ACL: Adding actions
> {consume,publish,create,access,bind,unbind,delete,purge,update} to objects
> {queue} with props { maxqueuesize=18446744073709551617 } for users
> {tester@QPID}
> ...
> Expected results:
> ACL rules with invalid property values should not be processed

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org