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

variables cilium_enable_host_firewall and cilium_policy_audit_mode for configmap/cilium-config #10989

Closed
wants to merge 0 commits into from

Conversation

ledroide
Copy link
Contributor

@ledroide ledroide commented Mar 8, 2024

What type of PR is this?

/kind feature

Special notes for your reviewer:

In order to enable (Cilium Host Firewall](https://docs.cilium.io/en/v1.15/security/host-firewall/) and the recommended PolicyAuditMode that prevents unwanted side effects during testing, we have added 2 variables to cilium role and to inventory (features are disabled by default) :

cilium_enable_host_firewall: false
cilium_policy_audit_mode: false

These features are then added in ConfigMap/cilium-config by cilium role

enable-host-firewall: "true"
policy-audit-mode: "true"

We have added related documentation in docs/cilium.md

Does this PR introduce a user-facing change?:

Add optional support for _Host Firewall_ and _PolicyAuditMode_ features in Cilium

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 8, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @ledroide. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 8, 2024
@k8s-ci-robot k8s-ci-robot requested review from ErikJiang and mzaian March 8, 2024 16:05
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 8, 2024
@yankay
Copy link
Member

yankay commented Mar 10, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 10, 2024
@ledroide
Copy link
Contributor Author

I have a doubt about the right choice for conditionals in the cilium-config template at path roles/network_plugin/cilium/templates/cilium/config.yml.j2.

Here is what I wrote, just because many options are implemented this way.

{% if cilium_enable_host_firewall %}
  enable-host-firewall: "true"
{% endif %}
{% if cilium_policy_audit_mode %}
  policy-audit-mode: "true"
{% endif %}

Let's say I want to enable policy-audit-mode temporarily in order to set my rules. Si I set the variable cilium_policy_audit_mode: true and run my playbook.
Because cilium_policy_audit_mode is true the the configmap contains policy-audit-mode: "true".

But what if, after my whole setting, I want to explicitly set policy-audit-mode: "false" in the configmap/cilium-config - changing to cilium_policy_audit_mode: false ?

Maybe we had better always rely on default values for the role - that are already set in roles/network_plugin/cilium/defaults/main.yml - and always set a value for policy-audit-mode in the configmap/cilium-config ?

This would simply be written this way, instead of conditionals :

  enable-host-firewall: {{ cilium_enable_host_firewall | quote }}
  policy-audit-mode: {{ cilium_policy_audit_mode | quote }}

What do you think ?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ledroide

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants