function-mesh icon indicating copy to clipboard operation
function-mesh copied to clipboard

need to fix operator security vulnerabilities

Open tpiperatgod opened this issue 3 years ago • 11 comments

The function-mesh-operator has some security vulnerabilities, and we need to fix them, refer to:

https://artifacthub.io/packages/helm/function-mesh/function-mesh-operator?modal=security-report

tpiperatgod avatar May 19 '22 04:05 tpiperatgod

Following link provided above, today in v0.4: 10 vulnerabilities have been detected in this package's images. 2022-08-02_15h04_48

hpvd avatar Aug 02 '22 13:08 hpvd

https://catalog.redhat.com/software/containers/streamnative/function-mesh/62d06b34df1077330aa2619d?container-tabs=security

freeznet avatar Aug 10 '22 07:08 freeznet

in link above to redhat, the redhat security score of A unfortunately has no real meaningfulness for the total security:

This image includes layers and packages that cannot be scanned or compared to public vulnerability information.

The Container Health Index analysis is based on RPM packages signed and created by Red Hat, and does not grade other software that may be included in a container image.

2022-08-15_14h06_53

hpvd avatar Aug 15 '22 12:08 hpvd

of course its hard to fix all of them...

what do you think of adapting the distroless approach to get rid of software in containers that contains security problems but is actually not needed anyway?

hpvd avatar Aug 15 '22 12:08 hpvd

just opened a new issue with some background and sources on the distroless approach: https://github.com/streamnative/function-mesh/issues/448

hpvd avatar Aug 15 '22 12:08 hpvd

today in v0.6: with https://artifacthub.io/packages/helm/function-mesh/function-mesh-operator?modal=security-report

13 vulnerabilities have been detected in this package's images.

2022-09-30_13h27_13

hpvd avatar Sep 30 '22 11:09 hpvd

just an update on freshly release v0.7: 14 vulnerabilities (14 fixable) have been detected in this package's images.

source: https://artifacthub.io/packages/helm/function-mesh/function-mesh-operator?modal=security-report

2022-10-18_07h56_29

hpvd avatar Oct 18 '22 06:10 hpvd

some more details: 2022-10-18_07h57_27

hpvd avatar Oct 18 '22 06:10 hpvd

As background info, the security scanner used by artifacthub, providing results shown above is trivy, so all the finding should be pretty valid.

For details, see: https://artifacthub.io/docs/topics/security_report/

and trivy https://github.com/aquasecurity/trivy

hpvd avatar Oct 18 '22 07:10 hpvd

there is also an easy to use github action for scanning with trivy

  • the complete repository,
  • pull requests,
  • docker container
  • IaC
  • etc.

=> Maybe, this is interesting to integrate this directly into the CI pipeline... See Readme of https://github.com/aquasecurity/trivy-action

hpvd avatar Oct 18 '22 07:10 hpvd

Extract:

these 5 updates to the latest versions should solve all found 14 vulnerabilities:

  • [x] https://github.com/prometheus/client_golang/releases
  • [x] https://github.com/kubernetes/client-go/tags
  • [ ] https://pkg.go.dev/golang.org/x/text?tab=versions
  • [x] https://pkg.go.dev/golang.org/x/crypto?tab=versions
  • [ ] https://pkg.go.dev/golang.org/x/net?tab=versions

hpvd avatar Oct 18 '22 11:10 hpvd

fyi - a CRITICAL vulnerability was newly introduced with the release v0.8 by using an old version of https://github.com/emicklei/go-restful/tags 2.9.5 from May 16, 2019 latest would be v2.16.0 or even 3.10.0

Some others were nicely cleaned up by updating dependencies!

in summary, this leads to a security rating of F (where A is the best)

for details 2022-11-17_12h23_05

https://artifacthub.io/packages/helm/function-mesh/function-mesh-operator?modal=security-report

hpvd avatar Nov 17 '22 11:11 hpvd

hm, that looks bad, I will add workflow to scan the vulnerabilities

jiangpengcheng avatar Nov 18 '22 01:11 jiangpengcheng

for further thoughts on this topic see https://github.com/streamnative/function-mesh/pull/527#discussion_r1026188441

hpvd avatar Nov 18 '22 09:11 hpvd

looks like they may be introduce by metrics server which has an open issue for this https://github.com/kubernetes-sigs/metrics-server/issues/1096

or by kube metrics, where a new version was just released (v2.7) https://github.com/kubernetes/kube-state-metrics/releases (current rating: A - No vulnerabilities found)

hpvd avatar Nov 18 '22 15:11 hpvd

closing as resolved

jiangpengcheng avatar Dec 06 '22 01:12 jiangpengcheng

perfectly solved:

security rating: A see 2022-12-22_18h23_37

https://artifacthub.io/packages/helm/function-mesh/function-mesh-operator?modal=security-report

hpvd avatar Dec 22 '22 17:12 hpvd