weaveworks / weave-gitops-private

This is for tracking weaveworks internal information on weave-gitops. Will include issues, internal roadmaps, etc.
2 stars 4 forks source link

Flux source controller artefacts without authentication within the cluster #107

Closed morancj closed 1 year ago

morancj commented 1 year ago

Report

This section to be completed to report a potential vulnerability.

Describe

Reported by guillaume.berche@orange.com.

I’m reporting a suspected security issue as suggested into https://docs.gitops.weave.works/security/

I’ve been observing that following a flux installation with the openshift OLM installation, the source controller artefacts are available without authentication and without encryption within the whole cluster. As a flux user, I believe this is an insecure security default. Even though git repos are not supposed to include unencrypted secrets, exposing source controllers artefacts without authentication or in-transient (tls) encryption causes the following security issues:

A malicious container within a multi tenant openshift cluster may be discover the list of git repo names available in source controllers Then laterally download source artefacts and access confidential information such as how the current cluster is provisioned or secured using flux. Then Search for any non encrypted secret in the artefacts

The https://artifacthub.io/packages/olm/community-operators/flux does not seem to provide sufficient warning or guidance related to built-in security

Also the source controller seems to help with the discovery of the available artefacts

root@debug-tool-2qj4b:~# curl -vvv http://source-controller.flux-system.svc.cluster.local./gitrepository/fluxcd/
*   Trying 172.30.150.238...
* TCP_NODELAY set
* Connected to source-controller.flux-system.svc.cluster.local (172.30.150.238) port 80 (#0)
GET /gitrepository/fluxcd/ HTTP/1.1
Host: source-controller.flux-system.svc.cluster.local
User-Agent: curl/7.58.0
Accept: */*

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Last-Modified: Thu, 19 Jan 2023 10:46:39 GMT
Date: Mon, 23 Jan 2023 09:40:01 GMT
Content-Length: 129

<pre>
<a href="paas-k8s-config-repo/">paas-k8s-config-repo/</a>
<a href="paas-k8s-gitops-repo/">paas-k8s-gitops-repo/</a>
</pre>

References

Post to security@weave.works Weaveworks security vulnerability process

Handling

If you are reporting a potential vulnerability, you could ignore this section. It is intended to be managed by a Vulnerability Manager

lizwarner-weave commented 1 year ago

I will be temporary Vunerability Manager until we agree which group owns the fix to this issue (or if indeed we intend to fix anything). Discussion history is on the flux channel, much of 27 Jan 2023.

lizwarner-weave commented 1 year ago

Resolution WIP https://github.com/weaveworks/flux2-openshift/pull/18

Assigning to Soule as Vulnerability Manager

souleb commented 1 year ago

Operatorhub has been updated with the lastest flux version(v0.40.0). We have updated the description with a warning stating that the Network policies are not shipped with the bundle. See https://operatorhub.io/operator/flux.

However we have tested that manually applying the Network Policies on openshift works fine.

Closing this now.