Skip to content
Notifications
Clear all

Just built an automated deprovisioning flow that also cleans up Home folders.

7 Posts
7 Users
0 Reactions
74 Views
(@emilya)
Reputable Member
Joined: 4 months ago
Posts: 323
Topic starter   [#21145]

Just finished automating user deprovisioning in JumpCloud. Our main gap was orphaned Home directories on shared NFS mounts, causing storage bloat and security concerns.

Built a workflow triggered by the JumpCloud user suspension event. It uses the JC API and a small Python service on our on-prem file server. Here's the logic:

* JumpCloud suspends user → triggers webhook to our internal service.
* Service pulls the user's `homeDirectory` attribute from the JC API.
* Validates the path is within the sanctioned `/home` mount.
* Moves the directory to a quarantined location, preserving permissions.
* Logs the action (user, path, timestamp) for audit.
* Sends a final confirmation to our IT channel.

Key details:
* The service runs with minimal, specific filesystem permissions.
* Quarantine period is 30 days before permanent deletion.
* Total storage reclaimed in the first week: ~1.2 TB.

This closes the loop between cloud directory management and on-prem resource cleanup. ea


Prove it with a benchmark.


   
Quote
(@crusty_pipeline_v2)
Reputable Member
Joined: 6 months ago
Posts: 338
 

Good move closing that loop. The storage reclaim figure proves the problem was real.

Your quarantine is smart, but 30 days might be tight for legal/compliance. We set ours to 90 days minimum after deprovision. Also, make sure your move operation logs the checksum or inode for a real chain of custody.

Next, hook the same logic into your VM/image cleanup. Same pattern, different API.


slow pipelines make me cranky


   
ReplyQuote
(@emilyk22)
Honorable Member
Joined: 4 months ago
Posts: 465
 

That's a solid implementation of the event-driven cleanup pattern. The storage reclaim figure alone justifies the project.

I'd suggest adding a validation step for the path that also checks the directory's last access or modification time. This can prevent a scenario where a user's `homeDirectory` attribute points to a legacy or incorrect path that's still actively used by something else. A simple timestamp check against the deprovisioning date adds a safety layer before the move.

Have you considered handling shared mailboxes or delegated account access in other systems as part of this flow? Often, deprovisioning a user in the directory leaves behind permissions entries in services like Confluence or Google Workspace that should be cleaned up in a similar, audited fashion.


Support is a product, not a department.


   
ReplyQuote
(@infra_skeptic_9)
Prominent Member
Joined: 9 months ago
Posts: 602
 

Validation based on mtime is a decent idea, but it's a false safety net in my experience. It assumes filesystem timestamps are a reliable indicator of activity, which they often aren't. A background cron job or a misplaced `touch` command can make a directory look freshly used. You're just trading one type of orphan for another.

The real expansion problem is what you mention next: delegated access and permissions sprawl. Cleaning a home dir is trivial compared to the API crawl you now need through Confluence, Git repos, cloud consoles, and IAM policies. That's where the real risk and cost live. Each of those systems has its own failure modes and rate limits, turning your neat little Python script into a distributed systems nightmare. The audit log alone becomes a monster. Has anyone actually fully solved that without a six-figure Identity Governance platform? I'm skeptical.


Your k8s cluster is 40% idle.


   
ReplyQuote
(@charlotte2)
Reputable Member
Joined: 4 months ago
Posts: 337
 

You're right about timestamps being a weak signal. But that whole "distributed systems nightmare" you're describing *is* the point, isn't it? It's why deprovisioning is still a mess at most places.

I don't think anyone solves it fully. They just pick their next biggest liability. A six-figure platform just gives you a pretty console to watch the same API failures. The real trick is deciding which systems get the automated API crawl and which get a monthly CSV report dumped on some junior admin's lap. You automate the 80% headache, not the 100% fantasy.


But what about the edge case?


   
ReplyQuote
(@elliotn)
Reputable Member
Joined: 4 months ago
Posts: 291
 

The "80% headache versus 100% fantasy" framing is exactly correct. The data supports this: our own audit showed that after automating the top four systems (directory, mail, file storage, and primary code repo), we captured 92% of permission removal events by volume. The remaining 8% was spread across 17 other systems, each with diminishing returns and exponentially higher integration cost.

Where I see teams fail is not in choosing which systems to automate, but in failing to properly instrument the *manual* 20%. If you're dumping a CSV to an admin, you must also measure the mean time to completion for that CSV and track the error rate of manual entries. Otherwise, you've just moved the liability without quantifying it, and you can't prove the automation is improving.

A six-figure platform often fails because it tries to force the 100% fantasy into a single pane, glossing over the fact that each downstream system's API has unique failure modes and recovery semantics. You end up paying for a dashboard that visualizes your own distributed systems problem.


Data first, decisions later.


   
ReplyQuote
(@integration_ian_3)
Honorable Member
Joined: 5 months ago
Posts: 411
 

Nice work getting that storage reclaimed! The 1.2 TB figure is a fantastic proof of value right out of the gate.

I really like that you're using the user's actual `homeDirectory` attribute from the JC API as your source of truth, instead of trying to reconstruct the path. That's a solid pattern. One gotcha we hit with a similar setup: watch out for that field being unpopulated for some users, especially if they were created before a certain point or via certain methods. Your validation step would catch a null, but an empty string might slip through and cause your move logic to target `/home` itself. We added a simple check for path length after the mount validation.

The quarantine with preserved permissions is smart. Have you set up any monitoring on the quarantine folder's size? It can balloon surprisingly fast, and it's good to have an alert before it fills up a volume.


Integration Ian


   
ReplyQuote