Documentation
¶
Overview ¶
Package imagescan 은 스택이 설치한 OSS 이미지를 스택의 Trivy 서버로 스캔한다.
플랫폼은 클러스터 밖에서 돈다. 이미지를 받아 분석하는 일은 스택 네임스페이스의 Job 이 하고, 플랫폼은 그 결과를 로그로 받는다.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubectlFunc ¶
KubectlFunc 는 kubeconfig 로 kubectl 을 실행한다.
type Option ¶
type Option func(*Scanner)
Option 은 Scanner 설정이다.
func WithMirrorRegistry ¶
WithMirrorRegistry 는 에어갭 내부 레지스트리에서 이미지를 받게 한다.
에어갭 노드는 containerd 미러로 이미지를 받아서, 파드의 imageID 는 원래 레지스트리 이름이다. 스캔 Job 의 trivy client 는 그 이름으로 받을 수 없으므로 번들이 올린 경로로 바꾸고, plain HTTP 레지스트리를 허용하며, Java DB 도 같은 레지스트리의 미러에서 받는다. host 가 비면 아무것도 바꾸지 않는다.
func WithPollInterval ¶
WithPollInterval 은 Job 완료를 확인하는 간격을 바꾼다(테스트용).
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner 는 port.InstalledImageScanner 구현이다.
func (*Scanner) ScanInstalledImages ¶
func (s *Scanner) ScanInstalledImages(ctx context.Context, kubeconfig []byte, namespace string, shared []domain.SharedComponent) ([]domain.StackImageScan, error)
ScanInstalledImages 는 네임스페이스에서 실행 중인 이미지를 digest 단위로 스캔한다.
Click to show internal directories.
Click to hide internal directories.