Skip to main content

Application topology

GitGuardian application consists of several Kubernetes resources. Each nginx pod runs an nginx container serving the dashboard frontend and acting as a proxy for the backend, and a number of different containers serving all backend tasks.

KindDeployment NameUsage
FrontnginxDashboard Frontend and proxy for backend
Backendwebapp-internal-apiBackend for the Dashboard
Backendwebapp-internal-api-longBackend for the Dashboard (long requests, no timeout)
Backendwebapp-public-apiPublic API and ggshield scans
Backendwebapp-hookVCS webhooks events receiver
Backendwebapp-app-exporterPrometheus exporter for applicative metrics. Only deployed when application metrics are enabled
Backendml-secret-engineMachine Learning secret engine
Backendapache-tikaFile scanner for non-VCS sources scanning
SchedulerbeatCelery Beat task scheduler. Must run as a single replica.
Workerworker-*Celery workers processing background tasks. See Workers and queues.
Jobinapp-analyticsComputes metrics and aggregates data for Advanced Analytics dashboards.
Jobpre-deployPre-deployment job performing database migrations
Jobpost-deployPost-deployment job performing long data migrations
ReplicatedreplicatedLicense management and usage data collection
ReplicatedkotsadmKOTS Admin Console (KOTS-based installation only)
info

We have set a 30-days TTL (Time To Live) for pre-deploy and post-deploy jobs to allow for log retrieval if needed. It is recommended not to delete these pods, as they can be useful for troubleshooting.

Workers and queues​

Background tasks are sent to Celery queues (stored in Redis), and each worker consumes a set of queues. Many workers have 0 replicas by default: until you scale them up, their queues are handled by the worker listed in the last column, so no task is left unprocessed.

To scale a worker, set celeryWorkers.<key>.replicas, or enable autoscaling for it. The key is the Deployment name without worker- (for example scanners for worker-scanners), except for worker-long-tasks whose key is long. See Scaling for sizing recommendations.

DeploymentUsageQueuesDefault replicasIf 0 replicas, handled by
worker-workerGeneral-purpose worker: real-time scans, retries, honeytoken taskscelery, check_run, realtime, realtime_retry, honeytoken, core_default, sources_default, incidents_default, individual_validity_check2-
worker-scannersHistorical scans of repositoriesbasic_repo_scan, premium_repo_scan, code_fixing2-
worker-long-tasksLong-running tasks such as validity checks and NHI ingestionbackground_validity_check, update_sources_state, nhi_ingestion, endpoints, hmsl, core_long, sources_long, incidents_long, ml_backpopulate, core_aspm, team_sync2-
worker-emailEmail notifications and messagingemail, notifier2-
worker-public-monitoringPublic Monitoring scans. Active only when licensedpublic_monitoring, public_monitoring_realtime_scan, public_monitoring_historical_scan, public_monitoring_continuous_scan1-
worker-automatic-severitiesAutomatic severity computation. Up to 3 replicas when autoscaling is enabledautomatic_severities1worker-long-tasks
worker-batch-task-workerBatched tasks: saves secrets found in Amazon S3, Microsoft OneDrive, Microsoft SharePoint Online, JFrog Package Registries, Jira Cloud and Confluence Cloud, processes new issues, saves validity check results. See Batch task workerbatch_task_queue, validity_check_batch1worker-long-tasks
worker-ml-api-priorityMachine learning API-related tasksml_api_priority1worker-scanners
worker-check-runsGitHub check runscheck_run0worker-worker
worker-check-run-scannersScan-based (PR-scoped) GitHub check runscheck_run_scan0worker-scanners
worker-premium-scanners-retryHigh-memory worker retrying failed repository scans. See Premium scan retry workerpremium_repo_scan_retry0worker-scanners
worker-incidents-diskRecomputes secret locationsincidents_disk0worker-scanners
worker-ml-prioritizationMachine learning risk score of incidentsml_prioritization0worker-scanners
worker-realtime-odsReal-time scans of non-VCS sourcesrealtime_ods, realtime_retry_ods0worker-worker
worker-scanners-odsHistorical scans of non-VCS sourcesods_scan0worker-scanners
worker-scanners-ods-highdiskAttachments and files of non-VCS sources, which need more storageods_scan_highdisk0worker-scanners
worker-scanners-slackSlack historical scansslack_scan0worker-scanners
worker-scanners-db-less-jira-cloudJira Cloud historical scansdb_less_scan_jira_cloud0worker-scanners-ods, or worker-scanners if it also has 0 replicas
worker-scanners-db-less-confluence-cloudConfluence Cloud historical scansdb_less_scan_confluence_cloud0worker-scanners-ods, or worker-scanners if it also has 0 replicas
worker-scanners-db-lessAmazon S3, Microsoft OneDrive, Microsoft SharePoint Online and JFrog Package Registries scansdb_less_scan0worker-scanners
worker-container-registriesContainer registry scanscontainer_registries0worker-scanners
worker-long-odsScheduling of non-VCS recurrent scans and scan housekeepinglong_ods0worker-long-tasks
worker-long-ods-ioMicrosoft Teams synchronization and other IO-intensive taskslong_ods_io0worker-long-tasks
worker-business-contributionDeveloper contribution counting, on every pushbusiness_contribution0worker-batch-task-worker

