ACLPage edited by Chuck Rolke
Comment:
Updated for general readability and to reflect significant changes to 0.16 C++ broker ACL handling.
Changes (48)
Full Contentv2 ACL file format for brokersThe v2 ACL file format has been designed for implementation and interoperability on all Qpid brokers. It is currently supported in the following brokers:
This document is updated for release 0.16. Contents SpecificationComments
White Space
Character Set
Case Sensitivity
Line Continuation
# Examples of extending group lists using a trailing '\' character
group group1 name1 name2 \
name3 name4 \
name5
group group2 \
group1 \
name6
# The following are illegal:
# '\' must be after group name
group \
group3 name7 name8
# No empty extension lines
group group4 name9 \
\
name10
Line Length
The all keyword
ACL File Syntax
user = username[/domain[@realm]]
user-list = user1 user2 user3 ...
group-name-list = group1 group2 group3 ...
group <group-name> = [user-list] [group-name-list]
permission = [allow|allow-log|deny|deny-log]
action = ""
object = [virtualhost|queue|exchange|broker|link|route|method]
property = [name|durable|owner|routingkey|passive|autodelete|exclusive|type|alternate|queuename|
policytype|schemapackage|schemaclass|
queuemaxsizelowerlimit|queuemaxsizeupperlimit|
queuemaxcountlowerlimit|queuemaxcountupperlimit]
acl permission {<group-name>|<user-name>|"all"} {action|"all"} [object|"all" [property=<property-value>]]
File Processing Overview
Deny Mode vs. Allow Mode
# Example of C++ Broker Allow Mode processing behavior group admins bob@QPID joe@QPID acl allow bob@QPID create queue acl deny admins create queue acl allow all all # Prior to release 0.16 bob is denied permission to create a queue because the # 'allow bob@QPID create queue' rule in an Allow Mode file is discarded. # Since release 0.16 bob is allowed permission to create a queue because no # rules in the file are discarded and the first allow rule controls the decision. Rule Processing Details
Rule Matching Details
# Example of rule matching # # Using this ACL file content: (1) acl deny bob create exchange name=test durable=true passive=true (2) acl deny bob create exchange name=myEx type=direct (3) acl allow all all # # Lookup 1. id:bob action:create objectType:exchange name=test {durable=false passive=false type=direct alternate=} # # ACL Match Processing: # 1. Rule 1 passes minimum criteria with user bob, action create, and object exchange. # 2. Rule 1 matches name=test. # 3. Rule 1 does not match the rule's durable=false with the requested lookup of durable=true. # 4. Rule 1 does not control the decision and processing continues to Rule 2. # 5. Rule 2 passes minimum criteria with user bob, action create, and object exchange. # 6. Rule 2 does not match the rule's name=myEx with the requested lookup of name=test. # 7. Rule 2 does not control the decision and processing continues to Rule 3. # 8. Rule 3 matches everything and the decision is 'allow'. # # Lookup 2. id:bob action:create objectType:exchange name=myEx {durable=true passive=true type=direct alternate=} # # ACL Match Processing: # 1. Rule 1 passes minimum criteria with user bob, action create, and object exchange. # 6. Rule 1 does not match the rule's name=test with the requested lookup of name=myEx. # 4. Rule 1 does not control the decision and processing continues to Rule 2. # 5. Rule 2 passes minimum criteria with user bob, action create, and object exchange. # 2. Rule 2 matches name=myEx. # 3. Rule 2 matches the rule's type=direct with the requested lookup of type=direct. # 8. Rule 2 matches everything and the decision is 'deny'. #
# Example of ACL specifying queue size constraints # Note: for legibility this acl line has been split into multiple lines. acl allow bob@QPID create queue name=q6 queuemaxsizelowerlimit=50 queuemaxsizeupperlimit=100 queuemaxcountlowerlimit=200 queuemaxcountupperlimit=300 # # These limits come into play when a queue is created as illustrated here: queue_options = {} queue_options["qpid.max_count"] = 101 queue_options["qpid.max_size"] = 100 session.queue_declare(queue="q6", arguments=queue_options) # # When the ACL rule is processed the actor, action, object, and object name all match # and so this allow rule matches for the allow or deny decision. However, the ACL rule # is further constrained to limit 50 <= max_size <= 100 and 200 <= max_count <= 300. # Since the queue_option max_count is 101 then the size limit is violated and the # allow rule is returned with a deny decision. ValidationNote: In the 0.16 C++ Broker only the following validation is performed on ACL rule files:
Example file:
# Some groups
group admin ted@QPID martin@QPID
group user-consume martin@QPID ted@QPID
group group2 kim@QPID user-consume rob@QPID
group publisher group2 \
tom@QPID andrew@QPID debbie@QPID
# Some rules
acl allow carlt@QPID create exchange name=carl.*
acl deny rob@QPID create queue
acl allow guest@QPID bind exchange name=amq.topic routingkey=stocks.ibm.# owner=self
acl allow user-consume create queue name=tmp.*
acl allow publisher publish all durable=false
acl allow publisher create queue name=RequestQueue
acl allow consumer consume queue durable=true
acl allow fred@QPID create all
acl allow bob@QPID all queue
acl allow admin all
acl deny kim@QPID all
acl allow all consume queue owner=self
acl allow all bind exchange owner=self
# Last (default) rule
acl deny all all
Design DocumentationMapping of ACL traps to action and type
Management actions that are not explicitly given a name property it will default the name property to management method name, if the action is 'W' Action will be 'Update', if 'R' Action will be 'Access'. for example, if the mgnt method 'joinCluster' was not mapped in schema it will be mapped in ACL file as follows
v2 ACL User GuideWriting Good/Fast ACLThe file gets read top down and rule get passed based on the first match. In the following example the first rule is unnecessary. The second rule is wider than the first rule and the same result would be achieved if the first rule was removed. acl allow peter@QPID create queue name=tmp <-- unnecessary rule causes extra work. acl allow peter@QPID create queue acl deny all all By default files end with acl deny all all the mode of the ACL engine can be swapped to be allow based by putting the following at the end of the file acl allow all all Note that 'allow' based file will be a LOT faster for message transfer. This is because the AMQP specification does not allow for creating subscribes on publish, so the ACL is executed on every message transfer. Also, ACL rules using fewer properties on publish will in general be faster. Getting ACL to LogIn order to get log messages from ACL actions use allow-log and deny-log for example acl allow-log john@QPID all all acl deny-log guest@QPID all all User Id / domains running with C++ brokerThe user-id used for ACL is taken from the connection user-id. Thus in order to use ACL the broker authentication has to be setup. i.e. (if --auth no is used in combination with ACL the broker will deny everything) The user id in the ACL file is of the form <user-id>@<domain> The Domain is configured via the SASL configuration for the broker, and the domain/realm for qpidd is set using --realm and default to 'QPID'. To load the ACL module use, load the acl module cmd line or via the config file ./src/qpidd --load-module src/.libs/acl.so The ACL plugin provides the following option '--acl-file'. If do ACL file is supplied the broker will not enforce ACL. If an ACL file name is supplied, and the file does not exist or is invalid the broker will not start. ACL Options: --acl-file FILE The policy file to load from, loaded from data dir
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Qpid > ACL confluence
- [CONF] Apache Qpid > ACL confluence
- [CONF] Apache Qpid > ACL confluence
- [CONF] Apache Qpid > ACL confluence
