Metadata-Version: 2.5
Name: certifyclouds
Version: 1.4.0
Summary: Scan Azure Key Vaults for expiring secrets, certificates, and keys
Project-URL: Homepage, https://certifyclouds.com/scanner
Project-URL: Documentation, https://docs.certifyclouds.com/scanner
Author-email: CertifyClouds <hello@certifyclouds.com>
License: Apache-2.0
License-File: LICENSE
Keywords: azure,certificates,expiry,keyvault,rotation,scanner,secrets,security
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.11
Requires-Dist: azure-core>=1.38.0
Requires-Dist: azure-identity>=1.20
Requires-Dist: azure-keyvault-certificates>=4.9
Requires-Dist: azure-keyvault-keys>=4.10
Requires-Dist: azure-keyvault-secrets>=4.9
Requires-Dist: azure-mgmt-keyvault>=14.0.1
Requires-Dist: azure-mgmt-resource-subscriptions==1.0.0
Requires-Dist: certifi>=2026.10.18
Requires-Dist: click>=8.3.3
Requires-Dist: cryptography>=50.0.0
Requires-Dist: httpx>=0.27
Requires-Dist: idna>=3.15
Requires-Dist: pygments>=2.20.0
Requires-Dist: pyjwt>=2.15.1
Requires-Dist: requests>=2.33.0
Requires-Dist: rich>=15.0
Requires-Dist: tenacity>=9.0
Requires-Dist: urllib3>=2.8.0
Provides-Extra: dev
Requires-Dist: pytest-mock>=3.10; extra == 'dev'
Requires-Dist: pytest>=9.0.3; extra == 'dev'
Description-Content-Type: text/markdown

# certifyclouds

**Do you know which Azure secrets expire this month?**

Scan every Azure Key Vault in every subscription with one command. Free, open source, works in Azure Cloud Shell.

```
pip install certifyclouds                              # or: pipx install certifyclouds
cc-scan                                                # or: brew tap certifyclouds/certifyclouds && brew install certifyclouds
```

## What you get

- Cross-subscription inventory of every secret, certificate, and key
- Expiry warnings: expired, <7 days, <30 days, <90 days (colour-coded)
- Security findings: public access, soft delete, RBAC, missing expiry dates
- A 0-100 score using the CertifyClouds compliance rules
- Export to JSON, CSV, or standalone HTML report
- Works in Azure Cloud Shell with zero setup

## Quick Start

```bash
# 1. Install (pick one)
pip install certifyclouds              # pip
pipx install certifyclouds             # pipx (isolated install)
brew tap certifyclouds/certifyclouds   # Homebrew (macOS/Linux)
brew install certifyclouds

# 2. Authenticate (skip in Azure Cloud Shell)
az login

# 3. Scan
cc-scan
```

On first run, you'll be prompted to register with your email (free). Your API key is saved locally to `~/.certifyclouds/config.json`.

## Output

The default table shows a subscription and vault inventory, a summary, a 0-100 score, expiry warnings and security findings. If some vaults or item types could not be read, it also shows the gaps and marks the score as partial. If nothing could be scored, it says so instead of giving a score.

## Usage

```bash
# Output formats
cc-scan --format table           # Default: pretty terminal output
cc-scan --format json            # Full JSON (pipe-friendly)
cc-scan --format csv             # Flat CSV (for spreadsheets)
cc-scan --format html            # Standalone HTML report

# Write to file
cc-scan --output report.html --format html
cc-scan --output scan.json --format json

# Filters
cc-scan --expiring 30            # Only items expiring within 30 days
cc-scan --expired                # Only already-expired items
cc-scan --type secrets           # Only secrets (or: certificates, keys)
cc-scan --vault vault-prod       # Specific vault(s) (repeatable)
cc-scan --subscription sub-123   # Specific subscription(s) (repeatable)

# Security summary only
cc-scan --security               # Show findings without per-item details

# CI gate
cc-scan --fail-on critical       # Exit 1 only on critical findings (default: high)

# Azure auth
cc-scan --auth cli               # Azure CLI credential (default)
cc-scan --auth default           # DefaultAzureCredential (managed identity/SP)

# Tuning
cc-scan --workers 10             # Parallel workers (default: 5, max: 20)
cc-scan --timeout 600            # Scan timeout in seconds (default: 300)

# Other
cc-scan --offline                # Skip licence server validation
cc-scan --register               # Re-register / change email
cc-scan --key cc-scan-xxxxx      # Use a specific API key
cc-scan --version                # Show version
cc-scan --help                   # Show all options
```

## Environment Variables

All flags can be set via environment variables (flags take priority):

