# Features — vulnerability_scan

Evidence date: 2026-09-29. Revision: `main` `de29c65` (2025-04-02).

No feature list exists in the source repository. Status below is from `readme.md`, `cli_app/cli.py`, `green_bone_docker/`, and git history.

Planned features: **none are written down**. Commented blocks are inactive code, not a backlog.

## Current features

| Feature | Status | Where |
|---|---|---|
| Python CLI scan runner | Current | `cli_app/cli.py` |
| Colon-separated target list | Current | `cli.py` argv handling; README examples |
| Interactive port list, scan config, and scanner menus | Current | `get_options`, `simple-term-menu` |
| `--defaults` (All IANA assigned TCP, Full and fast, OpenVAS Default) | Current | `cli.py`; `readme.md` |
| Explicit `--portlist`, `--config`, `--scanner` | Current | getopt; README. Underscores become spaces |
| Reuse target and task when the name matches | Current | `get_targets` / `get_tasks` |
| Create target with alive test `ICMP, TCP-ACK Service & ARP Ping` | Current | `gmp.create_target`. Not named in the README |
| Start a task, or attach when status is `Running` | Current | task loop in `cli.py` |
| `--skipscan` / `-k` to load `last_report` | Current in `--help` and getopt. Absent from the README options list | `cli.py` getopt and help text |
| Progress bar while `in_use` is `1`, 20 second poll, 10 error retries | Current | `progres` in `cli.py` |
| XML report download and HTML report grouped by threat | Current | report section of `cli.py` |
| Microsoft 365 email of that HTML | Current when `--mail` is set | `send_ms_email` |
| Supabase insert into `scan_que` | Present in code when `--supabase` is set. The client construction overwrites the URL with the key. Treat as **implemented and unverified** |
| Unix-socket GMP session, preferring `/tmp/gvm/gvmd/gvmd.sock` when that file exists, otherwise `/run/gvmd/gvmd.sock` | Current | `cli.py` connection block |
| Host venv install | Current | `cli_app/install_requirements.sh` |
| CLI container image | Current | `cli_app/Dockerfile`, `entrypoint.sh`, compose service `cli-app`, `cli_app.sh` |
| Greenbone Community Edition compose stack | Current | `green_bone_docker/docker-compose.yml` |
| GSA on `127.0.0.1:9392` | Current | compose service `gsa` |
| Start, stop, log follow, install/pull | Current | `start.sh`, `stop.sh`, `streamlogs.sh`, `install_greenbone.sh` |
| Host `gvm-cli` version probe | Current, not mentioned in the README | `green_bone_docker/getGvmCLI.sh` |
| Shell inside the `gvm-tools` container | Current | `getGvmDockerCLI.sh`; README links gvm-tools docs |
| SonarQube analysis on `main` | Current | `bitbucket-pipelines.yml`, `sonar-project.properties` |
| Sample report file | Committed, not loaded by the CLI | `cli_app/test.json` |
| Office 365 setup screenshots | Committed illustrations of an external article | `documentation/*.png` |

## CLI options (as implemented)

| Flag | Long | Effect |
|---|---|---|
| (positional) | target | Required. Colon-separated names |
| `-h` | `--help` | Print usage and exit |
| `-d` | `--defaults` | Port list, config, and scanner names listed above |
| `-k` | `--skipscan` | Use the last report when the task is not running |
| `-z` | `--supabase` | Insert HTML into `scan_que` |
| `-p` | `--portlist` | Port list name for a **new** target |
| `-c` | `--config` | Scan config name for a **new** task |
| `-s` | `--scanner` | Scanner name for a **new** task |
| `-m` | `--mail` | Colon-separated recipients |

`--help` also mentions these flags. The README options list omits `--skipscan`.

## Completed, in the sense of landed on `main`

These are historical increments. They are the current behaviour, not a separate release train.

