prowler-cloud / prowler

Prowler is an Open Source Security tool for AWS, Azure, GCP and Kubernetes to do security assessments, audits, incident response, compliance, continuous monitoring, hardening and forensics readiness. Includes CIS, NIST 800, NIST CSF, CISA, FedRAMP, PCI-DSS, GDPR, HIPAA, FFIEC, SOC2, GXP, Well-Architected Security, ENS and more
https://prowler.com
Apache License 2.0
10.53k stars 1.51k forks source link

fix(outputs): refactor unroll_tags to use str as tags #4817

Closed pedrooot closed 3 weeks ago

pedrooot commented 3 weeks ago

Context

The tags can also be unique strings; until now, they were expected to have the key: value format.

Fix #4740 Fix #4799

Description

unroll_tags method has been modified to manage str as tags for resources:

>>> tags = ["name", "age"]
>>> unroll_tags(tags)
{'tag0': 'name', 'tag1': 'age'}

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.06%. Comparing base (a557d62) to head (476a181).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4817 +/- ## ======================================= Coverage 89.05% 89.06% ======================================= Files 926 926 Lines 28363 28365 +2 ======================================= + Hits 25258 25262 +4 + Misses 3105 3103 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sergargar commented 3 weeks ago

Using this approach for cases of tags without values like:

{
    "tags": {
        "Author": ""
    }
}
github-actions[bot] commented 3 weeks ago

💚 All backports created successfully

Status Branch Result
✅ v4.3

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details