You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkg/podman/podman: Add DoesImageFulfillRequirements() function
Add unified image validation function that checks multiple
compatibility requirements including Toolbx labels, LD_PRELOAD
environment variable, and image entrypoint. Returns boolean
compatibility status along with detailed warning messages for
any detected issues.
Signed-off-by: Dalibor Kricka <[email protected]>
returnfalse, "", fmt.Errorf("failed to verify image compatibility: %w", err)
584
+
}
585
+
if!isToolboxImage {
586
+
warnings=append(warnings, fmt.Sprintf("Warning: Image '%s' does not contain either of the labels 'com.github.containers.toolbox=true' and 'com.github.debarshiray.toolbox=true'", image))
587
+
}
588
+
589
+
isLDPRELOADEnvSet, err:=IsLDPRELOADEnvSet(image)
590
+
iferr!=nil {
591
+
returnfalse, "", fmt.Errorf("failed to validate LD_PRELOAD variable settings: %w", err)
592
+
}
593
+
ifisLDPRELOADEnvSet {
594
+
warnings=append(warnings, fmt.Sprintf("Warning: Image '%s' has environment variable LD_PRELOAD set, which may cause container vulnerability (Container Escape)", image))
595
+
}
596
+
597
+
hasEntrypoint, err:=HasImageEntrypoint(image)
598
+
iferr!=nil {
599
+
returnfalse, "", fmt.Errorf("failed to check image entrypoint: %w", err)
600
+
}
601
+
ifhasEntrypoint {
602
+
warnings=append(warnings, fmt.Sprintf("Warning: Image '%s' has an entrypoint defined", image))
0 commit comments