| Apache Qpid > Index > Developer Pages > ACL |
Home
Download
Getting Started
Documentation
Mailing Lists
Issue Reporting
FAQ/How to
Getting Involved
Qpid Integrated with..
Source Repository
Building Qpid
Developer Pages
QMF
People
License
Project Status
Acknowledgments
What is AMQP ?
AMQP Specification Download

This new ACL implementation has been designed for implementation and interoperability on all Qpid brokers. It is currently supported in the following brokers:
| Broker | Version |
|---|---|
| C++ | M4 onward |
| Java | M5 anticipated |
Contents
Notes on file formats
# 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
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 = [consume|publish|create|access|bind|unbind|delete|purge|update]
object = [virtualhost|queue|exchange|broker|link|route|method]
property = [name|durable|owner|routingkey|passive|autodelete|exclusive|type|alternate|queuename|schemapackage|schemaclass]
acl permission {<group-name>|<user-name>|"all"} {action|"all"} [object|"all"] [property=<property-value>]
The new ACL file format needs to perform validation on the acl rules. The validation should be performed depending on the set value:
strict-acl-validation=none
The default setting should be 'warn'
On validation of this acl the following checks would be expected:
acl allow client publish routingkey=exampleQueue exchange=amq.direct
Each of these checks that fail will result in a log statement being generated.
In the case of a fatal logging the full file will be validated before the broker shuts down.
# 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
The C++ broker maps the ACL traps in the follow way for AMQP 0-10:
The Java broker currently only performs ACLs on the AMQP connection not on management functions:
| Object | Action | Properties | Trap C++ | Trap Java |
|---|---|---|---|---|
| Exchange | Create | name type alternate passive durable | ExchangeHandlerImpl::declare | ExchangeDeclareHandler |
| Exchange | Delete | name | ExchangeHandlerImpl::delete | ExchangeDeleteHandler |
| Exchange | Access | name | ExchangeHandlerImpl::query | |
| Exchange | Bind | name routingkey queuename owner | ExchangeHandlerImpl::bind | QueueBindHandler |
| Exchange | Unbind | name routingkey | ExchangeHandlerImpl::unbind | ExchangeUnbindHandler |
| Exchange | Access | name queuename routingkey | ExchangeHandlerImpl::bound | |
| Exchange | Publish | name routingKey | SemanticState::route | BasicPublishMethodHandler |
| Queue | Access | name | QueueHandlerImpl::query | |
| Queue | Create | name alternate passive durable exclusive autodelete | QueueHandlerImpl::declare | QueueDeclareHandler |
| Queue | Purge | name | QueueHandlerImpl::purge | QueuePurgeHandler |
| Queue | Purge | name | Management::Queue::purge | |
| Queue | Delete | name | QueueHandlerImpl::delete | QueueDeleteHandler |
| Queue | Consume | name (possibly add in future?) | MessageHandlerImpl::subscribe | BasicConsumeMethodHandler BasicGetMethodHandler |
| <Object> | Update | ManagementProperty::set | ||
| <Object> | Access | ManagementProperty::read | ||
| Link | Create | Management::connect | ||
| Route | Create | Management:: - |
||
| Route | Delete | Management:: - |
||
| Virtualhost | Access | name | TBD | ConnectionOpenMethodHandler |
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
| Object | Action | Property |
|---|---|---|
| Broker | Update | name=joinCluster |
The file gets read top down and rule get passed based on the first match. In the following example the first rule is a dead rule. I.e. the second rule is wider than the first rule. DON'T do this, it will force extra analysis, worst case if the parser does not kill the dead rule you might get a false deny.
allow peter@QPID create queue name=tmp <-- dead rule!! allow peter@QPID create queue deny all all
By default files end with
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
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's rules using less properties on publish will in general be faster.
In order to get log messages from ACL actions use allow-log and deny-log for example
allow-log john@QPID all all deny-log guest@QPID all all
The 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