Update sbserver to add noexec nodev and nosuid to /etc/resolv.conf mount bind.
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
This commit is contained in:
		| @@ -115,7 +115,7 @@ func (c *Controller) sandboxContainerSpec(id string, config *runtime.PodSandboxC | |||||||
| 			Source:      c.getResolvPath(id), | 			Source:      c.getResolvPath(id), | ||||||
| 			Destination: resolvConfPath, | 			Destination: resolvConfPath, | ||||||
| 			Type:        "bind", | 			Type:        "bind", | ||||||
| 			Options:     []string{"rbind", "ro"}, | 			Options:     []string{"rbind", "ro", "nosuid", "nodev", "noexec"}, | ||||||
| 		}, | 		}, | ||||||
| 	})) | 	})) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -91,6 +91,14 @@ func getRunPodSandboxTestData() (*runtime.PodSandboxConfig, *imagespec.ImageConf | |||||||
| 			assert.NotEqual(t, "", spec.Process.SelinuxLabel) | 			assert.NotEqual(t, "", spec.Process.SelinuxLabel) | ||||||
| 			assert.NotEqual(t, "", spec.Linux.MountLabel) | 			assert.NotEqual(t, "", spec.Linux.MountLabel) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		assert.Contains(t, spec.Mounts, runtimespec.Mount{ | ||||||
|  | 			Source:      "/test/root/sandboxes/test-id/resolv.conf", | ||||||
|  | 			Destination: resolvConfPath, | ||||||
|  | 			Type:        "bind", | ||||||
|  | 			Options:     []string{"rbind", "ro", "nosuid", "nodev", "noexec"}, | ||||||
|  | 		}) | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
| 	return config, imageConfig, specCheck | 	return config, imageConfig, specCheck | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Vinayak Goyal
					Vinayak Goyal