Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policy: Fix enforcement status for host endpoint #11759

Merged
merged 1 commit into from
Jun 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/policy/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,10 @@ func (p *Repository) computePolicyEnforcementAndRules(securityIdentity *identity
// enabled for the endpoint.
return true, true, matchingRules
case option.DefaultEnforcement:
if lbls.Has(labels.IDNameHost) && !option.Config.EnableHostFirewall {
return false, false, nil
}

ingress, egress, matchingRules = p.getMatchingRules(securityIdentity)
// If the endpoint has the reserved:init label, i.e. if it has not yet
// received any labels, always enforce policy (default deny).
Expand Down