| When | Commit | Change |
|---|---|---|
| 2025-02-28 | `f1599e4` | First CLI, compose file, shell wrappers |
| 2025-03-05 | `b31ac12` | HTML report and the first email function |
| 2025-03-06 | `29a49d7` | Mail fixes |
| 2025-03-07 | `afadd84` | Microsoft 365 sending, screenshots, `test.json`, gitignore for `o365_token.txt` |
| 2025-03-12 | `d4f89d2` | TLS and SSH connection helper; README socket note |
| 2025-03-14 | `092cdc4` | Split a single argv string into options |
| 2025-03-14 | `5515fcb` | Multiple targets |
| 2025-03-16 | `06d81ec` | Message when the report has zero hosts |
| 2025-03-18 | `a2f4f0c` | Report grouping and sorting changes inside `cli.py` |
| 2025-03-25 | `f5d71af` | CLI Docker image and `cli_app.sh` |
| 2025-04-01 | `d32a02c` | Socket path and `/tmp/gvm` permissions |
| 2025-04-02 | `de29c65` | `cli-app` waits on `gvmd` and `scap-data` with `service_completed_successfully` |

## In development

No branch other than `main` exists. No TODO or FIXME markers were found in `cli.py`. There is no open work description in the README.

## Planned

None documented.

## Inactive code (still in the file, not on the running path)

| Item | Evidence | Notes |
|---|---|---|
| SMTP `send_email` | Commented function in `cli.py` | README still shows `mail_host`, `mail_port`, `mail_user`, `mail_pass`, `mail_from` |
| Environment load of those SMTP keys | Commented block at the top of `cli.py` | Replaced by Microsoft 365 in `afadd84` |
| Write `scan_results.html` | Commented `open` / `write` / `close` | Report is emailed or inserted, not written by the active path |
| SSH GMP connection | Commented call under the socket setup | `create_connection` still contains an SSH branch |
| TLS GMP connection | `TLSConnection` branch inside `create_connection` | Nothing passes `connection_type` containing `tls` |

`d4f89d2` added the TLS and SSH helper. Later commits left the socket as the only call. Whether SSH or TLS should be selectable without editing source is **Unknown / Requires Confirmation**.

## Removed

No feature is recorded as deleted from the product. The SMTP path was commented out rather than deleted.

## Not features of this repository

| Item | Why it is listed |
|---|---|
| `sonarqube_scan.bat` | Named by the onboarding scan. Not in git history |
| `cli-app.py` | Named by `readme.md`. The script is `cli_app/cli.py` |
| Cron | Mentioned in the README as a reason to put credentials in `.env`. No cron definition is in the repo |
| Supabase reader / queue worker | Only an insert into `scan_que` exists here |
| Unit or integration tests | `test.json` is a saved report. `cli.py` does not open it |

## Docker-facing behaviour that affects operators

| Script | What it actually does |
|---|---|
| `install_greenbone.sh` | `mkdir -p /tmp/gvm/gvmd`, `chmod -R 777 /tmp/gvm`, `docker compose build`, `docker compose pull` |
| `start.sh` | Same directory and mode, then `docker compose up -d` |
| `stop.sh` | `docker compose down` |
| `restart.sh` | `docker compose up -d` only. The name says restart. The script does not stop or recreate containers |
| `streamlogs.sh` | `docker compose logs -f` |
| `getGvmCLI.sh` | `gvm-cli socket --socketpath /tmp/gvm/gvmd/gvmd.sock --pretty --xml "<get_version/>"` on the host |
| `getGvmDockerCLI.sh` | `docker compose exec gvm-tools /bin/bash` |
| `cli_app.sh` | `docker run --rm -it` of `greenbone-community-edition-cli-app` with the host socket directory mounted at `/run/gvmd` |

The compose service `cli-app` is a second way to define that image. Its `depends_on` requires `gvmd` to complete successfully. `gvmd` is started with `restart: on-failure` and is not a one-shot task. Whether `docker compose up` ever starts `cli-app` is **Unknown / Requires Confirmation**. The README tells operators to use `cli_app.sh`, which does not go through that `depends_on`.
