Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(compliance): add ens for azure and gcp #5746

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ It contains hundreds of controls covering CIS, NIST 800, NIST CSF, CISA, RBI, Fe
| Provider | Checks | Services | [Compliance Frameworks](https://docs.prowler.com/projects/prowler-open-source/en/latest/tutorials/compliance/) | [Categories](https://docs.prowler.com/projects/prowler-open-source/en/latest/tutorials/misc/#categories) |
|---|---|---|---|---|
| AWS | 553 | 77 -> `prowler aws --list-services` | 30 -> `prowler aws --list-compliance` | 9 -> `prowler aws --list-categories` |
| GCP | 77 | 13 -> `prowler gcp --list-services` | 2 -> `prowler gcp --list-compliance` | 2 -> `prowler gcp --list-categories`|
| Azure | 138 | 17 -> `prowler azure --list-services` | 3 -> `prowler azure --list-compliance` | 2 -> `prowler azure --list-categories` |
| GCP | 77 | 13 -> `prowler gcp --list-services` | 3 -> `prowler gcp --list-compliance` | 2 -> `prowler gcp --list-categories`|
| Azure | 138 | 17 -> `prowler azure --list-services` | 4 -> `prowler azure --list-compliance` | 2 -> `prowler azure --list-categories` |
| Kubernetes | 83 | 7 -> `prowler kubernetes --list-services` | 1 -> `prowler kubernetes --list-compliance` | 7 -> `prowler kubernetes --list-categories` |

# 💻 Installation
Expand Down
30 changes: 30 additions & 0 deletions prowler/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
from prowler.lib.outputs.compliance.cis.cis_kubernetes import KubernetesCIS
from prowler.lib.outputs.compliance.compliance import display_compliance_table
from prowler.lib.outputs.compliance.ens.ens_aws import AWSENS
from prowler.lib.outputs.compliance.ens.ens_azure import AzureENS
from prowler.lib.outputs.compliance.ens.ens_gcp import GCPENS

Check warning on line 57 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L56-L57

Added lines #L56 - L57 were not covered by tests
from prowler.lib.outputs.compliance.generic.generic import GenericCompliance
from prowler.lib.outputs.compliance.iso27001.iso27001_aws import AWSISO27001
from prowler.lib.outputs.compliance.kisa_ismsp.kisa_ismsp_aws import AWSKISAISMSP
Expand Down Expand Up @@ -511,6 +513,20 @@
)
generated_outputs["compliance"].append(mitre_attack)
mitre_attack.batch_write_data_to_file()
elif compliance_name.startswith("ens_"):

Check warning on line 516 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L516

Added line #L516 was not covered by tests
# Generate ENS Finding Object
filename = (

Check warning on line 518 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L518

Added line #L518 was not covered by tests
f"{output_options.output_directory}/compliance/"
f"{output_options.output_filename}_{compliance_name}.csv"
)
ens = AzureENS(

Check warning on line 522 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L522

Added line #L522 was not covered by tests
findings=finding_outputs,
compliance=bulk_compliance_frameworks[compliance_name],
create_file_descriptor=True,
file_path=filename,
)
generated_outputs["compliance"].append(ens)
ens.batch_write_data_to_file()

Check warning on line 529 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L528-L529

Added lines #L528 - L529 were not covered by tests
else:
filename = (
f"{output_options.output_directory}/compliance/"
Expand Down Expand Up @@ -555,6 +571,20 @@
)
generated_outputs["compliance"].append(mitre_attack)
mitre_attack.batch_write_data_to_file()
elif compliance_name.startswith("ens_"):

Check warning on line 574 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L574

Added line #L574 was not covered by tests
# Generate ENS Finding Object
filename = (

Check warning on line 576 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L576

Added line #L576 was not covered by tests
f"{output_options.output_directory}/compliance/"
f"{output_options.output_filename}_{compliance_name}.csv"
)
ens = GCPENS(

Check warning on line 580 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L580

Added line #L580 was not covered by tests
findings=finding_outputs,
compliance=bulk_compliance_frameworks[compliance_name],
create_file_descriptor=True,
file_path=filename,
)
generated_outputs["compliance"].append(ens)
ens.batch_write_data_to_file()

Check warning on line 587 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L586-L587

Added lines #L586 - L587 were not covered by tests
else:
filename = (
f"{output_options.output_directory}/compliance/"
Expand Down
Loading
Loading