Coder Social home page Coder Social logo

sysdiglabs / image-scanning-admission-controller Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 6.0 24 KB

Kubernetes admission controller that validate image in deployment is vulnerability free

License: Apache License 2.0

Makefile 8.85% Shell 91.15%
image scanning admission-controller sysdig

image-scanning-admission-controller's Introduction

Prerequiste

Deploy Image Scan Admission Webhook

run make deploy

Clean Image Scan Admission Webhook from Cluster

run make clean

Test

run make test

Limitation

There is a 30 seconds timeout for the webhook validation, it will be limited for the image scanner to return scanning result for a new image. This is because the image scanner need to download the image, unfold the image, and then conduct scanning. There is also a request to the upstream to make the webhook timeout configurable. So if there is new image to deploy for the first time, the admission controller will deny the request if no result returns in 30 seconds. However, due to complexity of the deployment workflow, the environment variable REJECT_IF_TIMEOUT in the YAML file is used to tune the admission controller timeout behavior.

image-scanning-admission-controller's People

Contributors

kaizhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

image-scanning-admission-controller's Issues

ValidatingWebhookConfiguration not created on OpenShift 4.2

Step-by-step process followed:

https://github.com/marcredhat/crcdemos/blob/master/sysdig/admissioncontroller/README.adoc

Expected result: ValidatingWebhookConfiguration created

Actual results:
oc logs image-scan-k8s-webhook-controller-manager-0 --follow
{"level":"info","ts":1571949974.6266456,"logger":"entrypoint","msg":"setting up client for manager"}
{"level":"info","ts":1571949974.6283126,"logger":"entrypoint","msg":"setting up manager"}
{"level":"info","ts":1571949975.0136602,"logger":"entrypoint","msg":"Registering Components."}
{"level":"info","ts":1571949975.0137165,"logger":"entrypoint","msg":"setting up scheme"}
{"level":"info","ts":1571949975.0137308,"logger":"entrypoint","msg":"Setting up controller"}
{"level":"info","ts":1571949975.0137427,"logger":"entrypoint","msg":"setting up webhooks"}
{"level":"info","ts":1571949975.0138788,"logger":"entrypoint","msg":"Starting the Cmd."}
{"level":"info","ts":1571949975.11553,"logger":"kubebuilder.webhook","msg":"installing webhook configuration in cluster"}

However, the pod enters a crash loop and the ValidatingWebhookConfiguration is not created.

Note: Other ValidatingWebhookConfiguration are working fine in the same environment
oc get ValidatingWebhookConfiguration --all-namespaces
NAME CREATED AT
autoscaling.openshift.io 2019-10-16T10:27:28Z
multus.openshift.io 2019-10-16T10:14:17Z

For a lab environment, you can fix this as follows but we need a proper solution:
oc adm policy add-scc-to-user anyuid -z default
securitycontextconstraints.security.openshift.io/anyuid added to: ["system:serviceaccount:image-scan-k8s-webhook-system:default"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.