How kubescape/operator works
Main Components
a. Core Components:
• Admission Controller (from /admission directory)
• REST API Handler (from /restapihandler)
• Main Handler (from /mainhandler)
• Continuous Scanning Engine (from /continuousscanning)
• Watcher System (from /watcher)
• Object Cache (from /objectcache)
b. External Components:
• Kubernetes API Server
• Kubescape Scanner
• KubeVuln Scanner
• WebSocket Connections
• External REST API Clients
Component Relationships
[External Clients] → [REST API Handler] ↔ [Main Handler]
• ↕
[WebSocket] → [Continuous Scanning] → [Watcher System]
• ↕
[Kubernetes API] ← [Admission Controller] → [Object Cache]
• ↕
• [KubeVuln Scanner] ← [Service Handler]
• [Kubescape Scanner]
Component Details
a. REST API Handler:
• Endpoint: /v1/triggerAction
• OpenAPI documentation endpoints
• Action triggering capabilities
b. Admission Controller:
• Webhook server
• Rule binding cache
• Security rule implementations
c. Watcher System:
• Pod watcher
• SBOM watcher
• Application profile watcher
• Commands watcher
d. Main Handler:
• CronJob handler
• Image registry handler
• Kubescape handler
• Vulnerability scan handler
Key Interactions to Highlight
• REST API requests flow from external clients through the REST API handler to the main handler
• Continuous scanning engine monitoring Kubernetes resources
• Webhook admission control for security policy enforcement
• Watcher system's interaction with Kubernetes API server
• Communication with external scanning services (Kubescape and KubeVuln)
Configuration Elements
A separate section showing configuration sources:
• /etc/config/capabilities.json
• /etc/config/clusterData.json
• /etc/config/config.json
• /etc/config/services.json
• Environment variables