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

Hardening policies only getting generated for deployments #670

Closed
vishnusomank opened this issue Feb 14, 2023 · 0 comments · Fixed by #681
Closed

Hardening policies only getting generated for deployments #670

vishnusomank opened this issue Feb 14, 2023 · 0 comments · Fixed by #681
Assignees
Labels
bug Something isn't working

Comments

@vishnusomank
Copy link
Contributor

Problem Statement:

The discovery engine is not able to recommend hardening policies if the pods are generated through a statefulset or a replicaset. With the current implementation the discovery engine checks for all deployments in the Kubernetes cluster and generates the recommended/hardening policies.

Steps to reproduce the issue:

  1. Create a k3s cluster
  2. Install karmor cli
    curl -sfL http://get.kubearmor.io/ | sudo sh -s -- -b /usr/local/bin
    
  3. Install kubearmor
    karmor install
    
  4. Deploy frontend pod using replicaset
    kubectl create ns rs-demo
    echo "
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
      name: frontend
      labels:
        app: guestbook
        tier: frontend
    spec:
      # modify replicas according to your case
      replicas: 3
      selector:
        matchLabels:
          tier: frontend
      template:
        metadata:
          labels:
            tier: frontend
        spec:
          containers:
          - name: php-redis
            image: gcr.io/google_samples/gb-frontend:v3 " | kubectl -n rs-demo apply -f- 
    
  5. use karmor recommend to generate hardening policy
    karmor recommend -n rs-demo
    

The default output folder out will be empty, meaning no policies generated for the pods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants