Skip to content

Commit cb811dd

Browse files
committed
Merge pull request #377 from nak3/selinux-docker-driver
Apply SELinux label to allocate directory of docker driver
2 parents b0464a5 + c94bf6b commit cb811dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client/driver/docker.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ func (d *DockerDriver) containerBinds(alloc *allocdir.AllocDir, task *structs.Ta
108108
}
109109

110110
return []string{
111-
fmt.Sprintf("%s:%s", shared, allocdir.SharedAllocName),
112-
fmt.Sprintf("%s:%s", local, allocdir.TaskLocal),
111+
// "z" and "Z" option is to allocate directory with SELinux label.
112+
fmt.Sprintf("%s:/%s:rw,z", shared, allocdir.SharedAllocName),
113+
// capital "Z" will label with Multi-Category Security (MCS) labels
114+
fmt.Sprintf("%s:/%s:rw,Z", local, allocdir.TaskLocal),
113115
}, nil
114116
}
115117

0 commit comments

Comments
 (0)