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

Policy name is not matching in the logs; instead, we see it as Defaultposture #1692

Open
janavenkat opened this issue Mar 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@janavenkat
Copy link

Bug Report

General Information

To Reproduce

  1. Deploy this sample policy
apiVersion: security.kubearmor.com/v1
kind: KubeArmorPolicy
metadata:
  name: restricted-policy
  namespace: test
spec:
  severity: 7
  selector:
    matchLabels:
      repository: test
  file:
    matchDirectories:
      - dir: /
        recursive: true
        fromSource:
          - path: /usr/local/bin/test
        action:
          Block

      - dir: / 
        recursive: true

      - dir: /tmp/
        recursive: true
        fromSource:
          - path: /usr/local/bin/test

      - dir: /dev/pts/
        recursive: true
        fromSource:
          - path: /usr/local/bin/test

   Action: Allow
  1. Access the restricted path

Expected behavior

In the logs, we should expect to see the blocked policy name, but instead, we're getting 'DefaultPosture'

{
  "Action": "Block",
  "container_name": "kubearmor-relay-server",
  "Data": "lsm=FILE_OPEN",
  "Enforcer": "BPFLSM",
  "Operation": "File",
  "ParentProcessName": "/usr/local/bin/test",
  "pod_name": "kubearmor-relay-67bcdcbf55-sh7lz",
  "PolicyName": "DefaultPosture",
  "ProcessName": "/usr/local/bin/test",
  "Resource": "/usr/bin/dash",
  "Result": "Permission denied",
  "Source": "/usr/local/bin/test",
  "Type": "MatchedPolicy"
}
@janavenkat janavenkat added the bug Something isn't working label Mar 18, 2024
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
Status: Triage
Development

No branches or pull requests

1 participant