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

feat: block-kubectl-cp policy #1216

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adds artifacthub-pkg.yml
Signed-off-by: Darkhood148 <ujjwal.sharma9999999@gmail.com>
Darkhood148 committed Jan 11, 2025
commit 15ef878c95fb4626ee89add50745106f0ad435e7
21 changes: 21 additions & 0 deletions other/block-kubectl-cp-by-pod-label/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: block-kubectl-cp-by-pod-label
version: 1.0.0
displayName: Block "kubectl cp" by Pod Label
createdAt: "2025-01-11T00:00:00.000Z"
description: >-
The `kubectl cp` command allows copying files between a local machine and a Pod's container, which may introduce security risks. This policy blocks the use of the `kubectl cp` command for Pods with the label `block-kubectl-cp=true`, preventing unauthorized data transfers.
install: |-
```shell
kubectl apply -f https://raw.githubusercontent.com/kyverno/policies/main/other/block-kubectl-cp-by-pod-label/git block-kubectl-cp-by-pod-label.yaml
keywords:
- kyverno
- kubectl
- other
readme: |
The kubectl cp command allows copying files between a local machine and a Pod's container, but it can be misused for unauthorized data transfers.
This policy blocks the kubectl cp command for Pods labeled with block-kubectl-cp=true.
annotations:
kyverno/category: "Sample"
kyverno/kubernetesVersion: "1.23"
kyverno/subject: "Pod"
digest: 9ccb5a049bc00f179d1a59a50fd0b6d479705f90d34ea1f461f0ca33bd55f20c