Security Task Automation: A Repeatable Pattern That Scales
Every security team has at least one task that nobody owns but everyone dreads. Quarterly credential rotation. Access review sign-offs. Log retention checks before an audit. These recurring manual tasks don’t get automated because they’re not glamorous — they just get tolerated until someone forgets, and then they become an incident.
In 25 years of enterprise IAM work, I’ve watched this pattern repeat across every organization I’ve touched: the task is well-understood, boring, and low-priority right up until it isn’t. The fix isn’t a bigger team. It’s a repeatable automation pattern you can apply to any recurring manual task, not just the one in front of you.
Here’s the pattern I use now, and a real example of where I applied it.
What Makes a Manual Task Worth Automating
Not every recurring task deserves automation. Before I touch a script, I run three checks:
- Frequency — does it happen on a fixed or predictable schedule? Weekly, monthly, quarterly.
- Determinism — is the decision rule clear enough that a human doesn’t need judgment to execute it? “Flag any credential older than 90 days” is deterministic. “Decide if this access request looks suspicious” isn’t.
- Cost of missing it — what actually happens if the task slips a cycle? If the answer is “nothing material,” it’s not worth automating yet. If the answer is “a stale secret sits in production for six more months,” automate it now.
Tasks that pass all three are candidates for a repeatable automation pattern. Tasks that fail determinism need a human in the loop no matter how much AI tooling gets thrown at them — that’s a separate problem, and a dangerous place to over-automate.
Building a Repeatable Security Automation Pattern
The pattern itself is simple and holds up across almost any recurring task:
- Detect — a script or scheduled job checks the current state against the rule.
- Flag, don’t act — the first version of any automation should surface a problem, not silently fix it. You want visibility before you want autonomy.
- Route to a system of record — push the flag somewhere it can’t be ignored (a ticket, not a Slack message that scrolls away).
- Close the loop — once you trust the detection logic, let the automation resolve the simple cases itself and keep escalating the ambiguous ones.
That order matters. Skipping straight to step 4 is how teams end up with automation nobody trusts, because the first false positive makes everyone turn it off.
The Real Example: Credential Age Checks on AWS SSM
I run ABT’s own secrets through AWS Systems Manager Parameter Store. The recurring manual task was straightforward: periodically check which parameters hadn’t been rotated past a reasonable age, and do something about the stale ones before they became the forgotten credential that sits untouched for a year.
The first version was deliberately dumb — a scheduled script, not a service:
import boto3
from datetime import datetime, timezone
ssm = boto3.client("ssm")
MAX_AGE_DAYS = 90
def check_parameter_age():
paginator = ssm.get_paginator("describe_parameters")
stale = []
for page in paginator.paginate():
for param in page["Parameters"]:
last_modified = param["LastModifiedDate"]
age_days = (datetime.now(timezone.utc) - last_modified).days
if age_days > MAX_AGE_DAYS:
stale.append((param["Name"], age_days))
return stale
if __name__ == "__main__":
for name, age in check_parameter_age():
print(f"STALE: {name} — {age} days old")
That’s it. No alerting integration, no remediation logic, no autonomy. It runs, it flags, it prints. The next iteration piped that output into a ticket instead of a terminal, so a stale parameter became a tracked item instead of something I’d only notice if I happened to be looking.
The task that used to live in my head as “remember to check this sometime” now runs on a schedule and produces a list. I didn’t need an AI agent, a pipeline, or a dashboard. I needed the detect-flag-route loop, applied consistently.
Where This Pattern Breaks Down
It’s worth being honest about the limits. This pattern works cleanly for deterministic checks — age, presence, absence, threshold. It does not work for anything requiring judgment about intent, like deciding whether an access pattern looks malicious or whether a configuration change is risky in context. Teams that try to extend a detect-and-flag script into a decide-and-act system for ambiguous cases end up automating bad judgment at scale, which is worse than the manual process it replaced.
If you’re evaluating where to apply this pattern, start with tasks where the answer is a fact, not an opinion. Credential age is a fact. “Is this login suspicious” is an opinion dressed up as a fact, and that’s where a lot of automation projects quietly go wrong.
Key Takeaways
- A repeatable automation pattern only works on tasks that are frequent, deterministic, and costly to miss — not everything qualifies.
- Build detect-and-flag before you build decide-and-act. Trust the detection logic before you hand it autonomy.
- Route flags to a system of record, not a channel that scrolls away. If it’s not tracked, it’s not fixed.
- Keep automation deterministic. The moment a task requires judgment instead of a rule, it needs a human, not a script.
- The smallest version of the fix — a script that prints a list — is often the one that actually gets used.
If you’re trying to figure out where your own recurring manual tasks are hiding, that’s the kind of loop we build hands-on at the December 5th build event: detect, flag and route, wired into your own project instead of a hypothetical one.
Comments