Which worker processes which integration​

"Default worker" is the worker handling the queue with default replica counts. Scale up the dedicated worker to isolate the workload. Recurrent scans of non-VCS sources run on the same queues as their historical scans. Their frequency is set by the *_recurrent_scan_interval preferences.

Integration / scan typeQueuesDedicated workerDefault worker
Real-time scans of VCS pushes and pull/merge requests (GitHub, GitLab, Bitbucket, Azure DevOps, Gerrit)realtime, realtime_retry-worker-worker
VCS historical scans, and pushes too large for the VCS API (scanned from a clone)premium_repo_scan-worker-scanners
VCS historical scans retried once after a worker failurepremium_repo_scan_retryworker-premium-scanners-retryworker-scanners
GitHub check runscheck_runworker-check-runsworker-worker
GitHub check runs on pull requests too large for the GitHub APIcheck_run_scanworker-check-run-scannersworker-scanners
Real-time scans of Slack, Jira Data Center and Confluence Data Centerrealtime_ods, realtime_retry_odsworker-realtime-odsworker-worker
Historical scans of Jira Data Center, Confluence Data Center, Microsoft Teams and ServiceNowods_scanworker-scanners-odsworker-scanners
Attachments and files of Slack, Microsoft Teams, Jira Data Center and Confluence Data Centerods_scan_highdiskworker-scanners-ods-highdiskworker-scanners
Historical scans of Jira Cloud, including attachmentsdb_less_scan_jira_cloudworker-scanners-db-less-jira-cloudworker-scanners
Historical scans of Confluence Cloud, including attachmentsdb_less_scan_confluence_cloudworker-scanners-db-less-confluence-cloudworker-scanners
Historical scans of Slackslack_scanworker-scanners-slackworker-scanners
Amazon S3, Microsoft OneDrive, Microsoft SharePoint Online, JFrog Package Registriesdb_less_scanworker-scanners-db-lessworker-scanners
Container registries (Amazon ECR, Azure Container Registry, Docker Hub, Google Artifact Registry, Harbor, JFrog Container Registry, Red Hat Quay)container_registriesworker-container-registriesworker-scanners
Synchronization of Slack, Jira and Confluencesources_long-worker-long-tasks
Microsoft Teams teams and channels synchronizationlong_ods_ioworker-long-ods-ioworker-long-tasks
Scheduling of non-VCS recurrent scans and scan housekeepinglong_odsworker-long-odsworker-long-tasks
Honeytoken eventshoneytoken-worker-worker
Validity checks of a single secretindividual_validity_check-worker-worker
Periodic validity checksbackground_validity_check-worker-long-tasks
Validity check resultsvalidity_check_batchworker-batch-task-workerworker-batch-task-worker
Saving secrets found in Amazon S3, Microsoft OneDrive, Microsoft SharePoint Online, JFrog Package Registries, Jira Cloud and Confluence Cloud, and processing of new issuesbatch_task_queueworker-batch-task-workerworker-batch-task-worker
Developer contribution counting, on every pushbusiness_contributionworker-business-contributionworker-batch-task-worker
NHI Governance ingestion, team synchronizationnhi_ingestion, team_sync-worker-long-tasks
Public Monitoringpublic_monitoring*worker-public-monitoringworker-public-monitoring
Machine Learning on occurrencesml_api_priorityworker-ml-api-priorityworker-ml-api-priority
Machine Learning risk scoreml_prioritizationworker-ml-prioritizationworker-scanners
Email and notifications (Slack, Microsoft Teams, webhooks, ...)email, notifier-worker-email
ggshield and public API scansNone, processed synchronously-webapp-public-api
Things to know when scaling
  • Out of the box, worker-scanners handles most historical scans, including all non-VCS sources. If a source slows down VCS scans, give it its own worker by setting its replicas above 0: its queue moves off worker-scanners automatically.
  • Do not scale worker-worker, worker-scanners or worker-long-tasks to 0: the queues of the workers relying on them would no longer be processed.
  • Keep worker-batch-task-worker running. With 0 replicas, its batched tasks hold worker-long-tasks pods for 10 to 15 seconds each and delay the other long-running tasks. When batch_task_queue grows, scans of Amazon S3, Microsoft OneDrive, Microsoft SharePoint Online, JFrog Package Registries, Jira Cloud and Confluence Cloud pause until it drains.
  • check_run stays on worker-worker even when worker-check-runs is scaled up: both consume it.
  • Autoscaling relies on the queue length metric gim_celery_queue_length, labeled by queue_name. Use the queue names above to monitor a backlog. See Application metrics.