bridgecrewio / yor

Extensible auto-tagger for your IaC files. The ultimate way to link entities in the cloud back to the codified resource which created it.
https://www.yor.io
Apache License 2.0
810 stars 123 forks source link

Custom tags not being applied with --config-file flag or --custom-tagging flag #363

Closed hwsonnnn closed 1 year ago

hwsonnnn commented 1 year ago

Describe the bug Hello,

I'm having an issue with Yor where custom tags are not being applied when using the --config-file flag and --custom-tagging flag. However, Yor works as expected when using the default tags without these flags. Here's the process I've followed:

  1. I've created a custom_tags.yml file in the root directory with the following contents:
custom_tags:
  - key: "custom_key"
    value: "custom_value"
    paths:
      - "modules/ec2/*"
  - key: "another_key"
    value: "another_value"
    paths:
      - "modules/iam/*"

I ran the following command: bash yor tag --config-file custom_tags.yml -d modules yor tag --custom-tagging custom_tags.yml -d modules

Yor seems to scan the resources, but it doesn't update the files with the custom tags. On the other hand, when I run yor tag -d ., the default tags are applied correctly.

I've also tried adding the default tags: section to the custom_tags.yml file, but I'm still experiencing the same issue.

Please let me know if there's something I'm missing or if there's a workaround for this issue. Thank you for your assistance!

스크린샷 2023-05-08 오후 4 58 23

Desktop (please complete the following information):

hwsonnnn commented 1 year ago

And I'm also experiencing the same issue with the following YAML configuration and bash command, where the files are not being updated:

yaml

name: project
value:
    default: yor-custom-test

bash

yor tag --config-file custom_tags.yml -d modules
yor tag --custom-tagging custom_tags.yml -d modules
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.