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

CIS benchmark rke2 hardened fails in 5.3.1 with cilium as CNI #154

Closed
Martin-Weiss opened this issue May 13, 2022 · 8 comments
Closed

CIS benchmark rke2 hardened fails in 5.3.1 with cilium as CNI #154

Martin-Weiss opened this issue May 13, 2022 · 8 comments

Comments

@Martin-Weiss
Copy link

Just updated to rancher 2.6.5 and deployed cis benchmark 2.0.4. scanned the downstream cluster and got an error for 5.3.1 (cni does not support network policies).

This is a false positive as cilium does support and has enabled network policies.

Seems this is the root cause https://github.com/rancher/security-scan/blob/9116bbe07914478ca79e0756a4798fa41a49a95e/package/cfg/rke2-cis-1.6-hardened/policies.yaml#L200

Could we get this "fixed" in a way that is also accepts cilium and probably all other CNIs that are available and supported for RKE2 and that have support for network policies?

@anupama2501
Copy link

See a similar failure when the CNI is canal, cis operator: 2.0.4

NAME         CLUSTERSCANPROFILE              TOTAL   PASS   FAIL   SKIP   WARN   NOT APPLICABLE   LASTRUNTIMESTAMP       CRONSCHEDULE
scan-mjqrf   rke2-cis-1.5-profile-hardened   122     84     1      0      27     10               2022-05-03T19:48:33Z   
scan-q5d7t   rke2-cis-1.6-profile-hardened   122     90     1      0      25     6                2022-05-03T19:48:12Z   
5.3.1 has failed 	for 1.5_hardened and 1.6_hardened..
5.3.1	Ensure that the CNI in use supports Network Policies (Not Scored) 

@anupama2501
Copy link

@jtravee release note for 2.6.5:

Hardening guide template for RKE2 currently only supports CNI canal

@jtravee
Copy link

jtravee commented May 13, 2022

@jtravee release note for 2.6.5:

Hardening guide template for RKE2 currently only supports CNI canal

Added to published notes!

@rayandas
Copy link
Contributor

rayandas commented Jul 8, 2022

I validated this issue with both Cilium and Canal CNI. With Canal the test is passing but with Cilium it's failing. Anupama mentioned there that "Hardening guide template for RKE2 currently only supports CNI canal".

@macedogm
Copy link
Member

macedogm commented Jul 11, 2022

IMO the issue is not that the hardening guide template for RKE2 currently only supports CNI canal, but actually that our provided CIS profile is only checking for Canal, see https://github.com/rancher/security-scan/blob/master/package/cfg/rke2-cis-1.6-hardened/policies.yaml#L195-L200 . So even if Cilium supports network policy, the CIS check will not check for it. That's why the hardening guide only mentions Canal for the moment. When the CIS check is fixed/improved, we can then update the hardening guide.

@mitulshah-suse
Copy link
Contributor

Have updated the security scan to pass for all CNIs which support network policies.

@rishabhmsra
Copy link

Validated on rancher v2.7-head(35388ea)
Downstream cluster : RKE2 hardened cluster(1-cp, 1-etcd, 1-w) -> v1.24.4+rke2r1

Steps followed:

  • Provisioned RKE2 hardened clusters using below CNI ->
    • canal
    • cilium
    • calico
    • multus,canal
    • multus,cilium
    • multus,calico
  • Installed CIS benchmark chart 3.0.0-rc2 with following image versions on all the downstream clusters.
image:
  cisoperator:
    repository: rancher/cis-operator
    tag: v1.0.10-rc1
  securityScan:
    repository: rancher/security-scan
    tag: v0.2.9-rc1
  sonobuoy:
    repository: rancher/mirrored-sonobuoy-sonobuoy
    tag: v0.56.7
  • Ran the scan using rke2-cis-1.23-profile-hardened profile.

Result:

  • 5.3.1 passed on all the clusters.

531pass

@mitulshah-suse
Copy link
Contributor

mitulshah-suse commented Oct 5, 2022

/backport v2.6.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants