Parse SDDL strings
Project description
Install
pip3 install sddl_parser
Usage
Parse an SDDL string
>> from sddl_parser import parse_sddl, SDDL, DACL, ACE
>> sddl = "O:SYG:SYD:AI(A;ID;FA;;;SY)"
>> parse_sddl(sddl)
SDDL(
owner='LOCAL_SYSTEM',
group='LOCAL_SYSTEM',
dacl=DACL(
flags=['SDDL_AUTO_INHERITED'],
aces=[
ACE(
type='ACCESS_ALLOWED',
flags=['INHERITED'],
rights=['FILE_ALL'],
object_guid='',
inherit_object_guid='',
sid='LOCAL_SYSTEM',
conditional_ace=None
)
]
), sacl=None)
Parse an ACE
>> from sddl_parser import parse_ace, ACE
>> ace = "(A;ID;0x1200a9;;;AC)"
>> parse_ace(ace)
ACE(
type="ACCESS_ALLOWED",
flags=["INHERITED"],
rights=["FILE_READ", "WRITE_PROPERTY"],
object_guid="",
inherit_object_guid="",
sid="ALL_APP_PACKAGES",
)
TODO
- Convert rights and types to enum
Instead of the ACE example, I'd really like to have an enum for all the common properties so that mispellings become a compile time error
ACE(
type=AceType.ACCESS_ALLOWED,
flags=[AceFlags.INHERITED],
...
)
- Allow identifiers (D:, O:, S:) to be out of order. I haven't run into this on any SDDLs on my system, but I'm sure it exists somewhere out there
Thanks
Thanks to An0ther0ne for compiling the constants for ACEs
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sddl_parser-0.1.0.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for sddl_parser-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3b20404797df1e56a7f4e750d73fb892272e9c0c4235fd2ba0a03be497799cb |
|
MD5 | aee04cebc8d2d0d23a28fe041f63e7cb |
|
BLAKE2b-256 | cd22e6b803013816a21f6e07801066e9d3f909ae891dd2abb1ccca55fb8e9bd8 |