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

Modules from Private Registries can not be parsed #302

Closed mhennecke closed 1 year ago

mhennecke commented 1 year ago

Describe the bug Modules from private registries can not be parsed and will be ignored. yor outputs a warning and ignores the module.

To Reproduce Steps to reproduce the behavior:

  1. Use yor in terraform stack where at least one module is referenced from a private module registry
  2. Make sure to have valid credentials for private registry terraform login some.private.registry
  3. Run yor tag -d . in terraform stack
  4. Yor ignores module and outputs following warning
    [WARNING] failed to parse hcl module in directory some.private.registry/namespace/name/aws/some.private.registry/namespace/name/aws because of errors Failed to read module directory: Module directory some.private.registry/namespace/name/aws does not exist or cannot be read.

Expected behavior Yor parses and tags module.

Desktop:

Additional context

module "example" {
  source  = "some.private.registry/namespace/name/aws"
  version = "1.0.0"
}