```bash
CC_SCAN_KEY=cc-scan-xxxxx        # API key
CC_SCAN_AUTH=cli                 # Auth method
CC_SCAN_FORMAT=json              # Output format
CC_SCAN_WORKERS=10               # Workers
CC_SCAN_TIMEOUT=600              # Timeout
CC_SCAN_OFFLINE=true             # Offline mode
CC_SCAN_FAIL_ON=critical         # Fail-on severity
```

For service principal auth (used with `--auth default`):

```bash
AZURE_CLIENT_ID=...
AZURE_CLIENT_SECRET=...
AZURE_TENANT_ID=...
```

In GitHub Actions, use OIDC with `azure/login`, then run `cc-scan --auth cli` (the default). Set `CC_SCAN_KEY` as a pipeline secret. See [CI/CD integration](https://docs.certifyclouds.com/getting-started/cicd/) for the full workflow and other CI providers.

## Exit Codes

When several apply, the first one in this table wins:

| Code | Meaning |
|------|---------|
| 2 | The scan could not run or read nothing: sign-in or SDK error, no subscription visible, every subscription's Key Vault list failed, timeout, or Ctrl-C |
| 3 | No API key and no terminal to register in, or registration failed |
| 1 | A finding at or above `--fail-on` (default: high) |
| 4 | The scan finished, but some subscriptions, vaults or item types could not be read, or a `--subscription` or `--vault` was not found |
| 0 | None of the above |

Non-zero exit codes make this CI/cron-friendly: `cc-scan || notify-team`.

## Azure Permissions

The scanner is read-only. It lists secrets, certificates and keys and reads certificate details. It never reads a secret value or key material.

| Role | Scope | Why |
|------|-------|-----|
| Reader | Each subscription | Find the Key Vaults and read their settings |
| Key Vault Reader | Each vault that uses Azure RBAC | List secret, certificate and key properties and read certificate details |

Vaults that use access policies need List on secrets, certificates and keys, plus Get on certificates. Key Vault Secrets User is not needed: it can read secret values and cannot list certificates or keys.

Assign roles in Azure Portal: Key Vault > Access control (IAM) > Add role assignment.

If a vault has firewall restrictions, you'll see an inline error (the scan continues to the next vault).

## Security Findings

The scanner runs 14 security checks:

| ID | Severity | What it checks |
|----|----------|---------------|
| SEC-001 | CRITICAL | Expired secret still enabled |
| SEC-002 | CRITICAL | Expired certificate still enabled |
| SEC-003 | HIGH | Public network access enabled on vault |
| SEC-004 | HIGH | Soft delete disabled |
| SEC-005 | HIGH | Purge protection disabled |
| SEC-006 | MEDIUM | Secret has no expiry date set |
| SEC-007 | MEDIUM | Certificate has no expiry date set |
| SEC-008 | MEDIUM | RBAC authorization not enabled |
| SEC-009 | LOW | Standard SKU (no HSM backing) |
| SEC-010 | INFO | Secret expiring within 30 days |
| SEC-011 | INFO | Certificate expiring within 30 days |
| SEC-012 | CRITICAL | Expired key still enabled |
| SEC-013 | MEDIUM | Key has no expiry date set |
| SEC-014 | INFO | Key expiring within 30 days |

## Privacy & Telemetry

CertifyClouds Scanner sends **aggregate usage statistics** to improve the product. Here's exactly what is sent:

**Sent:** API key, CLI version, counts (subscriptions, vaults, secrets, certificates, keys, expired, expiring soon, vaults with errors), scan duration. Security findings and the score are never sent.

**Never sent:** Vault names or URIs, secret/certificate/key names, secret values, subscription IDs or names, Azure tenant IDs, resource group names, tags, certificate subjects or thumbprints.

Use `--offline` to skip licence server validation calls (key telemetry and version checks). Azure SDK calls are unaffected: the scanner still requires Azure connectivity to read Key Vault data. `--offline` still needs an API key; without one the scanner asks you to register.

## Troubleshooting

**"No Azure credentials found"**
Run `az login` to authenticate, or set `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID` and use `--auth default` for service principal auth.

**Vault shows "Firewall restriction"**
Run cc-scan from an allowed network or add your IP in Azure Portal (Key Vault > Networking).

**Vault shows "Access denied"**
Your identity needs the roles listed in [Azure Permissions](#azure-permissions).

**"Could not reach license.certifyclouds.com"**
Check internet connection. Behind a proxy? Set `HTTPS_PROXY`. Or use `--offline` mode.

**Slow scans**
Increase workers: `cc-scan --workers 10`. Each subscription is scanned in parallel.

## Requirements

- Python 3.11+
- Azure CLI (`az login`) or service principal credentials
- Network access to Azure management and Key Vault data plane APIs

## Licence

Apache 2.0. See [LICENSE](LICENSE).

## Links

- [CertifyClouds](https://certifyclouds.com) - Automate secret rotation & compliance
- [Documentation](https://docs.certifyclouds.com/scanner)
