# Yerel kod tarama için CLI Seçenekleri

Aikido Security Local Scanner, Aikido Security taramalarını kendi ortamınızda gerçekleştirmenizi sağlayan ve kodunuzun tesislerinizden asla dışarı çıkmamasını garanti eden bir araçtır. Aşağıda, yerel tarayıcıyı çalıştırırken iletilebilecek seçenekleri bulabilirsiniz.

### Depo taraması

```markdown
Usage: aikido-local-scanner scan [options] <path>

Run a scan.

Arguments:
  path                                     The path you want to scan.

Options:
  --apikey <apikey>                        Apikey to send scanning results to Aikdo.  (env: AIKIDO_API_KEY)
  --repositoryname <repositoryname>        Repo name to create or send results to.
  --branchname <branchname>                Branch name that is being scanned.
  --tmpdirectory <tmpdirectory>            Temporary directory to use during scanning. (default: "./.aikidotmp")
  --debug                                  Add additional debug information to command output.
  --disable-artifact-scanning              Disable artifact scanning. Use to speed up scanning at the cost of not scanning artifacts such as .jar files.
  --secrets-scanning-full-git-history      Enable scanning the full Git history for secrets.
  --scan-types [types...]                  Specify which types of scans should be executed. This will overwrite the --scanners flag (cf below). (choices: "code", "dependencies", "iac", "secrets", default: [])
  --exclude <exclude_path>                 Specify a file or folder path that should be excluded from the scan. This option may be specified multiple times. (default: [])
  --fail-on <severity>                     Runs scanner in gating mode and fails on the given severity or higher. (choices: "low", "medium", "high", "critical")
  --gating-mode <mode>                     Indicate whether the scanner should run in release or PR gating mode. Release gating mode scans your main branch and waits to see if there are any issues that should prevent release. Pull request mode, Aikido seeks ONLY new vulnerabilities introduced in a branch (scans the diff). You must supply a base and head commit for the comparison to work. Should be combined with the --fail-on flag (choices: "release", "pr", default: "release")
  --sla-mode                               In release gating mode, only fail the gate on issues that are out of SLA.
  --base-commit-id <commit-id>             Base commit id, this is the commit that Aikido will compare against to determine if a finding is new. Only used for PR gating mode.
  --head-commit-id <commit-id>             Head commit id, the commit that is being scanned. Required for PR gating mode.
  --gating-result-output <output>          JSON file to write issues to when running in gating mode only
  --no-fail-on-timeout                     Do not fail the process in case the scan result polling times out (gating mode only)
  --max-polling-attempts <amount>          Amount of times to poll for scan results, increase this if the default value of 20 is not enough (gating mode only)
  --linked-team-name <name>                Team name to link the repository to. Specify this option multiple times to link to multiple teams. (default: [])
  --no-snippets                            Use this mode to not share any code snippets with Aikido.
  --checkov-skip-extension <extension>     Specify an extension to be skipped by Checkov scans specifically. This option may be specified multiple times. Example: If you want to ignore JSON files, pass .json as the value for this option. (default: [])
  --no-lockfiles-cache                     Do not allow caching of dependency- and lockfiles to enable automated rescans
  --scan-timeout <timeout>                 Timeout in milliseconds for each scan (defaults to 900000ms).
  --force-create-repository-for-branch     Create a new repository in Aikido per branch.
  --enable-proxy                           Uses HTTPS_PROXY environment variable to proxy requests.
  --ca-bundle <path>                       Path to a PEM file containing custom root CA(s) to trust when using --enable-proxy. (env: AIKIDO_CA_BUNDLE)
  --disable-telemetry                      Disable all error reporting (telemetry) to Aikido. (env: AIKIDO_DISABLE_TELEMETRY)
  --include-dev-deps                       Enable scanning of development dependencies (e.g., devDependencies in package.json, etc.)
  -h, --help                               display help for command
```

İmaj taraması CLI seçenekleri için [buraya](https://help.aikidogov.us/docs/docs-tr/container-image-scanning/local-image-scanning/cli-options-for-local-image-scanning.md) bakın.

## Yaygın kullanım senaryoları

Aşağıda yaygın kullanım senaryolarına ait bazı örnek yapılandırmaları bulabilirsiniz.

**Bir depo üzerinde tarama çalıştırmak istiyorum**

> API anahtarı ayrıca *AIKIDO_API_KEY* ortam değişkeni olarak da iletilebilir

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main
```

**Depomda yalnızca SCA taraması çalıştırmak istiyorum**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types dependencies
```

**Depomda yalnızca gizli bilgi (secrets) taraması çalıştırmak istiyorum**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types secrets
```

**Depomda yalnızca kod taraması çalıştırmak istiyorum**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types code
```

**Depomda yalnızca IaC taraması çalıştırmak istiyorum**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types iac
```

**/staging ve /development klasörlerimi taramanın dışında tutmak istiyorum**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--exclude staging 
--exclude development
```

**Yalnızca gizli bilgi (secrets) ve kod taraması çalıştırmak ve /staging klasörümü taramanın dışında tutmak istiyorum.**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types secrets code
--exclude staging
```
