---
title: Unused credentials should be deactivated or removed
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > Unused credentials should be
  deactivated or removed
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Unused credentials should be deactivated or removed
 
## Description{% #description %}

AWS IAM users can access AWS resources using credentials such as console passwords and access keys. Any active console password or access key that has not been used for 45 days or more should be deactivated or removed. This rule uses the `password_last_used`, `access_key_1_last_used_date`, and `access_key_2_last_used_date` fields in the IAM credential report. For credentials that have never been used, it uses the last change or rotation date instead. Disabling or removing unused credentials reduces the window of opportunity for credentials associated with a compromised or abandoned account to be used.

## Remediation{% #remediation %}

1. Identify console passwords and access keys that have not been used for 45 days or more, as described in [Finding unused AWS credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_finding-unused.html).
1. For each unused console password identified in step 1, disable that user's console access, as described in [Manage passwords for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_admin-change-user.html).
1. Deactivate or delete each such access key. See [Update access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id-credentials-access-keys-update.html).

## References{% #references %}

- [Finding unused AWS credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_finding-unused.html)
- [Manage passwords for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_admin-change-user.html)
- [Update access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id-credentials-access-keys-update.html)
- [Getting credential reports for your AWS account](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html)
- [CIS Amazon Web Services Benchmarks](https://www.cisecurity.org/benchmark/amazon_web_services)
