SDDL Parser
A comprehensive Python parser for Windows Security Descriptor Definition Language (SDDL) strings, supporting File System, Registry, and Active Directory objects.
Features
- Multi-platform support: Parse SDDL from File System, Registry, and Active Directory
- Automatic type detection: Intelligently detects the SDDL type based on structure
- Rich output formats: Export to JSON, plain text, or Rich-formatted tables
- ACE merging: Automatically merges duplicate ACEs with different inheritance scopes
- Friendly names: Resolves well-known SIDs to human-readable names
- Advanced filtering: Filter ACEs by sensitive trustees or sensitive rights
- GUID resolution: Resolves Active Directory object GUIDs to schema names
Quick Start
from sddl_parser import SDDLParser
from rich.console import Console
# Parse an SDDL string
sddl_string = "O:BAG:SYD:(A;;FA;;;BA)(A;;0x1200a9;;;WD)"
parser = SDDLParser()
parser.parse(sddl_string)
# Display as plain text
parser.dump()
# Export to JSON
json_output = parser.to_json()
print(json_output)
# Display as Rich table (requires Rich library)
console = Console()
parser.to_rich(console)
Usage
Basic Parsing
from sddl_parser import SDDLParser
# Auto-detect SDDL type
parser = SDDLParser()
parser.parse(sddl_string)
# Or specify the type explicitly
parser = SDDLParser(sddl_type="File")
parser.parse(sddl_string)
Output Methods
1. Plain Text Output (dump())
Prints a human-readable representation to the console:
parser.dump()
Output:
OWNER:
BUILTIN\Administrators (S-1-5-32-544)
GROUP:
NT AUTHORITY\SYSTEM (S-1-5-18)
DACL:
ACE #1
Type: Access Allowed
Applies to: This folder, subfolders and files
Basic rights: Full Control
Principal: BUILTIN\Administrators (S-1-5-32-544)
2. JSON Export (to_json())
Returns a JSON string representation:
json_output = parser.to_json(indent=2)
Output:
{
"type": "File",
"owner": {
"sid": "S-1-5-32-544",
"name": "BUILTIN\\Administrators"
},
"group": {
"sid": "S-1-5-18",
"name": "NT AUTHORITY\\SYSTEM"
},
"dacl": [
{
"type": "Access Allowed",
"principal": {
"sid": "S-1-5-32-544",
"name": "BUILTIN\\Administrators"
},
"applies_to": "This folder, subfolders and files",
"basic_rights": ["Full Control"],
"advanced_rights": []
}
],
"sacl": []
}
3. Rich Table Output (to_rich())
Displays a formatted table using the Rich library:
from rich.console import Console
console = Console()
parser.to_rich(
console=console,
title="OU=Domain Controllers,DC=serval,DC=int",
sensitive_trustee=False,
sensitive_rights=False,
debug=False
)
Parameters:
console: Rich Console object (required)title: Optional title displayed above the tablesensitive_trustee: Filter to show only ACEs with sensitive trusteessensitive_rights: Filter to show only ACEs with sensitive rightsdebug: Show all ACEs regardless of filters
Output:
SDDL Types
The parser supports three types of SDDL strings:
1. File System
sddl = "O:BAG:SYD:(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;WD)"
parser = SDDLParser(sddl_type="File")
parser.parse(sddl)
Inheritance options:
- This folder only
- This folder, subfolders and files
- This folder and subfolders
- This folder and files
- Subfolders and files only
- Subfolders only
- Files only
2. Registry
sddl = "O:BAG:SYD:(A;CI;KA;;;BA)(A;CI;KR;;;WD)"
parser = SDDLParser(sddl_type="Registry")
parser.parse(sddl)
Inheritance options:
- This key only
- This key and subkeys
- Subkeys only
3. Active Directory
sddl = "O:DAG:DAD:(OA;CI;CR;00299570-246d-11d0-a768-00aa006e0529;;BA)"
parser = SDDLParser(sddl_type="ActiveDirectory")
parser.parse(sddl)
Features:
- Object-specific ACEs with GUIDs
- Extended rights resolution
- Schema object and attribute resolution
API Reference
AccessControlEntry Class
Represents a single Access Control Entry.
Attributes:
ace_type: Type of ACE (e.g., "Access Allowed", "Access Denied")flags: List of ACE flagsbasic_rights: List of basic rights (e.g., "Full Control", "Read")advanced_rights: List of advanced rights (e.g., "Read Data", "Write Data")trustee: SecurityIdentifier object for the principalapplies_to_this: Boolean indicating if ACE applies to this objectapplies_to_subfolders: Boolean for subfolder inheritanceapplies_to_files: Boolean for file inheritanceobject_type: GUID or name for object-specific ACEs (Active Directory)inherited_object_type: GUID or name for inherited object type
SecurityIdentifier Class
Represents a Windows Security Identifier.
Attributes:
sid: The SID string (e.g., "S-1-5-32-544")name: Resolved friendly name (e.g., "BUILTIN\Administrators")
Well-Known SIDs
The parser automatically resolves well-known SIDs to friendly names:
| SID | Name |
|---|---|
| S-1-5-32-544 | BUILTIN\Administrators |
| S-1-5-32-545 | BUILTIN\Users |
| S-1-5-18 | NT AUTHORITY\SYSTEM |
| S-1-1-0 | Everyone |
| S-1-5-11 | Authenticated Users |
| S-1-5-7 | Anonymous Logon |
And many more...
Permissions Mapping
File System Rights
Basic Rights:
- Full Control
- Modify
- Read & Execute
- Read
- Write
Advanced Rights:
- Traverse Folder / Execute File
- List Folder / Read Data
- Read Attributes
- Read Extended Attributes
- Create Files / Write Data
- Create Folders / Append Data
- Write Attributes
- Write Extended Attributes
- Delete Subfolders and Files
- Delete
- Read Permissions
- Change Permissions
- Take Ownership
Registry Rights
Basic Rights:
- Full Control
- Read
- Special Permissions
Advanced Rights:
- Query Value
- Set Value
- Create Subkey
- Enumerate Subkeys
- Notify
- Create Link
- Delete
- Write DAC
- Write Owner
- Read Control
Metadata
Release files for winsddl 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| winsddl-0.1.1.tar.gz | 50.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| winsddl-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 102.5 kB
Release files / winsddl-0.1.1.tar.gz
| Download URL | winsddl-0.1.1.tar.gz |
|---|---|
| Size | 50.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3f87eaf68075dffeb8e68f0a3cfa1068e45be802a830b2505f3813093ad3c06
|
|
BLAKE2b-256 checksum How to use checksums |
a21a5626c1fdb6067e422e95d75b546dde567bcf28bd8e526d7eb0dc4b261c5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / winsddl-0.1.1-py3-none-any.whl
| Download URL | winsddl-0.1.1-py3-none-any.whl |
|---|---|
| Size | 51.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f2bc0f83e7c6c3aebbf2368755f30ee31a347487668428c651800344013cb54
|
|
BLAKE2b-256 checksum How to use checksums |
06632d52672bde9cf6df3a0ea389ba552acc6e5af15fd5965653a536f3da3615
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for winsddl 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.