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

Mirantis K8s engine support #1181

Closed
4 tasks
nyrahul opened this issue Mar 24, 2023 · 2 comments · Fixed by #1183
Closed
4 tasks

Mirantis K8s engine support #1181

nyrahul opened this issue Mar 24, 2023 · 2 comments · Fixed by #1183
Labels
enhancement New feature or request

Comments

@nyrahul
Copy link
Contributor

nyrahul commented Mar 24, 2023

Feature Request

Short Description

Supporting k8s cluster solution from Mirantis.

Describe the solution you'd like

  • Check if policy enforcement, observability, audit rules, network segmentation is supported
  • Get output of karmor probe
  • Update kubearmor support matrix
  • Provide and attach karmor sysdump
@nyrahul nyrahul added the enhancement New feature or request label Mar 24, 2023
@nyrahul nyrahul changed the title Mirantis K8s cluster support Mirantis K8s engine support Mar 24, 2023
@AshokAccuknox AshokAccuknox mentioned this issue Mar 26, 2023
4 tasks
@AshokAccuknox
Copy link
Contributor

Mirantis Kubernetes Engine:

Mirantis Kubernetes Engine (formerly Docker Enterprise/UCP) is fully-baked Enterprise Kubernetes for development, testing, and production. It includes the Universal Control Plane webUI for easy management, Mirantis Secure Registry (formerly Docker Trusted Registry) for private container image storage and security scanning, and runs on Mirantis Container Runtime (formerly Docker Engine – Enterprise) — a hardened container runtime with optional FIPS 140-2 encryption and other security and reliability features

mke-1

Mirantis Cluster with 3 Manager and 2 worker nodes:

This is a trial version Mirantis Bare Metal Cluster running in AWS using Ubuntu 20.04 Operating System.

mke-2

mke-3

Installing Sample wordpress-mysql application:

Installed Sample Wordpress-Mysql Application using the following command:

kubectl apply -f https://raw.githubusercontent.com/kubearmor/KubeArmor/main/examples/wordpress-mysql/wordpress-mysql-deployment.yaml

mke-4

Installing KubeArmor in MKE:

Installed KubeArmor in the Mirantis Kubernetes Engine with following Commands:

curl -sfL http://get.kubearmor.io/ | sudo sh -s -- -b /usr/local/bin
karmor install

mke-5

mke-6

Applying KubeArmor Policy:

Audit policy for mysql:

The following policy audits the access to the var/lib/mysql folder.

apiVersion: security.kubearmor.com/v1
kind: KubeArmorPolicy
metadata:
  name: ksp-mysql-audit-dir
  namespace: wordpress-mysql
spec:
  severity: 5
  selector:
    matchLabels:
      app: mysql
  file:
    matchDirectories:
      - dir: /var/lib/mysql/
        recursive: true
  action: Audit 

After applying Policy:

After Applying Policy we can get audit logs related to file or folder access by someone.

mke-7

Logs:

mke-8

WordPress Config.php file block policy:

Before Applying Policy:

mke-9

Applying KubeArmor policy to block access to wp-config file:

The following policy denies access to wp-config.php file.

apiVersion: security.kubearmor.com/v1
kind: KubeArmorPolicy
metadata:
  name: ksp-wordpress-block-config
  namespace: wordpress-mysql
spec:
  severity: 10
  selector:
    matchLabels:
      app: wordpress
  file:
    matchPaths:
      - path: /var/www/html/wp-config.php
        fromSource:
          - path: /bin/cat
  action: Block

After applying Policy:

After Applying KubeArmor policy wp-config.php file cannot be accessed.

mke-10

Logs:

mke-11

@Ankurk99
Copy link
Member

Hey @AshokAccuknox the screenshots you sent doesn't contain the corresponding logs (PolicyName is shown as DefaultPosture instead of the actual name). Do we have more logs for the same policy rule violation containing the policy name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants