Part of the EllisLab Network
   
2 of 3
2
Which is best for ACL? 
Posted: 08 September 2007 03:22 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  674
Joined  02-05-2007
Monotoba - 08 September 2007 02:25 PM

I have only begun to formulate my ideas of a lite-weight ACL however, what I foresee is a system that uses
per-asset (class/method) athorization for groups (roles) and users.

Unfortunately, I don’t know anything about FAL. But taking the Zend Framework ACL as an example, your assets (class/method) would be resources. You can get the current class/method using this:

$this->uri->router->class;
$this->uri->router->method;

Let’s assume that the Zend ACL is in a custom library that is loaded in the constructor of a controller that requires authorization. Taking a simple example of authorizing based on the controller, within the ACL library you could check authorization like so:

$CI =& get_instance();
if (!
$this->acl->isAllowed($_SESSION['username'], $CI->uri->router->class))
{
   
// access denied!
}

 Signature 

“I am the terror that flaps in the night”

Profile
 
 
Posted: 08 September 2007 03:42 PM   [ Ignore ]   [ # 12 ]  
Summer Student
Total Posts:  21
Joined  09-05-2007

I looked at the ZendACL and I like what I see. The only issue I have in using it is that it would require loading other Zend framework libraries that replicate CI functionality i.e. the database library would be needed and so my application would need to load both CI and Zend dbi’s. I guess I could build an interface between the CI dbi and ZendACL/Auth libs. Zend does offer fine control over access to assets (resources)…

 Signature 

If you ask me if it can be done, the answer is yes! It can always be done. The correct question however, is what will it cost?

Profile
 
 
Posted: 08 September 2007 03:51 PM   [ Ignore ]   [ # 13 ]  
Summer Student
Total Posts:  21
Joined  09-05-2007

Ok, a closer look at Zend ACL tells me that I don’t need to use Zends dbi but that I may have to store my acl as a serialized object…

 Signature 

If you ask me if it can be done, the answer is yes! It can always be done. The correct question however, is what will it cost?

Profile
 
 
Posted: 08 September 2007 04:42 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  674
Joined  02-05-2007
Monotoba - 08 September 2007 03:51 PM

Ok, a closer look at Zend ACL tells me that I don’t need to use Zends dbi but that I may have to store my acl as a serialized object…

Yep, Zend Framework components are pretty modular. You could use the Zend Session and Auth components with the ACL, but even that isn’t necessary.

You only have to serialize the ACL object if you need to dynamically update it in your code. For example, you build a utility where an admin user can create additional roles/resources or edit them.

 Signature 

“I am the terror that flaps in the night”

Profile
 
 
Posted: 08 September 2007 05:04 PM   [ Ignore ]   [ # 15 ]  
Summer Student
Total Posts:  21
Joined  09-05-2007

Yes, I will need an admin function that allows roles and resources to be crud. I found a podcast on PHP Abstract that talks about the zend ACL. The only dependencies I’ve found so far is on the Zend Exception class… I prefere db storage and would like to encrypt the serialized data for security sake. After all, this is a global ACL and if it got leaked, you would loose all control. Have any suggestions on how best to do that?

 Signature 

If you ask me if it can be done, the answer is yes! It can always be done. The correct question however, is what will it cost?

Profile
 
 
Posted: 08 September 2007 05:29 PM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  674
Joined  02-05-2007

I probably don’t understand your concern, but even if someone had access to your server and could look at the ACL, what harm would that do? It is more important to protect usernames/passwords. I think that if a stranger could access your server, then you have larger concerns.

EDIT:
Sorry, I think I understand now. You want to serialize the ACL object and store it in the database. In which case, if someone could access your database, they could transparently change the ACL to grant a user admin privileges for example. That would be a problem since you might not know about it. So I guess if the serialized ACL is a string, you could use the CI encryption library when getting/saving the ACL to the database.

 Signature 

“I am the terror that flaps in the night”

Profile
 
 
Posted: 08 September 2007 10:10 PM   [ Ignore ]   [ # 17 ]  
Summer Student
Total Posts:  21
Joined  09-05-2007

Sorry for late reply but yes, my concern is if someone accessed the acl they could alter it. Encrypting it would solve this issue or at least make it much more difficult to alter the acl in the database. This is also why I seed passwords with extra characters before encrypting them with MD5 or SHA1. Both can be broken. In fact I once saw a demo of an MD5 hash broken on a laptop PC in less than an hour. The issue with MD5 is that collisions can happen in the hash. In other-words, two very different passwords can result in the same MD5 hash. MD5 was an improvement on MD4 but only decreases the odds of a collision and with pc’s gaining more processing power every few months, the MD5 hash simply is not tight enough alone. Many once secure hashing methods simply have become less secure becuase the processing power of pc’s has increase beyond what was expected when the algorythm was designed. Security is always a major concern for me.

 Signature 

If you ask me if it can be done, the answer is yes! It can always be done. The correct question however, is what will it cost?

Profile
 
 
Posted: 08 September 2007 11:33 PM   [ Ignore ]   [ # 18 ]  
Summer Student
Total Posts:  21
Joined  09-05-2007

P.S. If anyone thinks that MD5 is secure read this!

http://technocrat.net/d/2006/3/21/1500

MD5 broken in now under a minute!

 Signature 

If you ask me if it can be done, the answer is yes! It can always be done. The correct question however, is what will it cost?

Profile
 
 
Posted: 09 September 2007 06:11 AM   [ Ignore ]   [ # 19 ]  
Lab Assistant
RankRank
Total Posts:  119
Joined  04-05-2007

Yeah, MD5 is pretty bad imo. I was testing it out with the online dictionary attacks on my own password. Took about 10 seconds.  All dictionary words are incredibly easy to break.

Profile
 
 
Posted: 09 September 2007 04:51 PM   [ Ignore ]   [ # 20 ]  
Research Assistant
RankRankRank
Total Posts:  903
Joined  07-10-2006

Spotted this a few minutes ago and it may apply to earlier messages in reference to Zend_ACL and storing ACL infomation in a database. It’s an extension to Zend_ACL posted on phpclasses.org. Have not looked at this, but the description seemed to apply.

http://www.phpclasses.org/browse/package/4100.html

Profile
 
 
   
2 of 3
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 61065 Total Logged-in Users: 15
Total Topics: 73885 Total Anonymous Users: 1
Total Replies: 398529 Total Guests: 321
Total Posts: 472414    
Members ( View Memberlist )
Active Members:    audioplebbscottCraig RodwayCrucialgazzaGDmackeiichiLuci3nmwmerzoutrageSarah PearsonstuffradioTanquetgo_detomcode