Skip to content

KMS Keys filtering doesn't work #950

@Deipzza

Description

@Deipzza

I found two issues regarding the filtering of KMS Customer Managed Keys:

  1. I'm trying to filter my KMS keys for deletion, but the regex doesn't work for the alias.

With this configuration on my config.yaml file:

KMSCustomerKeys:
  include_unaliased_keys: true
  include:
    names_regex:
      - alias/.*delete.*
      - .*delete.* # or even with this

I get this output:

Image

Even though I have more than one key that matches:

Image
  1. Also, it seems like the include_unaliased_keys isn't being correctly detected by the command.

On my config.yaml file I have this:

KMSCustomerKeys:
  include_unaliased_keys: true

But when I run cloud-nuke aws --config config.yaml --region xxx --resource-type kmscustomerkeys I see that is set to false in the terminal:

# AWS Resource Query Parameters
┌─────────────────────────────────────────────┐
| Query Parameter         | Value             |
| ------------------------------------------- |
| Target Regions          | xxx               |
| Target Resource Types   | kmscustomerkeys   |
| List Unaliased KMS Keys | false             |
└─────────────────────────────────────────────┘

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions