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.
| Kind | Deployment Name | Usage |
|---|---|---|
| Front | nginx | Dashboard Frontend and proxy for backend |
| Backend | webapp-internal-api | Backend for the Dashboard |
| Backend | webapp-internal-api-long | Backend for the Dashboard (long requests, no timeout) |
| Backend | webapp-public-api | Public API and ggshield scans |
| Backend | webapp-hook | VCS webhooks events receiver |
| Backend | webapp-app-exporter | Prometheus exporter for applicative metrics. Only deployed when application metrics are enabled |
| Backend | ml-secret-engine | Machine Learning secret engine |
| Backend | apache-tika | File scanner for non-VCS sources scanning |
| Scheduler | beat | Celery Beat task scheduler. Must run as a single replica. |
| Worker | worker-* | Celery workers processing background tasks. See Workers and queues. |
| Job | inapp-analytics | Computes metrics and aggregates data for Advanced Analytics dashboards. |
| Job | pre-deploy | Pre-deployment job performing database migrations |
| Job | post-deploy | Post-deployment job performing long data migrations |
| Replicated | replicated | License management and usage data collection |
| Replicated | kotsadm | KOTS Admin Console (KOTS-based installation only) |
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.
| Deployment | Usage | Queues | Default replicas | If 0 replicas, handled by |
|---|---|---|---|---|
worker-worker | General-purpose worker: real-time scans, retries, honeytoken tasks | celery, check_run, realtime, realtime_retry, honeytoken, core_default, sources_default, incidents_default, individual_validity_check | 2 | - |
worker-scanners | Historical scans of repositories | basic_repo_scan, premium_repo_scan, code_fixing | 2 | - |
worker-long-tasks | Long-running tasks such as validity checks and NHI ingestion | background_validity_check, update_sources_state, nhi_ingestion, endpoints, hmsl, core_long, sources_long, incidents_long, ml_backpopulate, core_aspm, team_sync | 2 | - |
worker-email | Email notifications and messaging | email, notifier | 2 | - |
worker-public-monitoring | Public Monitoring scans. Active only when licensed | public_monitoring, public_monitoring_realtime_scan, public_monitoring_historical_scan, public_monitoring_continuous_scan | 1 | - |
worker-automatic-severities | Automatic severity computation. Up to 3 replicas when autoscaling is enabled | automatic_severities | 1 | worker-long-tasks |
worker-batch-task-worker | Batched 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 worker | batch_task_queue, validity_check_batch | 1 | worker-long-tasks |
worker-ml-api-priority | Machine learning API-related tasks | ml_api_priority | 1 | worker-scanners |
worker-check-runs | GitHub check runs | check_run | 0 | worker-worker |
worker-check-run-scanners | Scan-based (PR-scoped) GitHub check runs | check_run_scan | 0 | worker-scanners |
worker-premium-scanners-retry | High-memory worker retrying failed repository scans. See Premium scan retry worker | premium_repo_scan_retry | 0 | worker-scanners |
worker-incidents-disk | Recomputes secret locations | incidents_disk | 0 | worker-scanners |
worker-ml-prioritization | Machine learning risk score of incidents | ml_prioritization | 0 | worker-scanners |
worker-realtime-ods | Real-time scans of non-VCS sources | realtime_ods, realtime_retry_ods | 0 | worker-worker |
worker-scanners-ods | Historical scans of non-VCS sources | ods_scan | 0 | worker-scanners |
worker-scanners-ods-highdisk | Attachments and files of non-VCS sources, which need more storage | ods_scan_highdisk | 0 | worker-scanners |
worker-scanners-slack | Slack historical scans | slack_scan | 0 | worker-scanners |
worker-scanners-db-less-jira-cloud | Jira Cloud historical scans | db_less_scan_jira_cloud | 0 | worker-scanners-ods, or worker-scanners if it also has 0 replicas |
worker-scanners-db-less-confluence-cloud | Confluence Cloud historical scans | db_less_scan_confluence_cloud | 0 | worker-scanners-ods, or worker-scanners if it also has 0 replicas |
worker-scanners-db-less | Amazon S3, Microsoft OneDrive, Microsoft SharePoint Online and JFrog Package Registries scans | db_less_scan | 0 | worker-scanners |
worker-container-registries | Container registry scans | container_registries | 0 | worker-scanners |
worker-long-ods | Scheduling of non-VCS recurrent scans and scan housekeeping | long_ods | 0 | worker-long-tasks |
worker-long-ods-io | Microsoft Teams synchronization and other IO-intensive tasks | long_ods_io | 0 | worker-long-tasks |
worker-business-contribution | Developer contribution counting, on every push | business_contribution | 0 | worker-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 type | Queues | Dedicated worker | Default 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 failure | premium_repo_scan_retry | worker-premium-scanners-retry | worker-scanners |
| GitHub check runs | check_run | worker-check-runs | worker-worker |
| GitHub check runs on pull requests too large for the GitHub API | check_run_scan | worker-check-run-scanners | worker-scanners |
| Real-time scans of Slack, Jira Data Center and Confluence Data Center | realtime_ods, realtime_retry_ods | worker-realtime-ods | worker-worker |
| Historical scans of Jira Data Center, Confluence Data Center, Microsoft Teams and ServiceNow | ods_scan | worker-scanners-ods | worker-scanners |
| Attachments and files of Slack, Microsoft Teams, Jira Data Center and Confluence Data Center | ods_scan_highdisk | worker-scanners-ods-highdisk | worker-scanners |
| Historical scans of Jira Cloud, including attachments | db_less_scan_jira_cloud | worker-scanners-db-less-jira-cloud | worker-scanners |
| Historical scans of Confluence Cloud, including attachments | db_less_scan_confluence_cloud | worker-scanners-db-less-confluence-cloud | worker-scanners |
| Historical scans of Slack | slack_scan | worker-scanners-slack | worker-scanners |
| Amazon S3, Microsoft OneDrive, Microsoft SharePoint Online, JFrog Package Registries | db_less_scan | worker-scanners-db-less | worker-scanners |
| Container registries (Amazon ECR, Azure Container Registry, Docker Hub, Google Artifact Registry, Harbor, JFrog Container Registry, Red Hat Quay) | container_registries | worker-container-registries | worker-scanners |
| Synchronization of Slack, Jira and Confluence | sources_long | - | worker-long-tasks |
| Microsoft Teams teams and channels synchronization | long_ods_io | worker-long-ods-io | worker-long-tasks |
| Scheduling of non-VCS recurrent scans and scan housekeeping | long_ods | worker-long-ods | worker-long-tasks |
| Honeytoken events | honeytoken | - | worker-worker |
| Validity checks of a single secret | individual_validity_check | - | worker-worker |
| Periodic validity checks | background_validity_check | - | worker-long-tasks |
| Validity check results | validity_check_batch | worker-batch-task-worker | worker-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 issues | batch_task_queue | worker-batch-task-worker | worker-batch-task-worker |
| Developer contribution counting, on every push | business_contribution | worker-business-contribution | worker-batch-task-worker |
| NHI Governance ingestion, team synchronization | nhi_ingestion, team_sync | - | worker-long-tasks |
| Public Monitoring | public_monitoring* | worker-public-monitoring | worker-public-monitoring |
| Machine Learning on occurrences | ml_api_priority | worker-ml-api-priority | worker-ml-api-priority |
| Machine Learning risk score | ml_prioritization | worker-ml-prioritization | worker-scanners |
| Email and notifications (Slack, Microsoft Teams, webhooks, ...) | email, notifier | - | worker-email |
| ggshield and public API scans | None, processed synchronously | - | webapp-public-api |
- Out of the box,
worker-scannershandles 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 offworker-scannersautomatically. - Do not scale
worker-worker,worker-scannersorworker-long-tasksto 0: the queues of the workers relying on them would no longer be processed. - Keep
worker-batch-task-workerrunning. With 0 replicas, its batched tasks holdworker-long-taskspods for 10 to 15 seconds each and delay the other long-running tasks. Whenbatch_task_queuegrows, scans of Amazon S3, Microsoft OneDrive, Microsoft SharePoint Online, JFrog Package Registries, Jira Cloud and Confluence Cloud pause until it drains. check_runstays onworker-workereven whenworker-check-runsis scaled up: both consume it.- Autoscaling relies on the queue length metric
gim_celery_queue_length, labeled byqueue_name. Use the queue names above to monitor a backlog. See Application metrics.