istio: proxy: init container cannot manipulate iptables with selinux enforcing
When selinux is enforcing withing RHEL, the iptables rules do not appear properly setup when the init container runs.
First error first time the init container is run:
iptables: No chain/target/match by that name.
Second error (and forever after) the init container is run:iptables: Chain already exists
with selinux set to enforcing, the following error appears
`type=AVC msg=audit(1521747498.758:3677): avc: denied { module_request } for pid=486 comm="iptables" kmod="ipt_REDIRECT" scontext=system_u:system_r:svirt_lxc_net_t:s0:c388,c684 tcontext=system_u:system_r:kernel_t:s0 tclass=system`
istio version: 0.6.0 OS: RHEL 7.4 Environment: OpenShift Origin 3.9 rc / kube 1.9
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 24 (11 by maintainers)
I have a few results after more testing and found a few issues:
Sidecar defaults
In our docs we mention several ways of injecting the sidecar but the logic and instructions do not inherently require someone to use the istio-inject configmap. During setup we recommend bootstrapping Istio with
kubectl apply -f ./install/kubernetes/istio.yaml
. I think this yields the very minimum settings required for the sidecar here. A file injected manually with istioctl will default to these settings and the template will not fill in the correct NET_ADMIN privileges.Possible options for sidecar docs:
Privilege settings
The release configmap only adds minimal NET_ADMIN securityContext settings for the init container but this is either not enough for SeLinux/AppArmor or there is a subtle bug in our prepare_proxy.sh script.
** Possible problems **