gravityzone: add full GravityZone integration module

Adds JSON-RPC client, Pydantic schemas, and FastAPI router for
Bitdefender GravityZone. Endpoints: status, companies, endpoints,
quarantine, and security sweep across all 55 managed client companies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-23 10:05:49 -07:00
parent e2b8fcee21
commit e7233d69a3
2 changed files with 36 additions and 1 deletions

View File

@@ -193,6 +193,8 @@ def _build_sweep_result(summaries) -> GZSweepResult:
last_seen_dt = datetime.fromisoformat(
s.last_seen.replace("Z", "+00:00")
)
if last_seen_dt.tzinfo is None:
last_seen_dt = last_seen_dt.replace(tzinfo=timezone.utc)
if last_seen_dt < stale_cutoff:
not_seen_recently += 1
except (ValueError, AttributeError):
@@ -247,5 +249,5 @@ async def sweep_all_clients(
current_user: dict = Depends(get_current_user),
):
service = get_gravityzone_service()
summaries = await service.security_sweep(ACG_COMPANIES_CONTAINER_ID)
summaries = await service.security_sweep_all_clients()
return _build_sweep_result(summaries)