SAP-archive / karydia

Kubernetes Security Walnut
Other
76 stars 10 forks source link

Support & Checks for Host Security #181

Open vasu1124 opened 5 years ago

vasu1124 commented 5 years ago

Description

Support & Checks for Host Security

User Story

As cluster admin I want to ensure that my network (overlay and underlay) is secured by network policies. I additionally can rely on IaaS security groups and other features.

[OPTIONAL] Implementation idea

Calico offers Host Endpoint objects to secure at the host level: https://docs.projectcalico.org/v3.8/security/host-endpoints/

CodeClinch commented 5 years ago

After an investigation of this suggestion, I really like the idea of closing some open doors with calico directly. We have to find a good integration. For a prototype I did the following steps to get the policies into the cluster:

Further things to evaluate:

Neumann-Nils commented 5 years ago

Thanks for your suggestion and sorry that it took us so long to reply. I took a deeper look into Calico and how we could use its features in Karydia.

First, I checked if it is reasonable to add Calico features to Karydia with an appropriate effort, which is definitely the case. I already tested out an implementation sketch to use/apply Calico-managed resources (e.g. GlobalNetworkPolicies and NetworkPolicies) with Karydia (also described here):

  1. Create a service account with sufficient permission for creating the defined policies
  2. Run a pod with calicoctl that applies the policies and other calico-specific resources
  3. Kill the pod after it is finished
  4. Remove all calico-related resources created by Karydia if Karydia is deleted

During this test scenario, I had some troubles using HostEndpoints as Karydia is running within the cluster and does not have an overview of all endpoints. Moreover, I am not sure how the use-case would look like and which security benefits should be achieved by your proposed implementation idea. Can you give us some more information about the usage of HostEndpoints within the NetworkPolicies and your motives behind this approach?