![]() |
![]() |
|
November 05, 2002The Powers of the ACLThe powers of the ACL. One of the biggest beefs I have had with Windows environments has been the fact you can't simply change perms on files (ie: chmod 750 foo) as you can in Unix environments. On the flip side, I have always thought Windows Access Control was much easier to understand. However, whenever you need to programmatically change access control, Win32 has been a NIGHTMARE to create ACLs. Well, in exploring the bowels of VC++ and cross referencing that with the latest book I am reading I found some good ATL template libs that make it CONSIDERABLY easier. Some background for myself later, and hopefully something worth showing you guys. An ACL is an Access Control List. This is basically a container holding Access Control Entries or "ACE entries". These are in a canonical order which is quite easy to understand. Anyways, you build as many ACE entries as you need and make it part of the ACL. The ACL then is applied to Well, in the new IPSec client I am writing I was able to shorten that considerably. Here are the amazing objects to make life easier:
So, instead of 30-40 lines of ugly Win32 code... I can get it down significantly, and make it easier to read and understand. Lets take an example. Lets say I want to allow Alice to be able to read a particular directory on the accounting server. Bob on the other hand is allowed full access as he is an administrator. Guests... they should have no access. Knowing this, it is easy to set up the proper access control on Windows environments.
#include <atlsecurity.h> // The hidden secret jem // In some function that needs a discretionary ACL try { // Create an ACL and apply ACEs. Due to the canocial nature of the ACL, dacl.AddDeniedAce( sidGuests, GENERIC_ALL ); // Create the SD // Create the directory on the accounting server . Well, now you can easily apply discretionary access control to basically anything that will take security attributes within just a few lines of code. Of course, this will only work on volumes that support it. So Win95/98 is right out. Of course.... since MS has EOL it anyways... no big whoop. On that note, I should get back to work. I need to crack some HEX that MS is hiding deep in the registry so I can figure out what the heck they are hiding in their ipsecData fields. They are all REG_BINARY and there is NO documentation to the struct of the raw data. *sigh*. TTYL Posted by SilverStr at November 5, 2002 05:18 PM |
![]() ![]()
My 5 Favorite Books
Writing Secure Code
Secure Programming Cookbook Security Engineering Secure Coding Principles & Practice Inside the Security Mind ![]()
My 5 Favorite Papers
Smashing the Stack
Penetration Studies Covert Channel Analysis of Trusted Systems DoD Trusted Computer System Evaluation Criteria NSA Security Recommendation Guides ![]()
Archives
December 2005
November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 February 2005 January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 May 2004 April 2004 March 2004 February 2004 January 2004 December 2003 November 2003 October 2003 September 2003 August 2003 July 2003 June 2003 May 2003 April 2003 March 2003 February 2003 January 2003 December 2002 November 2002 October 2002 September 2002 August 2002 July 2002 ![]() |
|