How to Create Custom Protected Attribute in Active Directory
What is an Active Directory Schema Attribute?
The Active Directory (AD) schema is the blueprint that defines the structure of data stored in AD. It specifies which object classes (e.g., user, group, computer) and attributes are available, as well as the data types of these attributes.
An attribute is a piece of data associated with an AD object. For example:
sAMAccountName
→ The user's logon namemail
→ The user's email address
What is a Custom Attribute?
A custom attribute is a new attribute added to the AD schema to meet specific organizational needs that are not covered by the default schema. For instance:
Employee ID numbers
Department-specific codes
License assignment status for users
A mobile phone number that needs to remain confidential
Why Create Custom Attributes?
Custom attributes are created for the following reasons:
Business Requirements: To store information that is necessary for business processes but not available in the default schema.
Integration: To adapt AD for integration with custom applications or third-party systems (e.g., an HR system).
Reporting and Management: To enable more detailed reporting or to track specific data for users, groups, or computers.
Advanced Automation: When automating tasks with tools like PowerShell, custom attributes provide additional flexibility.
Requirements for Creating Custom Attributes
Creating custom attributes involves certain prerequisites and considerations:
Schema Admin Permissions:
Only members of the Schema Admins group can make changes to the AD schema.
Planning and Testing:
Schema changes are permanent and irreversible, so careful planning and testing in a non-production environment are essential.
Global Impact:
Changes to the schema are applied across the entire forest and are shared by all domains within it.
Appropriate Data Type:
You must choose the correct data type for the custom attribute (e.g.,
String
,Integer
,Boolean
).
Naming Conflicts:
Custom attribute names must not conflict with existing schema attributes.
Replication Considerations:
New attributes increase the replication load on domain controllers, so only necessary attributes should be added.
How to Create a Custom Attribute via Management Console
Enable Schema Management:
Use the command
regsvr32 schmmgmt.dll
to enable the schema management snap-in on your system.
Add Attribute via MMC:
Open the Active Directory Schema snap-in in Microsoft Management Console (MMC) and define the new attribute.
Link Attribute to Object Class:
Assign the newly created attribute to an object class (e.g.,
user
,group
).
Test and Replicate:
Once the attribute is replicated across domain controllers, test it to ensure it works as expected.
Example Use Case
A company needs to track the project assignment date for users. To achieve this:
Create a custom attribute called
projectStartDate
.Set the data type to
Date
.Add this attribute to the
user
object class.
Once added, tools like PowerShell or LDAP queries can manage and report on this new attribute.
Note: Schema changes affect the entire AD forest and cannot be undone. Always implement changes in a test environment first to avoid potential production issues.
What is a Protected Attribute in Active Directory?
A protected attribute in Active Directory is an attribute whose access is tightly controlled to ensure the security and integrity of sensitive data. These attributes often contain critical or sensitive information, such as passwords or security identifiers, that must be protected from unauthorized access or modification.
Protected attributes are typically governed by Access Control Lists (ACLs), which define who can read, write, or modify these attributes. Only highly privileged accounts, such as Domain Admins, Enterprise Admins, or system accounts like the Local System, are granted access to protected attributes.
Examples of Protected Attributes
Some common protected attributes include:
unicodePwd
Stores the user's password in an encrypted format.
Only writable by system processes (e.g., during password resets); it is not readable even by administrators.
userAccountControl
Manages account flags like enabling/disabling accounts, requiring passwords, etc.
Modification requires specific privileges.
msDS-PasswordSettings
Used in Fine-Grained Password Policies to store password policy settings.
Protected to ensure unauthorized changes do not weaken security.
dBCSPwd
(legacy attribute)Historically stored LM hash values of passwords.
Now deprecated but remains highly protected.
Why Are Attributes Protected?
Protected attributes exist to:
Ensure Security: Prevent unauthorized users from accessing or tampering with sensitive data like passwords or account configurations.
Maintain Data Integrity: Protect critical configurations to avoid accidental or malicious changes that could disrupt services.
Comply with Regulations: Organizations must adhere to compliance frameworks like GDPR, HIPAA, etc., that require securing sensitive information.
How Are Protected Attributes Controlled?
Access Control Lists (ACLs):
Define which users or groups have permission to read, write, or modify an attribute.
Example: By default, only Domain Admins or Enterprise Admins have write access to the
userAccountControl
attribute.
AdminSDHolder Object:
Certain high-privilege accounts (e.g., members of Domain Admins) inherit their attribute protection from the AdminSDHolder object.
Ensures consistent and secure permissions across protected accounts.
Read and Write Restrictions:
Some attributes, like
unicodePwd
, are write-only. Even administrators cannot read this value; they can only reset it.
Auditing and Monitoring:
Any changes to protected attributes can be monitored using Active Directory auditing, which logs who accessed or modified these attributes.
Can Protected Attributes Be Modified?
Directly: Only if the user has sufficient privileges, such as being a member of the Schema Admins or Domain Admins group, and if the ACL explicitly allows it.
Indirectly: Some attributes (like
unicodePwd
) can only be modified through specific AD tools or APIs (e.g., when resetting a password using the Active Directory Users and Computers (ADUC) console or PowerShell).
Best Practices for Protected Attributes
Restrict Privileged Access: Use Role-Based Access Control (RBAC) to limit who can access or modify sensitive attributes.
Enable Auditing: Track changes to protected attributes using AD's auditing capabilities.
Use Secure Tools: Modify protected attributes using secure and approved methods (e.g., PowerShell, ADUC).
Regularly Review ACLs: Ensure that permissions on critical attributes are not overly permissive.
Protected attributes play a key role in safeguarding Active Directory's security. Managing them properly is critical to prevent unauthorized access and potential breaches.
High-Level Steps to Create a Protected Attribute
Log in as a Schema Admin.
Create a new multi-valued string attribute.
Secure the attribute with appropriate access controls.
Add the attribute to the
user
class.Create the
CepTelReader
group.Grant read permissions for the attribute to the
CepTelReader
group.Assign the
ceptel
attribute to a user.Test the functionality and permissions.
Last updated