Configures Kubernetes RBAC roles and bindings with can-i verification, manages AWS IAM policies with permission simulation, and validates role-based access patterns for API endpoints.
Agentic Workflow: Read -> Reason -> Act (authorization)
You are Authorization (api/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — api context for authorization
- Domain: Configures Kubernetes RBAC roles and bindings with can-i verification, manages AWS IAM policies with permission simulation, and validates role-based access patterns for API endpoints.
- kubernetes-rbac: Create and test RBAC roles and bindings. —
kubectl create role reader --verb=get,list --resource=pods
- aws-iam: Manage IAM policies, roles, and verify effective permissions. —
aws iam attach-user-policy --user-name deploy-bot --policy-arn arn:aws:iam::aws:
- design-patterns: Design RBAC/ABAC models with verification checks. —
curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $ADMIN" https
- Check
knowledge and prerequisites: aws, kubectl, mysql
2. Reason — think for authorization
- For
kubernetes-rbac: Create and test RBAC roles and bindings. — decide which checks to run
- For
aws-iam: Manage IAM policies, roles, and verify effective permissions. — decide which checks to run
- For
design-patterns: Design RBAC/ABAC models with verification checks. — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with authorization tools
- Tools:
Glob, Grep, Read, Bash, Aws (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
authorization:e6838cb8
Authorization
What this skill does
Implements authorization for APIs and platforms: Kubernetes RBAC roles/bindings with can-i verification, AWS IAM policy attachment and permission simulation, and role-based access control design patterns.
When to use
- A user/team needs least-privilege access on a cluster or AWS account
- Verifying that a role can (or cannot) perform an action
- Designing role hierarchies for an API
Real commands
# Kubernetes RBAC
kubectl create role reader --verb=get,list --resource=pods
kubectl create rolebinding reader-binding --role=reader --user=jane
kubectl auth can-i get pods --as=jane
kubectl auth can-i delete pods --as=jane
# AWS IAM
aws iam attach-user-policy --user-name deploy-bot --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess
aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/deploy-bot --action-names s3:GetObject --resource-arns arn:aws:s3:::my-bucket/*
# API role checks
curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $USER" https://api.your-app.test/v1/admin
Testing
- Use kubectl auth can-i --as= for every role change
- Use iam simulate-principal-policy before granting access
- Probe endpoints as each role and assert status codes
Best practices
- Least privilege: start deny-all, grant narrowly
- Use groups over individual users
- Review policy grants quarterly; revoke stale ones
Capabilities
kubernetes-rbac
Create and test RBAC roles and bindings.
Parameters:
verb (string): get, list, watch, create, update, delete
resource (string): Resource or resource/subresource
user (string): User/group to bind or impersonate
Commands:
kubectl create role reader --verb=get,list --resource=pods
kubectl create rolebinding reader-binding --role=reader --user=jane
kubectl auth can-i get pods --as=jane
kubectl auth can-i delete pods --as=jane
kubectl get role,rolebinding
Examples:
- kubectl create clusterrole metrics-reader --verb=get --resource=nodes/stats
- kubectl auth can-i list pods --as=jane --namespace=prod
- kubectl create rolebinding dev-binding --clusterrole=view --group=devs -n dev
aws-iam
Manage IAM policies, roles, and verify effective permissions.
Parameters:
principal_arn (string): User/role ARN to simulate
actions (string): Space-separated action names
resources (string): Resource ARNs to test
Commands:
aws iam attach-user-policy --user-name deploy-bot --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess
aws iam list-attached-policies --user-name deploy-bot
aws iam get-policy-version --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess --version-id v1
aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/deploy-bot --action-names s3:GetObject --resource-arns arn:aws:s3:::my-bucket/*
aws iam list-policies --scope Local
Examples:
- aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/deploy-bot --action-names s3:PutObject s3:DeleteObject --resource-arns arn:aws:s3:::my-bucket/* | jq '.EvaluationResults[].EvalDecision'
- aws iam get-account-authorization-details --filter Role | jq '.RoleDetailList[].RoleName'
- aws iam attach-role-policy --role-name api-role --policy-arn arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs
design-patterns
Design RBAC/ABAC models with verification checks.
Parameters:
role (string): Role being tested
endpoint (string): Endpoint to probe
Commands:
curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $ADMIN" https://api.your-app.test/v1/admin
curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $USER" https://api.your-app.test/v1/admin
curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $USER" https://api.your-app.test/v1/me
mysql -e "SHOW GRANTS FOR 'app'@'%'"
Examples:
References
1---2name: "authorization"3description: "Configures Kubernetes RBAC roles and bindings with can-i verification, manages AWS IAM policies with permission simulation, and validates role-based access patterns for API endpoints. Use when working with kubernetes rbac, aws iam, design patterns, api or when the user mentions kubernetes rbac, aws iam, design patterns, api."4license: "MIT"5compatibility: "Requires aws, kubectl, mysql. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/authorization8 author: Kdesk9 version: 2.0.010 category: api11allowed-tools: "Glob Grep Read Bash(aws:*) Bash(curl:*) Bash(kubectl:*) Bash(mysql:*)"12---1314Configures Kubernetes RBAC roles and bindings with can-i verification, manages AWS IAM policies with permission simulation, and validates role-based access patterns for API endpoints.1516## Agentic Workflow: Read -> Reason -> Act (authorization)1718You are **Authorization** (api/general) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — api context for `authorization`21- Domain: Configures Kubernetes RBAC roles and bindings with can-i verification, manages AWS IAM policies with permission simulation, and validates role-based access patterns for API endpoints.22- **kubernetes-rbac**: Create and test RBAC roles and bindings. — `kubectl create role reader --verb=get,list --resource=pods`23- **aws-iam**: Manage IAM policies, roles, and verify effective permissions. — `aws iam attach-user-policy --user-name deploy-bot --policy-arn arn:aws:iam::aws:`24- **design-patterns**: Design RBAC/ABAC models with verification checks. — `curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $ADMIN" https`25- Check `knowledge` and `prerequisites: aws, kubectl, mysql`2627### 2. Reason — think for `authorization`28- For `kubernetes-rbac`: Create and test RBAC roles and bindings. — decide which checks to run29- For `aws-iam`: Manage IAM policies, roles, and verify effective permissions. — decide which checks to run30- For `design-patterns`: Design RBAC/ABAC models with verification checks. — decide which checks to run31- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3233### 3. Act — execute with `authorization` tools34- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Aws` (see frontmatter `tools`/`allowed-tools`)35- Use `safe_path` for any write; record evidence (paths, checksums)36- Fingerprint: `authorization:e6838cb8`3738# Authorization3940## What this skill does4142Implements authorization for APIs and platforms: Kubernetes RBAC roles/bindings with can-i verification, AWS IAM policy attachment and permission simulation, and role-based access control design patterns.4344## When to use4546- A user/team needs least-privilege access on a cluster or AWS account47- Verifying that a role can (or cannot) perform an action48- Designing role hierarchies for an API4950## Real commands5152```bash53# Kubernetes RBAC54kubectl create role reader --verb=get,list --resource=pods55kubectl create rolebinding reader-binding --role=reader --user=jane56kubectl auth can-i get pods --as=jane57kubectl auth can-i delete pods --as=jane5859# AWS IAM60aws iam attach-user-policy --user-name deploy-bot --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess61aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/deploy-bot --action-names s3:GetObject --resource-arns arn:aws:s3:::my-bucket/*6263# API role checks64curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $USER" https://api.your-app.test/v1/admin65```6667## Testing6869- Use kubectl auth can-i --as=<user> for every role change70- Use iam simulate-principal-policy before granting access71- Probe endpoints as each role and assert status codes7273## Best practices7475- Least privilege: start deny-all, grant narrowly76- Use groups over individual users77- Review policy grants quarterly; revoke stale ones7879## Capabilities8081### kubernetes-rbac82Create and test RBAC roles and bindings.8384**Parameters:**85- `verb` (string): get, list, watch, create, update, delete86- `resource` (string): Resource or resource/subresource87- `user` (string): User/group to bind or impersonate8889**Commands:**90- `kubectl create role reader --verb=get,list --resource=pods`91- `kubectl create rolebinding reader-binding --role=reader --user=jane`92- `kubectl auth can-i get pods --as=jane`93- `kubectl auth can-i delete pods --as=jane`94- `kubectl get role,rolebinding`9596**Examples:**97- kubectl create clusterrole metrics-reader --verb=get --resource=nodes/stats98- kubectl auth can-i list pods --as=jane --namespace=prod99- kubectl create rolebinding dev-binding --clusterrole=view --group=devs -n dev100101### aws-iam102Manage IAM policies, roles, and verify effective permissions.103104**Parameters:**105- `principal_arn` (string): User/role ARN to simulate106- `actions` (string): Space-separated action names107- `resources` (string): Resource ARNs to test108109**Commands:**110- `aws iam attach-user-policy --user-name deploy-bot --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess`111- `aws iam list-attached-policies --user-name deploy-bot`112- `aws iam get-policy-version --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess --version-id v1`113- `aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/deploy-bot --action-names s3:GetObject --resource-arns arn:aws:s3:::my-bucket/*`114- `aws iam list-policies --scope Local`115116**Examples:**117- aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/deploy-bot --action-names s3:PutObject s3:DeleteObject --resource-arns arn:aws:s3:::my-bucket/* | jq '.EvaluationResults[].EvalDecision'118- aws iam get-account-authorization-details --filter Role | jq '.RoleDetailList[].RoleName'119- aws iam attach-role-policy --role-name api-role --policy-arn arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs120121### design-patterns122Design RBAC/ABAC models with verification checks.123124**Parameters:**125- `role` (string): Role being tested126- `endpoint` (string): Endpoint to probe127128**Commands:**129- `curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $ADMIN" https://api.your-app.test/v1/admin`130- `curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $USER" https://api.your-app.test/v1/admin`131- `curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $USER" https://api.your-app.test/v1/me`132- `mysql -e "SHOW GRANTS FOR 'app'@'%'"`133134**Examples:**135- curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $USER" https://api.your-app.test/v1/other-user-resource136- mysql -e "SHOW GRANTS FOR 'readonly'@'%'"137- kubectl auth can-i --list --as=ci-bot138139## References140- [Kubernetes RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)141- [AWS IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/)142- [OWASP AuthZ Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html)