orcasecurity/orca-skills/orca-inactive-identities-cleanup
Claude Code and agent skill by orcasecurity/orca-skills
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Inactive-identity cleanup - finds inactive identities (users, groups, and non-human identities) across an account, business unit, or tag in every cloud provider Orca supports (AWS, Azure incl. Entra ID, GCP incl. Google Workspace, Alibaba Cloud, OCI, Tencent Cloud), ranks them by identity risk score (highest risk first), and drives remediation through a non-destructive path (disable) or a destructive path (delete) that always requires explicit confirmation. Asks for the inactivity time frame (e.g. last 60 days) when the user hasn't given one. Use when the user wants to clean up inactive or dormant identities, offboard unused users or service accounts, delete stale groups, or shrink the identity attack surface (e.g. "clean up inactive identities", "find dormant users", "disable unused service accounts").
Install
npx vskill@latest install orcasecurity/orca-skills/orca-inactive-identities-cleanupSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as orcasecurity/orca-skills/orca-inactive-identities-cleanup.
Orca Inactive-Identity Cleanup Skill
Answers the question: "Which of our identities are dead weight, and how do we safely disable or delete them?"
Every identity that exists but is never used is pure attack surface: it can be phished, its keys can leak, and nobody notices when it starts doing things. This skill sweeps an account or business unit for inactive users, groups, and non-human identities (NHIs), ranks them by identity risk score, and walks the user through cleanup with a non-destructive path (disable) and a destructive path (delete) that is always gated behind explicit confirmation.
The core signal: every identity Orca covers carries a pre-computed activity verdict on the asset itself: LastActiveTime (when it last did anything) and IsIdentityActive (Orca's uniform 90-day activity convention, computed at scan time). This holds across all six supported providers: AWS, Azure (incl. Entra ID), GCP (incl. Google Workspace), Alibaba Cloud, OCI, and Tencent Cloud. Read the verdict off the asset first; CDR log replay is corroboration, never the primary source.
Usage
Or natural language:
- "clean up inactive identities in acme-production"
- "which users haven't been active in the last 60 days?"
- "find groups nobody uses and get rid of them"
- "disable the dormant service accounts in the Production BU"
- "any stale RAM users in our Alibaba account?"
Processing Logic
Step 1: Resolve scope and time frame
- Resolve scope first (ask if not given). The skill needs a scope before anything else. Accept any one of three:
- Account id used directly.
- Business unit:
get_business_units_datareturns the BU's saved filter (accounts, providers, tags), not a ready-made account list, so derive the member accounts from that filter before sweeping. The response is large, unpaginated, and has no name filter (100K+ chars, routinely over the token limit and dumped to a file); grep it for the BU name with a narrow context window (~60-120 chars each side, wider matches can be silently truncated by the harness) instead of reading the whole blob. - Tag (
--tag key=value, repeatable, or "identities tagged env=prod" in words): sweep every identity carrying the given tag(s), across accounts. Express the tag in the Step 2discovery_searchquery; if the query can't honor it, post-filter retrieved results on the identity's tag fields (OrcaTags/Tags/ModelTags). A tag scope is bounded by the tag, not the whole org, but it can still match a lot, so the large-account handling in Step 4 / the Edge Cases applies.
Disambiguating an unclear scope, in this order: an all-digits string is an account id; otherwise check business-unit names first (via get_business_units_data) before assuming a tag; treat it as a tag only if it's key=value or the user said "tag". Guessing a tag first wastes calls, a non-existent tag field returns a 400. If the user gave none of the three, ask which account, business unit, or tag to sweep (offer to list the visible BUs) and wait. Never sweep a whole org by default. A tag may also be combined with an account/BU to narrow further, but on its own it is a valid scope.
Confirm scope size before sweeping. Once resolved, if the scope expands to more than 3 accounts or spans more than 2 cloud providers, show the breakdown (accounts, providers, rough count from total_items) and confirm how to prioritize before sweeping. A named BU is often bigger than the user expects, and "never sweep a whole org" doesn't cover "this BU is larger than you think".
- Resolve the time frame (ask if not given), once scope is known. If the user did not specify an inactivity window (via
--inactive Ndor in their phrasing, e.g. "last 60 days"), ask:
> *"What inactivity window should I use? 90 days is Orca's built-in convention (recommended); common alternatives are 30, 60, or 180 days. You can also give me a custom one."*
- Default 90d maps directly onto the pre-computed
IsIdentityActive: falseverdict (the strongest, scan-time signal). - Any positive window is accepted (30d, 60d, 180d, 365d, and so on, there is no fixed list). It is evaluated by comparing the asset's
LastActiveTimeagainst the cutoff, andLastActiveTimereaches back years, so long windows work fine. A shorter window (e.g. 30d) flags more identities but with more false positives (vacations, quarterly jobs); a longer one (180d+) is more conservative. State this trade-off in the output. The only thing a custom window cannot decide is an identity with no `LastActiveTime` at all (see the no-activity-fields edge case), which stays in the "no signal" bucket regardless of window. - Never re-ask on drill-downs or follow-up actions in the same session; the chosen window sticks until the user changes it.
Step 2: Enumerate identities
Primary path: `discovery_search` (if enabled). Query identities with IsIdentityActive = false (or fetch and post-filter on LastActiveTime for custom windows) across:
Don't assume one query returns every identity.discovery_searchreturns a bounded, risk-ordered result set (readtotal_itemsfor the true count and the result'sapp_urlfor the full list in the Orca app). A small account comes back whole; a large one (hundreds to ~10k) does not, and that is fine for a risk-first cleanup: retrieve the highest-risk inactive identities (narrow by risk band or provider only if the account is large enough to need it), act on that top slice, and reporttotal_itemsas the real total. Rank within what you retrieved and call it a best-effort ordering of the highest-risk slice, not a global sort of all N. This holds regardless of the current result limit, if the surface later paginates or raises the cap, just retrieve more; the approach is unchanged. Enumerate across:
| Provider | Users | Groups | NHIs / roles | |
|---|---|---|---|---|
| AWS | AwsUser, AwsSsoUser | AwsIamGroup, AwsSsoGroup | AwsIamRole, AwsSsoPermissionSet | |
| Azure / Entra ID | AzureUser | AzureGroup | AzureServicePrincipal (incl. managed identities), AzureIamRoleAssignment for the grant side | |
| GCP / Google Workspace | GcpUser (Workspace users appear here when the integration is on) | GcpGroup | GcpIamServiceAccount (+ GcpIamServiceAccountKey), GcpIamPolicyBindingRecommendation for the grant side | |
| Alibaba Cloud | AliCloudUser | AliCloudRamGroup | AliCloudRamRole | |
| OCI | OciUser | OciIamGroup, OciIamDynamicGroup | dynamic groups act as the workload-identity primitive | |
| Tencent Cloud | TencentCloudUser | TencentCloudCamGroup | TencentCloudCamRole |
Fallbacks, in order (discovery_search may return Feature is not enabled, and it can also fail transiently with 5xx errors while the asset and alert surfaces keep working; fall back on either signal):
- Alert-anchored enumeration. Orca ships built-in inactive-identity alert rules; every alert of these types marks an inactive identity, so
get_alerts_with_similar_alert_typeon them rebuilds the inventory. Machine alert types (pass these exact strings):
| Provider | Inactive users | Inactive groups | Inactive NHIs / roles | |
|---|---|---|---|---|
| AWS | aws_inactive_user | aws_unused_groups, aws_inactive_group_with_inactive_users | aws_iam_old_role_without_policy, aws_iam_old_role_with_policy, aws_unused_external_identity_role | |
| Azure | azure_inactive_user | azure_inactive_group_without_users, azure_inactive_group_with_inactive_identities | azure_inactive_service_principal | |
| GCP | google_workspace_inactive_user (note: not gcp_inactive_user) | google_inactive_group_with_inactive_users | gcp_inactive_service_account | |
| AliCloud | alicloud_inactive_user, alicloud_unused_user_with_console_logon | alicloud_inactive_group_without_users, alicloud_inactive_group_with_inactive_users | no role rule | |
| OCI | oci_inactive_user | oci_inactive_group_without_users, oci_inactive_group_with_inactive_users | no role rule | |
| Tencent | none | none | none |
Unused-credential types (aws_unused_aws_credentials, aws_credentials_older_than_90_days, oci_iam_credentials_unused_for_45_days, tencent_user_access_key_not_rotated_90_days) corroborate and partially cover the gaps.
Each returned alert embeds the identity asset, its LastActiveTime/CreationTime, attached policies, and Orca's own RemediationCli / RemediationConsole steps; reuse those remediation steps when generating artifacts for the less-battle-tested providers (Alibaba, OCI, Tencent).
Caveats of this path: the rules bake in Orca's 90d convention, so a custom window can't be honored here; dismissed/suppressed alerts hide their identities; Tencent has no inactive-identity rules and only AWS has role-inactivity rules. It also returns a small, unpaginated page (total_items far exceeds the handful of rows returned, e.g. 63 total but 5 returned) and isn't scoped per tenant, so it's a spot-check, not complete enumeration in multi-tenant orgs. State that the inventory is "identities Orca currently alerts on" and cover the gaps with path 3.
get_linked_entities_mappingon key compute assets to walk to workload identities (instance to instance profile to role).get_asset_by_nameper identity or name pattern, readingIsIdentityActive/LastActiveTimeoff each asset (works whenever the serving layer is up, including when discovery is down).
Classify each identity into the three buckets this skill acts on:
- Human users (console password, MFA, interactive sessions).
- Groups (all six providers have group models).
- NHIs (roles, service accounts, service principals and managed identities, plus service-account-style users: password disabled, an active access key, API-only usage).
Model-type caveat:get_asset_by_name/get_asset_by_idreject unknownmodel_typevalues (e.g.AwsIamUsererrors). Run a defaultInventorylookup first and read the asset's realtypefield rather than guessing; MCP-reported names can differ slightly from internal model names (e.g.AwsRolevsAwsIamRole).
Never trust the query's "inactive" wording, re-check the field. A natural-languagediscovery_searchfor "inactive X" is unreliable both ways: it returns empty for some providers even when inactive identities exist, and it can include active identities in the results. Query broadly (by identity type) and decide inactivity yourself from each asset'sIsIdentityActive/LastActiveTime, never from the fact that an item came back.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/orca-inactive-identities-cleanup/SKILL.md
Popularity
- Repository stars
- 52
- Repository forks
- 12
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/orcasecurity/orca-skills/orca-inactive-identities-cleanup)