Full application including FastAPI backend, PostgreSQL data model, background scan worker, multi-tenant support, certificate authentication, SharePoint REST scanner with hierarchical deduplication, SharingLinks classification and post-scan resolve, Excel export, site filter in job details, role name normalisation, and updated documentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3.2 KiB
Clearview
SharePoint permission deviation scanner for multiple customer tenants.
Clearview scans SharePoint sites down to folder and file level and reports only permissions that deviate from the root permissions of each site. Designed to manage and monitor multiple customer tenants from a single instance.
How it works
- Add a customer tenant (name, Azure tenant ID, client ID)
- Generate a certificate — upload the public
.certo the Azure app registration - Submit site URLs manually or via a Microsoft Sites CSV export
- Clearview scans asynchronously and reports permission deviations
Only permissions that are added relative to the site root are reported (delta_type=added). No NTFS or filesystem permissions are used.
Deviations are deduplicated hierarchically: if a principal already has a deviation at a library or folder level, individual files below that level are suppressed.
Job Details
After a scan completes, the Selected Job Details panel provides:
- Site filter — narrow targets and deviations to a single site
- Export Excel — download a
.xlsxfile with Targets and Deviations sheets, sorted by Site URL → Object URL → Principal - Resolve Sharing Links — fetch the actual recipients of sharing links post-scan (Anonymous and Flexible types resolved by default)
SharingLinks colour coding
| Type | Risk | Colour |
|---|---|---|
Anonymous* |
Critical | Red |
Flexible |
High | Orange |
Organization* |
Low | Blue |
Direct* |
Low | Green |
Deployment
Prerequisites
- Docker + Docker Compose (or Portainer)
Stack
Copy stack/.env and stack/docker-compose.yml to your deployment location and adjust .env as needed. The .env file is self-documented.
Start the stack:
docker compose -f stack/docker-compose.yml up -d
Clearview is available at http://<host>:<CLEARVIEW_PORT>.
Adminer (database inspector) is available at http://<host>:<ADMINER_PORT>.
Azure app setup (per tenant)
Each customer tenant requires a dedicated Azure app registration with SharePoint access.
- Azure Portal → Entra ID → App registrations → New registration
- Name: e.g.
Clearview Scan App - Supported account types: Single tenant
- Name: e.g.
- Copy the Directory (tenant) ID and Application (client) ID
- API permissions → Add → SharePoint → Application permissions →
Sites.FullControl.All→ Grant admin consent - Add the tenant in Clearview (name, tenant ID, client ID)
- Click Certificate → download the
.cerfile - Upload the
.cerin Azure Portal → App registration → Certificates & secrets → Certificates
Build
./build-and-push.sh t # test build (:dev tag)
./build-and-push.sh 1 # patch release
./build-and-push.sh 2 # minor release
./build-and-push.sh 3 # major release
Data model
| Table | Description |
|---|---|
tenant_profiles |
Customer tenant credentials and certificates |
scan_jobs |
Scan jobs with status and progress tracking |
scan_targets |
Individual sites within a job |
permission_deviations |
Detected permission deviations per target, including resolved sharing link members |
See docs/TECHNICAL.md for full architecture documentation.