一键导入
user-isolation-enforcer
enforce user isolation, filter by user_id, prevent data leak in query, multi-user task filter, always add WHERE user_id
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
enforce user isolation, filter by user_id, prevent data leak in query, multi-user task filter, always add WHERE user_id
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate Helm 3+ chart structure for todo/task applications. Use for: creating Chart.yaml, values.yaml, and templates/ directory with Deployment and Service manifests. Triggers: "helm chart", "helm template", "helm values", "create helm chart", "helm install", "helm upgrade", "package as helm chart". NOT for: plain Kubernetes YAML (use kubernetes-yaml-best-practices), Kustomize, or kubectl commands. NOT for: CRDs, hooks, subcharts, or advanced Helm features unless explicitly requested.
Apply Kubernetes pod security hardening with securityContext, Pod Security Standards, and container isolation. Use for: adding runAsNonRoot, readOnlyRootFilesystem, dropping capabilities, seccomp profiles, and privilege escalation prevention. Triggers: "secure pod", "pod security", "non-root container", "security context", "k8s security", "harden deployment", "pod security standards", "restricted PSS". NOT for: NetworkPolicies, RBAC, Secrets management, or service mesh security. Use alongside kubernetes-yaml-best-practices for complete manifests.
Generate production-ready Kubernetes YAML manifests following best practices. Use when creating or reviewing: Deployments, Services, ConfigMaps, Secrets, Ingress, PersistentVolumeClaims, or any k8s resource YAML. Triggers: "kubernetes manifest", "deployment yaml", "service yaml", "write k8s resource", "create kubernetes", "k8s yaml", "pod spec", "container spec". NOT for Helm charts, Kustomize overlays, or kubectl commands.
Deploy and test applications on local Minikube Kubernetes cluster. Use for: loading local Docker images to Minikube, exposing services locally via port-forward or minikube service, debugging pods (logs, describe, exec), troubleshooting CrashLoopBackOff/ImagePullBackOff errors. Triggers: "deploy to minikube", "minikube image load", "port-forward", "minikube service", "debug pod", "why is pod crashing", "minikube dashboard", "local kubernetes testing". NOT for: minikube installation, minikube start/stop, cloud Kubernetes, Helm charts, or writing YAML manifests (use kubernetes-yaml-best-practices for YAML).
OCI & OKE specialist for the Todo app hackathon project. Provides infrastructure context, authentication patterns, and deployment guidance for Oracle Kubernetes Engine in me-dubai-1. Use when working with: OKE cluster operations, kubectl commands, oci CLI, Helm deploys to OKE, Dapr/Kafka on OKE, Ingress/LoadBalancer setup, Kubernetes secrets, cloud deployment, OCI networking, node pool management, or troubleshooting OKE auth errors. Triggers: "OKE", "oci", "kubectl", "deploy to cloud", "cluster", "OCI", "oracle kubernetes", "ingress on OKE", "secrets on OKE", "Dapr on OKE", "Kafka on OKE", "node pool", "DOKS alternative".
Dapr service invocation pattern for FastAPI Todo app. Use DaprClient.invoke_method to call other services with user_id propagated via metadata. Use when implementing service-to-service communication in FastAPI applications with user context propagation.
| name | user-isolation-enforcer |
| description | enforce user isolation, filter by user_id, prevent data leak in query, multi-user task filter, always add WHERE user_id |
This skill enforces user isolation in database queries by ensuring every query involving user data includes proper user_id filtering. It prevents data leaks by mandating WHERE clauses that restrict results to the current authenticated user.
In EVERY database query involving tasks or user-related data, automatically add the filter:
.where(Model.user_id == current_user.id)
Use this pattern for all database operations:
from sqlmodel import select
from your_models import Task
# CORRECT - Includes user_id filter
results = session.exec(
select(Task)
.where(Task.user_id == current_user.id)
).all()
# INCORRECT - Missing user_id filter (will cause data leak)
results = session.exec(select(Task)).all() # DON'T DO THIS
def list_user_tasks(session, current_user):
return session.exec(
select(Task)
.where(Task.user_id == current_user.id)
).all()
def get_user_task(session, task_id, current_user):
return session.exec(
select(Task)
.where(Task.user_id == current_user.id)
.where(Task.id == task_id)
).first()
def update_user_task(session, task_id, update_data, current_user):
task = session.exec(
select(Task)
.where(Task.user_id == current_user.id)
.where(Task.id == task_id)
).first()
if not task:
raise HTTPException(status_code=404, detail="Task not found")
# Update task...
session.add(task)
session.commit()
def delete_user_task(session, task_id, current_user):
task = session.exec(
select(Task)
.where(Task.user_id == current_user.id)
.where(Task.id == task_id)
).first()
if not task:
raise HTTPException(status_code=404, detail="Task not found")
session.delete(task)
session.commit()
⚠️ Data leak here would violate multi-user isolation - Always verify that every query includes proper user_id filtering to prevent unauthorized access to other users' data.
Before executing any database query:
Model.user_id == current_user.idIf you see code without proper user filtering:
.where(Model.user_id == current_user.id) to the queryNever return data from other users - Every query must be scoped to the current authenticated user to maintain proper multi-user isolation.