# Scope: --skip and --only

Keep a scan away from hosts you must not touch, or inside the list you are
authorised to test.

```sh
# Leave the help desk and a partner's range alone
spiderfootplus scan example.com --skip helpdesk.example.com,203.0.113.0/24

# Stay within an agreed list (a file, one entry per line)
spiderfootplus scan example.com --only scope.txt
```

## Entries

| Entry | Matches |
| --- | --- |
| `hub.example.com` | that host and every name under it (`a.hub.example.com`) |
| `*.hub.example.com` | only the names under it, not `hub.example.com` itself |
| `203.0.113.7` | that address |
| `203.0.113.0/24` | every address in the range (IPv6 ranges work too) |

Give several entries comma separated, repeat the flag, or name a file: one
entry per line, `#` starts a comment.

## What happens

* Anything out of scope is dropped before a module sees it, so nothing is
  derived from it: no lookups, no probes, nothing stored.
* Address entries are also checked after a name is resolved: a host whose
  addresses are all out of scope is not contacted by the web and TLS checks.
* The scan lists what it left alone (`out of scope … not scanned`), and
  `spiderfootplus report` shows the scope and that list, in every format.
* The target is always scanned. `--skip` that covers the target is an error.

## --only

`--only` limits each kind separately: hosts are limited only if you list
hosts, addresses only if you list addresses or ranges. So
`--only www.example.com` keeps the scan to that host and the addresses it
resolves to, and `--only 198.51.100.0/24` lets any name through but only
contacts addresses in that range. Third-party names (affiliates) are not
limited by `--only`; `--skip` applies to them.

`--skip` wins over `--only`.

## Every scan

Put entries in the configuration file to apply them to every scan; flags add
to them:

```yaml
scope:
  skip: [status.example.com]
```

`watch` takes the same `--skip` and `--only`.

## Limits

* When a `proxy` is configured, web requests are not checked against address
  entries (the scan never sees the address they go to). Address entries still
  stop everything else, and host entries work as usual.
* Data sources are still asked about the target (certificate logs, archives,
  DNS); scope controls what the scan does with the answers.
