Finds and removes SHA-1 signed certificates from the Aruba ClearPass certificate trust list. Runs as either a web UI (default) or a CLI tool, both packaged as a Docker container.
SHA-1 is cryptographically broken and rejected by modern browsers and OS trust stores. This tool automates the cleanup process via the ClearPass REST API.
- Docker and Docker Compose installed
- A ClearPass API token or OAuth2 client credentials (see Authentication)
git clone https://github.com/your-org/cppm-sha1-cert-eliminator.git
cd cppm-sha1-cert-eliminatorCopy the example environment file and fill in your ClearPass details:
cp .env.example .envOpen .env in your editor and set the required values:
# Full URL to the ClearPass API — must include /api
CLEARPASS_SERVER=https://clearpass.example.com/api
# Authentication — use an API token OR client credentials (not both)
CLEARPASS_API_TOKEN=your-token-here
# CLEARPASS_CLIENT_ID=your-client-id
# CLEARPASS_CLIENT_SECRET=your-client-secret
# Set to false only if your ClearPass uses a self-signed certificate
CLEARPASS_VERIFY_SSL=trueSee Authentication for how to obtain credentials.
docker compose buildThis installs all Python dependencies into the image. Only needed once (or after pulling updates).
docker compose upDocker Compose reads your .env file automatically. Once the container starts, open http://localhost:8080 in your browser. If credentials were set in .env, the app connects to ClearPass automatically on startup.
To run in the background:
docker compose up -d
docker compose logs -f # tail logs
docker compose down # stop and remove the containerBy default, the web UI runs on port 8080. To use a different port, edit the docker-compose.yml file:
services:
sha1-cert-eliminator:
ports:
- "9000:8080" # Change the first number to your desired port (e.g., 9000:8080)In this example, the web UI will be accessible at http://localhost:9000.
- First number (before the colon): the port on your machine that you access in your browser
- Second number (after the colon): the internal container port — leave this as 8080
Then run:
docker compose upThe web UI will now be available at the new port.
The CLI runs as a one-shot container and exits when done. Your .env credentials are passed through automatically.
# Dry run — list SHA-1 certs without deleting anything
docker compose run --rm sha1-cert-eliminator python sha1_cert_eliminator.py --dry-run
# Interactive — lists found certs, prompts you to select which to delete
docker compose run --rm sha1-cert-eliminator python sha1_cert_eliminator.py
# Delete all SHA-1 certs without prompting
docker compose run --rm sha1-cert-eliminator python sha1_cert_eliminator.py --auto-remove
# Output results as JSON (useful for scripting or auditing)
docker compose run --rm sha1-cert-eliminator python sha1_cert_eliminator.py --jsonYou can also pass credentials directly as flags instead of using .env:
docker compose run --rm sha1-cert-eliminator python sha1_cert_eliminator.py \
--server https://clearpass.example.com/api \
--api-token your-token-here \
--dry-runTwo methods are supported. Choose one based on what your ClearPass deployment provides.
| Method | Environment Variables | CLI Flags |
|---|---|---|
| API Token | CLEARPASS_API_TOKEN |
--api-token |
| OAuth2 Client Credentials | CLEARPASS_CLIENT_ID + CLEARPASS_CLIENT_SECRET |
--client-id + --client-secret |
The server URL must include the /api path suffix, e.g. https://clearpass.example.com/api.
An API token is the simpler option and is recommended for one-off or admin use.
- Log in to the ClearPass Policy Manager web UI as an administrator.
- From the Dashboard, navigate to ClearPass Guest.
- In the ClearPass Guest Administration UI, go to Administration → API Services → API Clients.
- Click Create API Client.
- Set Operator Profile to a profile with at minimum read access to the certificate trust list (e.g. the built-in
Super Administratoror a custom profile withPlatform → Certificatesread/write permissions). - Under Grant Type, select Client Credentials and click Create API Client.
- On the next screen, copy the Access Token that is displayed. This value is your
CLEARPASS_API_TOKEN. It does not expire by default but can be revoked from the same page.
Note: The Access Token shown on the creation screen is only displayed once. Copy it before navigating away.
Client credentials are preferred for automated or long-running use because they allow ClearPass to issue fresh tokens without manual intervention.
- Log in to the ClearPass Policy Manager web UI as an administrator.
- From the Dashboard, navigate to ClearPass Guest.
- In the ClearPass Guest Administration UI, go to Administration → API Services → API Clients.
- Click Create API Client.
- Give the client a descriptive name (e.g.
sha1-cert-eliminator). - Set Operator Profile to a profile with
Platform → Certificatesread/write permissions. - Under Grant Type, select Client Credentials.
- Click Create API Client.
- Copy the Client ID and Client Secret displayed on the confirmation screen. These are your
CLEARPASS_CLIENT_IDandCLEARPASS_CLIENT_SECRET.
Note: The Client Secret is only shown once at creation time. If lost, you must create a new API client.
Whichever method you use, the associated operator profile needs:
| Permission | Level Required |
|---|---|
| Platform → Certificates | Read (to scan) + Write (to delete) |
If you only intend to audit (dry-run or --json), read-only access is sufficient.
| Variable | Default | Description |
|---|---|---|
CLEARPASS_SERVER |
— | ClearPass server URL (required) |
CLEARPASS_API_TOKEN |
— | API token for authentication |
CLEARPASS_CLIENT_ID |
— | OAuth2 client ID |
CLEARPASS_CLIENT_SECRET |
— | OAuth2 client secret |
CLEARPASS_VERIFY_SSL |
true |
Set to false to skip SSL verification |
The web UI starts automatically with docker compose up and is accessible at http://localhost:8080.
Workflow:
- Connect — Enter your ClearPass server URL and credentials. The app validates the connection immediately and pre-populates fields from environment variables if set.
- Scan — Click "Scan for SHA-1 Certificates" to fetch the full trust list and identify SHA-1 signed entries.
- Review — Certificates are shown in a table with subject, issuer, expiry, usage, and how they were detected. Click any row to see full certificate details.
- Delete — Select one or more certificates and click "Delete Selected". A confirmation modal lists what will be removed before any action is taken.
If full credentials are present in environment variables at startup, the app auto-connects without requiring the connection form.
python sha1_cert_eliminator.py [OPTIONS]
| Flag | Description |
|---|---|
--server URL |
ClearPass server URL |
--api-token TOKEN |
API token |
--client-id ID |
OAuth2 client ID |
--client-secret SECRET |
OAuth2 client secret |
--no-verify-ssl |
Disable SSL certificate verification |
--dry-run |
List SHA-1 certs but do not delete |
--auto-remove |
Delete all SHA-1 certs without prompting |
--json |
Print SHA-1 cert list as JSON (implies --dry-run) |
CLI flags take precedence over environment variables.
Interactive mode (no --dry-run or --auto-remove): lists found certs and prompts for selection. Enter comma-separated numbers (e.g. 1,3), all, or none/q to exit.
Each trust list entry is checked in two passes:
- Metadata fields — If the entry's
signature_algorithm,hash_algorithm, or similar fields containsha1,sha-1,sha1withrsaencryption, etc., it is flagged immediately. - Certificate parsing — If metadata fields are absent or inconclusive, the tool fetches the full certificate (PEM or DER) and parses it with the Python
cryptographylibrary to inspect the actual signature hash algorithm.
This two-pass approach handles ClearPass deployments that return incomplete metadata in the list endpoint.
pip install -r requirements.txt
# Web UI
uvicorn app.main:app --host 0.0.0.0 --port 8080
# CLI
python sha1_cert_eliminator.py --server https://cppm.example.com/api --api-token TOKEN --dry-runPython 3.12+ is recommended.
.
├── sha1_cert_eliminator.py # CLI entry point
├── app/
│ ├── clearpass.py # Shared ClearPass API logic and SHA-1 detection
│ ├── main.py # FastAPI web application
│ └── static/
│ ├── index.html # Web UI
│ └── app.js # Web UI JavaScript
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── .env.example