I hope if you are getting started with Kubescape ,you have already your Docker Engine and minikube installed on your system.
Firstly, run these commands in cmd:
minikube start - to start minikube cluster.
minikube status- to check status of cluster.
Take a look:
Now, single node cluster running on your system.
Now, you make your yaml file to deploy pods to your cluster. You even can do Simple deployment but I prefer Monokole tool. It saves my precious time.
By using Monokole,I create pod using available templates. By taking few steps with the help of Monokole, my created pod is deployed to minikube cluster.
Take a look:
- Select any template you want to create.
Here , You give pod name and image name you want to create. Then click on Submit button.
Now, click on Done. Your pod resource created successfully.
Now, simply click on Deploy button at the right top.
Click on OK. Your pod successfully deployed to your cluster.
This message shows at right top after deployed.
"NOW, WE DROP OUR FOCUS TO LEARN OR GETTING START WITH KUBESCAPE." HOW KUBESCAPE HELPS US?
Introduction:
Kubescape is a open-source tool by Armo. It scans ours k8s clusters, YAML files and Helm charts, finding vulnerabilities and detecting misconfigurations according to some frameworks like MITRE,NSA etc. It is much easy to use.
Now, you install Kubescape according to your systems . Simply go to Github repositry of Kubescape: github.com/armosec/kubescape
Running commands on your cmd according to your system.
After running these commands, Successfully you installed Kubescape on your system.
SCAN YOUR CLUSTERS:
Kubescape helps us in scans our clusters with few seconds. Now in our system ,before few seconds(in above) We run a minikube cluster. LET'S SCAN IT BY USING KUBESCAPE.
Simply run this command in cmd:
kubescape scan --submit --enable-host-scan
I get these results. It shows me vulnerabilties and risk scores and also checks which resources are passed or failed.
As it is difficult for us to deal things on cmd, We can access Kubescape Dashobard just by signing up. Click on link: portal.armo.cloud/account/sign-up
You sign up with your Google account or via Github.
After sign up,This Dashboard seems to be appear in front of you.
Just run these commands on cmd . This Dashboard appears in front of you.
Now ,If you wanna scan your cluster .Click on 'add cluster' button.
After adding cluster, like this appears. Now, you select 'click here' button for ci/cd Deployment.
Now, You can run a scan for your cluster by running the above command on cmd and able to see the vulnerabilities in our cluster through Dashboard.
This is how you scan your clusters with the help of Kubescape and checks which resources are passed or failed and also fix these vulnerabilties (solutions provides in remediation).
Scanning YAML Files:
Kubescape helps us in scannig our YAML files. Let's do it. Give path to your Yaml file where you create it and run below commands on your cmd.
Result:
Now, Successfully your image is scanned.
You can also scan your K8s manifests from public repositry.
Image Scanning:
Kubescape helps in scanning our image.
Lets's see it how?
Make sure you installed the Helm and now simply open Kubescape Dashboard and click on 'Image Scanning'. This like Dashboard appears in front of you and then after run below command on your cmd.
Now, you can see the severities in your image.
Yeah, You scanned your image successfully.
RBAC Visualizer:
RBAC stands for Role Back Access Control. RBAC helps us in accessing what is in your cluster and what is user want to accessing.
To use RBAC Visualiser, just click on it . You can add your Query and you can also investigate.
In this ,I investigate the user.(just shown up my example here)
Customize your own Framework:
Why you need customize Framework?
If you want to add some specify set of rules and controls to your project. For this ,You can make your own framework.
- Simply click on new Framework.
2.Now, give name to your Framework and description of your Framework.
(GIVEN EXAMPLE OF MY OWN FRAMEWORK HERE)
3.And also add rules and controls to your framework by just simply click on it.
Now, your own framework is ready, you can check it.
Let's scan it on cmd by using following command:
Result:
This is how you create your own Framework.
This is all about main concepts of using and benefits of Kubescape and there are much more. You can explore more features of kubescape by yourself like Kubescape Vs Code Extension etc.
HOPE YOU LIKE IT! THANKS.