Infrastructure Service Accounts¶
Directory Context
This document is part of the Infrastructure Directory. See the Infrastructure Directory Inventory for related resources.
Overview¶
The scanner-infrastructure
chart creates and manages service accounts for container scanning operations. These service accounts are the identity used for authentication to the Kubernetes API and are bound to specific roles through RBAC.
Service Account Implementation¶
Core Service Account¶
The chart creates a dedicated service account for scanning operations:
This service account:
- Acts as the identity for all scanning operations
- Is bound to a role with specific permissions
- Exists in the target namespace for scanning
Token Management¶
The chart supports token generation for service account authentication:
This process:
- Creates a short-lived token (typically 1 hour)
- Configures kubeconfig with the token
- Provides temporary access for scanning
Cloud Provider Integration¶
AWS EKS Integration¶
For EKS clusters with IAM roles for service accounts:
Google GKE Integration¶
For GKE clusters with Workload Identity:
Azure AKS Integration¶
For AKS clusters with Pod Identity or Workload Identity:
Multi-Team Service Account Setup¶
For multi-team environments, create separate service accounts:
Configuration Reference¶
Parameter | Description | Default | Required |
---|---|---|---|
serviceAccount.create |
Create service account | true |
No |
serviceAccount.name |
Service account name | inspec-scanner |
No |
serviceAccount.annotations |
Service account annotations | {} |
No |
serviceAccount.labels |
Service account labels | {} |
No |
serviceAccount.automountToken |
Automount API token | true |
No |
serviceAccount.imagePullSecrets |
Image pull secrets | [] |
No |
Token Management Options¶
Setting Token TTL¶
Configure token time-to-live for enhanced security:
Automating Token Rotation¶
For automated scanning in CI/CD pipelines:
Best Practices¶
- Use Dedicated Service Accounts: Create separate accounts for different teams or purposes
- Limit Token Lifetime: Use short-lived tokens (15-60 minutes)
- Avoid Persistent Credentials: Generate tokens only when needed
- Clean Up Tokens: Remove token files after use
- Leverage Cloud IAM: Use cloud provider IAM integration when available
- Set Appropriate Annotations: Configure annotations for cloud provider integration