fix: Release fixes (#1543)

This commit is contained in:
Pepe Fagoaga
2022-12-15 15:16:29 +01:00
committed by GitHub
parent b67e718412
commit 2da27d59b6
9 changed files with 68 additions and 12 deletions

View File

@@ -144,6 +144,15 @@ prowler aws --profile custom-profile -f us-east-1 eu-south-2
```
> By default, `prowler` will scan all AWS regions.
## Azure
With Azure you need to specify which auth method is going to be used:
```console
prowler azure [--sp-env-auth, --az-cli-auth, --browser-auth, --managed-identity-auth]
```
> By default, `prowler` will scan all Azure subscriptions.
# 🎉 New Features
- Multi-cloud support!
@@ -152,7 +161,7 @@ prowler aws --profile custom-profile -f us-east-1 eu-south-2
The full documentation can be found here:
[https://prowler-cloud.github.io/prowler/](https://prowler-cloud.github.io/prowler/)
[https://docs.prowler.cloud](https://docs.prowler.cloud)
# 📃 License
Prowler is licensed as Apache License 2.0 as specified in each file. You may obtain a copy of the License at

7
docs/faq.md Normal file
View File

@@ -0,0 +1,7 @@
# FAQ
- <strong>I am getting `OSError` related with `Too many open files`, what can I do?</strong>
In case of a bad connection, high API response times can be given, so they will generate problems because of having several simultaneous connections, to solve this problem in your system, use the command ulimit to increase the simultaneous open files:
```
ulimit -n 1000
```

View File

@@ -14,4 +14,4 @@ prowler <provider> -i
- Also, it creates by default a CSV and JSON to see detailed information about the resources extracted.
![Quick Inventory Example](/img/quick-inventory.png)
![Quick Inventory Example](../img/quick-inventory.png)

View File

@@ -44,6 +44,7 @@ nav:
- Authentication: tutorials/azure/authentication.md
- Subscriptions: tutorials/azure/subscriptions.md
- Contact Us: contact.md
- FAQ: faq.md
- About: about.md
# Customization
extra:

View File

@@ -42,7 +42,7 @@ from prowler.providers.common.outputs import set_provider_output_options
def prowler():
# Parse Arguments
parser = ProwlerArgumentParser()
args = parser.parser.parse_args()
args = parser.parse()
# Save Arguments
provider = args.provider

View File

@@ -9,7 +9,7 @@ from prowler.lib.utils.utils import open_file, parse_json_file
timestamp = datetime.today()
timestamp_utc = datetime.now(timezone.utc).replace(tzinfo=timezone.utc)
prowler_version = "3.0-beta-21Nov2022"
prowler_version = "3.0.0"
html_logo_url = "https://github.com/prowler-cloud/prowler/"
html_logo_img = (
"https://github.com/prowler-cloud/prowler/raw/master/util/html/prowler-logo-new.png"
@@ -32,7 +32,7 @@ csv_file_suffix = ".csv"
json_file_suffix = ".json"
json_asff_file_suffix = ".asff.json"
html_file_suffix = ".html"
config_yaml = "prowler/config/config.yaml"
config_yaml = f"{os.path.dirname(os.path.realpath(__file__))}/config.yaml"
def change_config_var(variable, value):

View File

@@ -1,6 +1,7 @@
import argparse
from prowler.config.config import default_output_directory, prowler_version
import sys
class ProwlerArgumentParser:
@@ -9,7 +10,7 @@ class ProwlerArgumentParser:
# CLI Arguments
self.parser = argparse.ArgumentParser(
prog="prowler",
epilog="To see the different available options on a specific provider, run: prowler {provider} -h",
epilog="To see the different available options on a specific provider, run: prowler {provider} -h|--help",
)
# Default
self.parser.add_argument(
@@ -24,7 +25,8 @@ class ProwlerArgumentParser:
# Providers Parser
self.subparsers = self.parser.add_subparsers(
title="Prowler Available Cloud Providers", dest="provider"
title="Prowler Available Cloud Providers",
dest="provider",
)
self.__init_allowlist_parser__()
@@ -38,6 +40,44 @@ class ProwlerArgumentParser:
self.__init_aws_parser__()
self.__init_azure_parser__()
def parse(self) -> argparse.Namespace:
"""
parse is a wrapper to call parse_args() and do some validation
"""
# Set AWS as the default provider if no provider is supplied
if len(sys.argv) == 1:
sys.argv = self.__set_default_provider__(sys.argv)
# Help and Version flags cannot set a default provider
if (
len(sys.argv) >= 2
and (sys.argv[1] not in ("-h", "--help"))
and (sys.argv[1] not in ("-v", "--version"))
):
# Since the provider is always the second argument, we are checking if
# a flag, starting by "-", is supplied
if "-" in sys.argv[1]:
sys.argv = self.__set_default_provider__(sys.argv)
# Parse arguments
args = self.parser.parse_args()
# A provider is always required
if not args.provider:
self.parser.error(
"A provider is required to see its specific help options."
)
return args
def __set_default_provider__(self, args: list) -> list:
default_args = [args[0]]
provider = "aws"
default_args.append(provider)
default_args.extend(args[1:])
# Save the arguments with the default provider included
return default_args
def __init_allowlist_parser__(self):
# Allowlist
allowlist_parser = self.common_providers_parser.add_argument_group("Allowlist")
@@ -232,7 +272,7 @@ class ProwlerArgumentParser:
help="AWS region names to run Prowler against",
)
# AWS Organizations
aws_orgs_subparser = aws_parser.add_argument_group("Organizations")
aws_orgs_subparser = aws_parser.add_argument_group("AWS Organizations")
aws_orgs_subparser.add_argument(
"-O",
"--organizations-role",
@@ -240,7 +280,7 @@ class ProwlerArgumentParser:
help="Specify AWS Organizations management role ARN to be assumed, to get Organization metadata",
)
# AWS Security Hub
aws_security_hub_subparser = aws_parser.add_argument_group("Security Hub")
aws_security_hub_subparser = aws_parser.add_argument_group("AWS Security Hub")
aws_security_hub_subparser.add_argument(
"-S",
"--security-hub",

View File

@@ -101,7 +101,6 @@ Caller Identity ARN: {Fore.YELLOW}[{audit_info.audited_identity_arn}]{Style.RESE
input_role = arguments.get("role")
input_session_duration = arguments.get("session_duration")
input_external_id = arguments.get("external_id")
print(input_session_duration)
if input_session_duration and input_session_duration not in range(900, 43200):
raise Exception("Value for -T option must be between 900 and 43200")

View File

@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "prowler-cloud"
# https://peps.python.org/pep-0440/
version = "3.0.0-rc1"
version = "3.0.0"
authors = [{ name = "Toni de la Fuente", email = "toni@blyx.com" }]
maintainers = [
{ name = "Sergio Garcia", email = "sergio@verica.io" },
@@ -44,7 +44,7 @@ dependencies = [
[project.urls]
"Homepage" = "https://github.com/prowler-cloud/prowler"
"Documentation" = "https://github.com/prowler-cloud/prowler/blob/master/README.md"
"Documentation" = "https://docs.prowler.cloud"
"Issue tracker" = "https://github.com/prowler-cloud/prowler/issues"
"Changelog" = "https://github.com/prowler-cloud/prowler/releases"