Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 15574 invoked from network); 20 May 2010 13:13:31 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 May 2010 13:13:31 -0000 Received: (qmail 41797 invoked by uid 500); 20 May 2010 13:13:30 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 41610 invoked by uid 500); 20 May 2010 13:13:30 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 41602 invoked by uid 99); 20 May 2010 13:13:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 May 2010 13:13:30 +0000 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chubrilo@gmail.com designates 209.85.161.43 as permitted sender) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 May 2010 13:13:26 +0000 Received: by fxm19 with SMTP id 19so1573823fxm.2 for ; Thu, 20 May 2010 06:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=3mC5kaVu1JiDKjToDCUJyO7/VCudQcdAwZ3w4ujPdNM=; b=cop8uYCGcVix3oEKctWcrsQqJATnv8cUauSvhazWfE4tTccoP2Q1cS8GskDRuOZAbD kybsBYh4xNYnTVodLA017oDFYh8mtaMnfveHIhzEICEkva8/cSWQ2KsZ0PwZDHQ2T7Bk ed+KJgy2nOdGZ6v2sW05qbZSSK/L7kkcGOjww= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=N791RvaBiCygF0Y3EWy8ZbwstG0wYWRcfuVgcDWOE1XAF6mydgumv621OlLzcj8VPt 72XivKgZtUUODHFp3/p+cMF1HkTEW3EpbF1tC5LZVlS/zNyVFFfFRAPI/jHaGFCLD18E +QEVmKDnDKI4fEuVfh4gx2J82OWiTBvQ7egIE= MIME-Version: 1.0 Received: by 10.239.187.141 with SMTP id l13mr6895hbh.60.1274361184273; Thu, 20 May 2010 06:13:04 -0700 (PDT) Sender: chubrilo@gmail.com Received: by 10.239.153.205 with HTTP; Thu, 20 May 2010 06:13:04 -0700 (PDT) In-Reply-To: References: Date: Thu, 20 May 2010 09:13:04 -0400 X-Google-Sender-Auth: KUR8VsHDO4daTaKjBiXn1BZgjW8 Message-ID: Subject: Re: Fully programmatic authorization map From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=001485f6c8dcb446940487065575 --001485f6c8dcb446940487065575 Content-Type: text/plain; charset=ISO-8859-1 Hi James, thanks for adding this info. I totally forgot to mention activemq-jaas. Cheers -- Dejan Bosanac - http://twitter.com/dejanb Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Thu, May 20, 2010 at 8:34 AM, James Casey wrote: > Hi Jim, > > What Dejan has pointed you at is the classes that have all the various > plugin methods for doing Auth in ActiveMQ by inserting a Broker object > into the chain which is called during a connection. It would be > possible to write a custom Broker subclass here that does what you > want, but I think it would be easier inside JAAS. > > What I'd suggest is you use the standard > JaasCettificateAuthenticationPlugin and do the work in a JAAS plugin. > > The JAAS plugins are in > > http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas > . > > I would suggest to create a subclass of CertificateLoginModule and > override the getUserNameForCertificate method to extract and return > the CN. If you look at TextFileCertificateLoginModule.java you can > see the logic it uses to extract the DN and match against entries in > the file - you would just need to write a simpler version which just > pulls out the CN from the client DN. Then you hook it into ActiveMQ > via a login.config file pointing at your custom class. > > Let me know if this makes sense or if you need any more info. > > cheers, > > James. > > > On 20 May 2010 12:14, Dejan Bosanac wrote: > > Hi Jim, > > > > the best way is to look at the source code of the current plugin > > implementation. > > > > You can find it in org.apache.activemq.security package. > > > > For a quick preview, you can use this URL: > > > > > http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/security > > > > Cheers > > -- > > Dejan Bosanac - http://twitter.com/dejanb > > > > Open Source Integration - http://fusesource.com/ > > ActiveMQ in Action - http://www.manning.com/snyder/ > > Blog - http://www.nighttale.net > > > > > > On Wed, May 19, 2010 at 2:33 PM, Jim Lloyd >wrote: > > > >> I'd like to implement an authorization plugin that would allow me to > >> implement a fully automatic authorization policy. Here's an outline of > what > >> I want: > >> > >> We have a broker that is a hub in a hub & spoke topology network of > >> brokers. > >> A connections to this hub broker are via SSL and the hub broker requires > >> SSL > >> client authentication. We require the client certificates to always be > of a > >> form where the Common Name (CN) of the certificate defines the user. So, > >> for > >> example, if we instead used a jaas.TextFileCertificateLoginModule the > >> user.properties file would look like this: > >> > >> user1=CN=user1,O=Silver Tail Systems,ST=California,C=US > >> userFoo=CN=userFoo,O=Silver Tail Systems,ST=California,C=US > >> ... > >> userZeta=CN=userZeta,O=Silver Tail Systems,ST=California,C=US > >> > >> Meanwhile, the AuthorizationMap we want would look something like this: > >> > >> > >> > >> > >> > >> admin="admins" > >> /> > >> >> admin="user1" > >> /> > >> >> admin="userFoo" /> > >> ... > >> >> admin="userZeta" /> > >> >> admin="all"/> > >> > >> > >> > >> > >> > >> If we use jaas.TextFileCertificateLoginModule, we have to update the > >> users.properties, groups.properties file and the authorizationMap in the > >> activemq.xml file every time we add a user. We can automate this with > >> scripting, but a more elegant solution would be to write our own > plugin(s) > >> to implement this policy. I'm in the process of scoping this effort, and > so > >> far I haven't found anything other than javadocs on the various classes > to > >> guide me. Can anyone provide a high level outline of how I would > implement > >> this? > >> > >> Thanks, > >> Jim Lloyd > >> Silver Tail Systems > >> > > > --001485f6c8dcb446940487065575--