increase list of restricted volumes
This commit is contained in:
@@ -463,6 +463,8 @@ func (c *Compiler) isPrivileged(step *resource.Step) bool {
|
|||||||
if len(step.Entrypoint) > 0 {
|
if len(step.Entrypoint) > 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
// privileged-by-default mode is disabled if the
|
||||||
|
// pipeline step mounts a restricted volume.
|
||||||
for _, mount := range step.Volumes {
|
for _, mount := range step.Volumes {
|
||||||
path, _ := filepath.Abs(mount.MountPath)
|
path, _ := filepath.Abs(mount.MountPath)
|
||||||
path = strings.ToLower(path)
|
path = strings.ToLower(path)
|
||||||
@@ -473,6 +475,24 @@ func (c *Compiler) isPrivileged(step *resource.Step) bool {
|
|||||||
return false
|
return false
|
||||||
case strings.Contains(path, "/var/run"):
|
case strings.Contains(path, "/var/run"):
|
||||||
return false
|
return false
|
||||||
|
case strings.Contains(path, "/proc"):
|
||||||
|
return false
|
||||||
|
case strings.Contains(path, "/mount"):
|
||||||
|
return false
|
||||||
|
case strings.Contains(path, "/bin"):
|
||||||
|
return false
|
||||||
|
case strings.Contains(path, "/usr/local/bin"):
|
||||||
|
return false
|
||||||
|
case strings.Contains(path, "/mnt"):
|
||||||
|
return false
|
||||||
|
case strings.Contains(path, "/media"):
|
||||||
|
return false
|
||||||
|
case strings.Contains(path, "/sys"):
|
||||||
|
return false
|
||||||
|
case strings.Contains(path, "/dev"):
|
||||||
|
return false
|
||||||
|
case strings.Contains(path, "/etc/docker"):
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if the container image matches any image
|
// if the container image matches any image
|
||||||
|
|||||||
Reference in New Issue
Block a user