From f28754b88327502a49c8d9b302931e8a99fc75ac Mon Sep 17 00:00:00 2001 From: Andoni Alonso <14891798+andoniaf@users.noreply.github.com> Date: Mon, 29 Sep 2025 15:41:25 +0200 Subject: [PATCH] docs(iac): refactor getting started and auth (#8779) --- docs/tutorials/iac/getting-started-iac.md | 41 ++++++++++------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/docs/tutorials/iac/getting-started-iac.md b/docs/tutorials/iac/getting-started-iac.md index 4dac4eea56..1e4d3db189 100644 --- a/docs/tutorials/iac/getting-started-iac.md +++ b/docs/tutorials/iac/getting-started-iac.md @@ -1,10 +1,10 @@ # Getting Started with the IaC Provider -Prowler's Infrastructure as Code (IaC) provider enables you to scan local or remote infrastructure code for security and compliance issues using [Trivy](https://trivy.dev/). This provider supports a wide range of IaC frameworks, allowing you to assess your code before deployment. +Prowler's Infrastructure as Code (IaC) provider enables scanning of local or remote infrastructure code for security and compliance issues using [Trivy](https://trivy.dev/). This provider supports a wide range of IaC frameworks, allowing assessment of code before deployment. ## Supported Scanners -The IaC provider leverages Trivy to support multiple scanners, including: +The IaC provider leverages [Trivy](https://trivy.dev/latest/docs/scanner/vulnerability/) to support multiple scanners, including: - Vulnerability - Misconfiguration @@ -13,31 +13,34 @@ The IaC provider leverages Trivy to support multiple scanners, including: ## How It Works -- The IaC provider scans your local directory (or a specified path) for supported IaC files, or scan a remote repository. +- The IaC provider scans local directories (or specified paths) for supported IaC files, or scans remote repositories. - No cloud credentials or authentication are required for local scans. - For remote repository scans, authentication can be provided via [git URL](https://git-scm.com/docs/git-clone#_git_urls), CLI flags or environment variables. + - Check the [IaC Authentication](./authentication.md) page for more details. - Mutelist logic is handled by Trivy, not Prowler. - Results are output in the same formats as other Prowler providers (CSV, JSON, HTML, etc.). -## Usage +## Prowler CLI -To run Prowler with the IaC provider, use the `iac` argument. You can specify the directory or repository to scan, frameworks to include, and paths to exclude. +### Usage -### Scan a Local Directory (default) +Use the `iac` argument to run Prowler with the IaC provider. Specify the directory or repository to scan, frameworks to include, and paths to exclude. + +#### Scan a Local Directory (default) ```sh prowler iac --scan-path ./my-iac-directory ``` -### Scan a Remote GitHub Repository +#### Scan a Remote GitHub Repository ```sh prowler iac --scan-repository-url https://github.com/user/repo.git ``` -#### Authentication for Remote Private Repositories +##### Authentication for Remote Private Repositories -You can provide authentication for private repositories using one of the following methods: +Authentication for private repositories can be provided using one of the following methods: - **GitHub Username and Personal Access Token (PAT):** ```sh @@ -52,12 +55,12 @@ You can provide authentication for private repositories using one of the followi - If not provided via CLI, the following environment variables will be used (in order of precedence): - `GITHUB_OAUTH_APP_TOKEN` - `GITHUB_USERNAME` and `GITHUB_PERSONAL_ACCESS_TOKEN` -- If neither CLI flags nor environment variables are set, the scan will attempt to clone without authentication or using the provided in the [git URL](https://git-scm.com/docs/git-clone#_git_urls). +- If neither CLI flags nor environment variables are set, the scan will attempt to clone without authentication or using the credentials provided in the [git URL](https://git-scm.com/docs/git-clone#_git_urls). -#### Mutually Exclusive Flags +##### Mutually Exclusive Flags - `--scan-path` and `--scan-repository-url` are mutually exclusive. Only one can be specified at a time. -### Specify Scanners +#### Specify Scanners Scan only vulnerability and misconfiguration scanners: @@ -65,24 +68,16 @@ Scan only vulnerability and misconfiguration scanners: prowler iac --scan-path ./my-iac-directory --scanners vuln misconfig ``` -### Exclude Paths +#### Exclude Paths ```sh prowler iac --scan-path ./my-iac-directory --exclude-path ./my-iac-directory/test,./my-iac-directory/examples ``` -## Output +### Output -You can use the standard Prowler output options, for example: +Use the standard Prowler output options, for example: ```sh prowler iac --scan-path ./iac --output-formats csv json html ``` - -## Notes - -- The IaC provider does not require cloud authentication for local scans. -- For remote repository scans, authentication is optional but required for private repos. -- CLI flags override environment variables for authentication. -- It is ideal for CI/CD pipelines and local development environments. -- For more details on supported scanners, see the [Trivy documentation](https://trivy.dev/latest/docs/scanner/vulnerability/).