Project overview

A simple, automated tool designed to securely rotate passwords across multiple Active Directory domains. Tailored specifically for Managed Service Providers (MSPs), it removes the risk of compromised credentials by regularly and automatically updating passwords—and keeping unique in each environment.

Requirements

The requirements for this project were simple, but I could not find someone else who tried (or wanted to) something like this. Either way, a simple set of goals to achieve during the project was important to not get too far off course.

  • Ability to automatically reset active directory user objects passwords.
  • A way to securely connect to DCs (Domain controllers) using LDAPS
  • Secure GUI for CRUD (Create,Read,Update,Delete) of endpoints
  • Secure GUI for CRUD of accounts.
  • Extensive logging capabilties for auditing.

Challenges

Implementing a robust, automated password management solution posed several significant security challenges, from securely communicating with domain controllers across multiple environments to reliably resetting passwords without disruption. Ensuring the security of password data while minimizing manual intervention required careful consideration of potential vulnerabilities, including:

  • Single Point of Compromise Risk
  • Domain controller connectivity
  • Secure credential transmission
  • Password reset reliability and trust
  • Credential encryption & security

Approach & Solution

Leveraging Microsoft's LDAP and LDAPS protocols made communicating with Active Directory straightforward, even remotely. However, continuously managing connections, securely resetting account passwords, and reliably verifying each operation posed significant logistical challenges. To address this, I developed a decentralized system using independent agents connected via a REST API.

Each agent securely maintains a shared key with the controller, enabling password generation directly at the endpoint. This design significantly reduces network exposure, ensures operations are easily verified, and provides a reliable solution to help if an error were to occur.

Authentication example

This solution was espically great as it resolved a ton of security concerns.

  • The controller no longer needed to know the IP address of each environment in a one-way exchange Instead UIDs were provided, but in most cases a two-way connection is kept mostly to help resolve man-in-the-middle attacks.
  • Firewall rules exposing ports 389/636 for external connections not required.
  • A global administrator account was not required as the agent is installed as a service.

The Results

Developing the Active Directory Password Rotator provided significant experience with secure application design, REST APIs, and robust password management strategies using C#. Through this project, I gained valuable insights into best practices for securely communicating across distributed environments, including handling JWT-based authentication, CORS policies, LDAPS for encrypted connections, and securely managing sensitive credentials within multi-domain environments.

While the project successfully streamlined password management across multiple domains, it also revealed critical security considerations and potential vulnerabilities inherent in centralized credential management solutions. This awareness allowed me to implement stronger, more secure approaches in subsequent projects, enhancing my understanding of security concepts such as deterministic password generation, encryption best practices, and the importance of validating every interaction between distributed components.

Ultimately, the solution streamlined password rotation tasks, significantly reducing manual workload. However, it also demonstrated that sometimes complex automation isn't justified when the manual task itself is already efficient—taking at most one hour to manage password resets manually across numerous domains. Espically with the high security concerns. The juice was not worth the squeeze. Despite this, the insights and security practices learned became invaluable tools for future development projects.