---
title: "Ensure Secret Manager secret is encrypted using KMS"
canonical: "https://kb.cynergy.app/space/MD/1164607496/Ensure%20Secret%20Manager%20secret%20is%20encrypted%20using%20KMS"
format: markdown
---
# Description

The Secret Manager service provides a secure way to store and manage sensitive data like API keys and passwords in one place. By default, these secrets are encrypted at rest via Google’s Key Management Service (KMS), ensuring data protection. Encrypting your CodeBuild projects with KMS adds an extra layer of security, safeguarding confidential details such as passwords or proprietary data from unauthorized access, which is crucial when handling sensitive project information.

# Fix - Build time

## Terraform

- **Resource:** aws_secretsmanager_secret
- **Argument:** kms_key_id

```
resource "aws_secretsmanager_secret" "example" {
              name = "example"
 +            kms_key_id = "arn:kuku:kisi"
            }
```