Skip to content

Commit

Permalink
Merge pull request #377 from nak3/selinux-docker-driver
Browse files Browse the repository at this point in the history
Apply SELinux label to allocate directory of docker driver
  • Loading branch information
dadgar committed Nov 5, 2015
2 parents b0464a5 + c94bf6b commit cb811dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ func (d *DockerDriver) containerBinds(alloc *allocdir.AllocDir, task *structs.Ta
}

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

Expand Down

0 comments on commit cb811dd

Please sign in to comment.