[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6Q0FA5FZ410Z33Z3TFQ4DBA":3,"skill-same:01M6Q0FA5FZ410Z33Z3TFQ4DBA":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":33,"commitSha":56,"skillDirectory":57,"forksCount":13,"repositoryHtmlUrl":58,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":60,"install":61,"resources":74},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust",null,"Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,5,40,41],"ZeRO","zero trust","trust","implementing","architecture","relevant","scripts","scope","critical","active","main","community","only","configure","access","devops-security","segmentation","verification","assessment","2026-11-10 10:12:30",false,"---\nname: zero-trust\ndescription: Implement zero-trust network architecture. Configure identity-based access,\n  micro-segmentation, and continuous verification. Use when implementing modern security\n  architectures.\ncategory: security\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\nsource_repo: BagelHole\u002FDevOps-Security-Agent-Skills\nsource_type: community\ndate_added: '2026-09-20'\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE\ncompatibility: Requires the relevant security tooling (scanners, vault CLIs) and an\n  authorized scope for any active assessment. Docs-only; helper scripts and templates\n  not bundled.\nmetadata:\n  author: devops-skills\n  version: '1.0'\n---\n\n# Zero Trust Architecture\n\nImplement \"never trust, always verify\" security model.\n\n## When to Use This Skill\n\nUse this skill when:\n- Replacing traditional perimeter-based VPN access models\n- Implementing BeyondCorp-style access to internal applications\n- Securing multi-cloud or hybrid-cloud environments\n- Enforcing identity-based access for every service interaction\n- Meeting compliance requirements for continuous verification and least privilege\n- Adopting micro-segmentation for Kubernetes or cloud workloads\n\n## Prerequisites\n\n- Identity provider (IdP) supporting OIDC\u002FSAML (Okta, Azure AD, Google Workspace)\n- Service mesh or proxy infrastructure (Istio, Envoy, Cloudflare Access)\n- Device management\u002FMDM solution for device posture checks\n- Kubernetes cluster for workload-level examples\n- Understanding of mTLS, RBAC, and network policies\n\n## Core Principles\n\n```yaml\nzero_trust_principles:\n  verify_explicitly:\n    description: \"Authenticate and authorize every access request\"\n    controls:\n      - Strong multi-factor authentication\n      - Identity-aware proxy for all applications\n      - Service-to-service mTLS\n      - API token validation on every request\n\n  least_privilege:\n    description: \"Grant minimum access needed for the task\"\n    controls:\n      - Just-in-time (JIT) access provisioning\n      - Time-bounded access grants\n      - Role-based access with fine-grained permissions\n      - Regular access reviews and certification\n\n  assume_breach:\n    description: \"Design systems expecting compromise has occurred\"\n    controls:\n      - Micro-segmentation between all services\n      - End-to-end encryption (data in transit and at rest)\n      - Continuous monitoring and anomaly detection\n      - Blast radius containment\n```\n\n## BeyondCorp Implementation\n\n### Cloudflare Access Configuration\n\n```bash\n# Create an Access application for an internal service\ncurl -X POST \"https:\u002F\u002Fapi.cloudflare.com\u002Fclient\u002Fv4\u002Faccounts\u002F${ACCOUNT_ID}\u002Faccess\u002Fapps\" \\\n  -H \"Authorization: Bearer ${CF_TOKEN}\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Internal Dashboard\",\n    \"domain\": \"dashboard.internal.example.com\",\n    \"type\": \"self_hosted\",\n    \"session_duration\": \"12h\",\n    \"auto_redirect_to_identity\": true,\n    \"allowed_idps\": [\"google-workspace-idp-id\"]\n  }'\n\n# Create an Access policy\ncurl -X POST \"https:\u002F\u002Fapi.cloudflare.com\u002Fclient\u002Fv4\u002Faccounts\u002F${ACCOUNT_ID}\u002Faccess\u002Fapps\u002F${APP_ID}\u002Fpolicies\" \\\n  -H \"Authorization: Bearer ${CF_TOKEN}\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Engineering team access\",\n    \"decision\": \"allow\",\n    \"include\": [\n      { \"group\": { \"id\": \"engineering-group-id\" } }\n    ],\n    \"require\": [\n      { \"login_method\": { \"id\": \"google-workspace-idp-id\" } }\n    ],\n    \"exclude\": [\n      { \"geo\": { \"country_code\": \"KP\" } }\n    ]\n  }'\n\n# Create a device posture rule\ncurl -X POST \"https:\u002F\u002Fapi.cloudflare.com\u002Fclient\u002Fv4\u002Faccounts\u002F${ACCOUNT_ID}\u002Fdevices\u002Fposture\" \\\n  -H \"Authorization: Bearer ${CF_TOKEN}\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Require disk encryption\",\n    \"type\": \"disk_encryption\",\n    \"match\": { \"platform\": \"linux\" },\n    \"schedule\": \"1h\",\n    \"input\": { \"requireAll\": true }\n  }'\n```\n\n### Cloudflare Access Terraform\n\n```hcl\nresource \"cloudflare_access_application\" \"dashboard\" {\n  account_id       = var.cloudflare_account_id\n  name             = \"Internal Dashboard\"\n  domain           = \"dashboard.internal.example.com\"\n  type             = \"self_hosted\"\n  session_duration = \"12h\"\n\n  auto_redirect_to_identity = true\n}\n\nresource \"cloudflare_access_policy\" \"engineering\" {\n  account_id     = var.cloudflare_account_id\n  application_id = cloudflare_access_application.dashboard.id\n  name           = \"Engineering team\"\n  precedence     = 1\n  decision       = \"allow\"\n\n  include {\n    group = [cloudflare_access_group.engineering.id]\n  }\n\n  require {\n    login_method = [var.google_idp_id]\n  }\n}\n\nresource \"cloudflare_access_group\" \"engineering\" {\n  account_id = var.cloudflare_account_id\n  name       = \"Engineering\"\n\n  include {\n    email_domain = [\"example.com\"]\n  }\n\n  require {\n    group = [\"engineering@example.com\"]\n  }\n}\n```\n\n## Identity-Aware Proxy with OAuth2 Proxy\n\n```yaml\n# oauth2-proxy deployment for protecting internal services\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: oauth2-proxy\n  namespace: auth\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: oauth2-proxy\n  template:\n    metadata:\n      labels:\n        app: oauth2-proxy\n    spec:\n      containers:\n        - name: oauth2-proxy\n          image: quay.io\u002Foauth2-proxy\u002Foauth2-proxy:v7.6.0\n          args:\n            - --provider=oidc\n            - --oidc-issuer-url=https:\u002F\u002Faccounts.google.com\n            - --client-id=$(CLIENT_ID)\n            - --client-secret=$(CLIENT_SECRET)\n            - --email-domain=example.com\n            - --upstream=http:\u002F\u002Finternal-service.default.svc:8080\n            - --http-address=0.0.0.0:4180\n            - --cookie-secret=$(COOKIE_SECRET)\n            - --cookie-secure=true\n            - --cookie-httponly=true\n            - --cookie-samesite=lax\n            - --set-xauthrequest=true\n            - --pass-access-token=true\n            - --skip-provider-button=true\n            - --session-store-type=redis\n            - --redis-connection-url=redis:\u002F\u002Fredis.auth.svc:6379\n          env:\n            - name: CLIENT_ID\n              valueFrom:\n                secretKeyRef:\n                  name: oauth2-proxy\n                  key: client-id\n            - name: CLIENT_SECRET\n              valueFrom:\n                secretKeyRef:\n                  name: oauth2-proxy\n                  key: client-secret\n            - name: COOKIE_SECRET\n              valueFrom:\n                secretKeyRef:\n                  name: oauth2-proxy\n                  key: cookie-secret\n          ports:\n            - containerPort: 4180\n---\n# Ingress routing through oauth2-proxy\napiVersion: networking.k8s.io\u002Fv1\nkind: Ingress\nmetadata:\n  name: internal-service\n  annotations:\n    nginx.ingress.kubernetes.io\u002Fauth-url: \"https:\u002F\u002Fauth.example.com\u002Foauth2\u002Fauth\"\n    nginx.ingress.kubernetes.io\u002Fauth-signin: \"https:\u002F\u002Fauth.example.com\u002Foauth2\u002Fstart?rd=$scheme:\u002F\u002F$host$request_uri\"\n    nginx.ingress.kubernetes.io\u002Fauth-response-headers: \"X-Auth-Request-User,X-Auth-Request-Email\"\nspec:\n  rules:\n    - host: dashboard.example.com\n      http:\n        paths:\n          - path: \u002F\n            pathType: Prefix\n            backend:\n              service:\n                name: internal-service\n                port:\n                  number: 8080\n```\n\n## Service Mesh mTLS (Istio)\n\n```yaml\n# Enforce strict mTLS across the mesh\napiVersion: security.istio.io\u002Fv1beta1\nkind: PeerAuthentication\nmetadata:\n  name: default\n  namespace: istio-system\nspec:\n  mtls:\n    mode: STRICT\n---\n# Authorization policy: frontend can call backend\napiVersion: security.istio.io\u002Fv1beta1\nkind: AuthorizationPolicy\nmetadata:\n  name: backend-access\n  namespace: default\nspec:\n  selector:\n    matchLabels:\n      app: backend\n  action: ALLOW\n  rules:\n    - from:\n        - source:\n            principals: [\"cluster.local\u002Fns\u002Fdefault\u002Fsa\u002Ffrontend\"]\n      to:\n        - operation:\n            methods: [\"GET\", \"POST\"]\n            paths: [\"\u002Fapi\u002F*\"]\n---\n# Default deny all in namespace\napiVersion: security.istio.io\u002Fv1beta1\nkind: AuthorizationPolicy\nmetadata:\n  name: deny-all\n  namespace: production\nspec: {}\n```\n\n## Micro-Segmentation with Kubernetes Network Policies\n\n```yaml\n# Default deny all traffic in namespace\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: default-deny-all\n  namespace: production\nspec:\n  podSelector: {}\n  policyTypes:\n    - Ingress\n    - Egress\n---\n# Allow DNS resolution for all pods\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: allow-dns\n  namespace: production\nspec:\n  podSelector: {}\n  policyTypes:\n    - Egress\n  egress:\n    - to: []\n      ports:\n        - protocol: UDP\n          port: 53\n        - protocol: TCP\n          port: 53\n---\n# Frontend: allow ingress from ingress controller, egress to backend\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: frontend-policy\n  namespace: production\nspec:\n  podSelector:\n    matchLabels:\n      app: frontend\n  policyTypes:\n    - Ingress\n    - Egress\n  ingress:\n    - from:\n        - namespaceSelector:\n            matchLabels:\n              name: ingress-nginx\n      ports:\n        - protocol: TCP\n          port: 8080\n  egress:\n    - to:\n        - podSelector:\n            matchLabels:\n              app: backend\n      ports:\n        - protocol: TCP\n          port: 8080\n---\n# Database: allow from backend only, no egress\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: database-policy\n  namespace: production\nspec:\n  podSelector:\n    matchLabels:\n      app: database\n  policyTypes:\n    - Ingress\n    - Egress\n  ingress:\n    - from:\n        - podSelector:\n            matchLabels:\n              app: backend\n      ports:\n        - protocol: TCP\n          port: 5432\n```\n\n## OPA Policy for Access Decisions\n\n```rego\n# policy.rego - Zero trust access decision\npackage zerotrust.access\n\nimport rego.v1\n\ndefault allow := false\n\nallow if {\n    identity_verified\n    device_compliant\n    authorized_for_resource\n    risk_acceptable\n}\n\nidentity_verified if {\n    input.identity.authenticated == true\n    input.identity.mfa_verified == true\n    time.now_ns() \u003C input.identity.session_expires_ns\n}\n\ndevice_compliant if {\n    input.device.encryption_enabled == true\n    input.device.os_updated == true\n    input.device.firewall_enabled == true\n    input.device.certificate_valid == true\n}\n\nauthorized_for_resource if {\n    some role in input.identity.roles\n    some permission in data.role_permissions[role]\n    permission == input.resource.required_permission\n}\n\nrisk_acceptable if {\n    input.risk.score \u003C 70\n    not input.risk.active_threat\n}\n\nstep_up_required if {\n    input.risk.score >= 50\n    input.risk.score \u003C 70\n    not input.identity.recent_mfa\n}\n```\n\n## Implementation Steps\n\n1. **Inventory assets and data flows** - Map every application, service, and data store\n2. **Deploy identity provider** - Centralize authentication with SSO and MFA\n3. **Implement identity-aware proxy** - Route all access through authentication layer\n4. **Enable mTLS for service mesh** - Encrypt and authenticate all service communication\n5. **Apply network policies** - Default deny with explicit allow rules\n6. **Add device posture checks** - Verify device compliance before granting access\n7. **Deploy continuous monitoring** - Log and analyze all access decisions\n8. **Iterate and refine** - Review policies based on monitoring data\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| Users cannot access internal apps | Identity provider misconfigured | Verify OIDC\u002FSAML settings; check redirect URIs |\n| mTLS connections failing | Certificate expired or wrong CA | Check cert expiry with `istioctl proxy-config secret`; verify CA chain |\n| Network policy blocking legitimate traffic | Missing egress or ingress rule | Use `kubectl describe networkpolicy`; verify pod labels match selectors |\n| Device posture check fails | MDM agent not reporting | Verify device agent is running; check compliance dashboard |\n| OAuth2 proxy returns 403 | User email domain not in allow-list | Add domain to `--email-domain` flag or update group membership |\n\n## Related Skills\n\n- service-mesh (`service-mesh`) - mTLS implementation\n- kubernetes-hardening (`kubernetes-hardening`) - K8s security\n- vpn-setup (`vpn-setup`) - Traditional VPN (contrast with zero trust)\n\n## Limitations\n\n- Apply guidance only within authorized scope; test destructive steps in non-production first.\n- Docs-only import: upstream scripts and templates not bundled.\n\n### Example\n\n```bash\n# Read-only first: inventory before any active step.\nwhich \u003Ctool> && \u003Ctool> --help | head -n 20\n```\n\n> Adapted from [BagelHole\u002FDevOps-Security-Agent-Skills](https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills) (MIT); frontmatter, When to Use\u002FLimitations, and safety boundaries added for upstream compliance. Docs-only import: helper scripts and templates not bundled.\n","# Zero Trust Architecture\n\nImplement \"never trust, always verify\" security model.\n\n## When to Use This Skill\n\nUse this skill when:\n- Replacing traditional perimeter-based VPN access models\n- Implementing BeyondCorp-style access to internal applications\n- Securing multi-cloud or hybrid-cloud environments\n- Enforcing identity-based access for every service interaction\n- Meeting compliance requirements for continuous verification and least privilege\n- Adopting micro-segmentation for Kubernetes or cloud workloads\n\n## Prerequisites\n\n- Identity provider (IdP) supporting OIDC\u002FSAML (Okta, Azure AD, Google Workspace)\n- Service mesh or proxy infrastructure (Istio, Envoy, Cloudflare Access)\n- Device management\u002FMDM solution for device posture checks\n- Kubernetes cluster for workload-level examples\n- Understanding of mTLS, RBAC, and network policies\n\n## Core Principles\n\n```yaml\nzero_trust_principles:\n  verify_explicitly:\n    description: \"Authenticate and authorize every access request\"\n    controls:\n      - Strong multi-factor authentication\n      - Identity-aware proxy for all applications\n      - Service-to-service mTLS\n      - API token validation on every request\n\n  least_privilege:\n    description: \"Grant minimum access needed for the task\"\n    controls:\n      - Just-in-time (JIT) access provisioning\n      - Time-bounded access grants\n      - Role-based access with fine-grained permissions\n      - Regular access reviews and certification\n\n  assume_breach:\n    description: \"Design systems expecting compromise has occurred\"\n    controls:\n      - Micro-segmentation between all services\n      - End-to-end encryption (data in transit and at rest)\n      - Continuous monitoring and anomaly detection\n      - Blast radius containment\n```\n\n## BeyondCorp Implementation\n\n### Cloudflare Access Configuration\n\n```bash\n# Create an Access application for an internal service\ncurl -X POST \"https:\u002F\u002Fapi.cloudflare.com\u002Fclient\u002Fv4\u002Faccounts\u002F${ACCOUNT_ID}\u002Faccess\u002Fapps\" \\\n  -H \"Authorization: Bearer ${CF_TOKEN}\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Internal Dashboard\",\n    \"domain\": \"dashboard.internal.example.com\",\n    \"type\": \"self_hosted\",\n    \"session_duration\": \"12h\",\n    \"auto_redirect_to_identity\": true,\n    \"allowed_idps\": [\"google-workspace-idp-id\"]\n  }'\n\n# Create an Access policy\ncurl -X POST \"https:\u002F\u002Fapi.cloudflare.com\u002Fclient\u002Fv4\u002Faccounts\u002F${ACCOUNT_ID}\u002Faccess\u002Fapps\u002F${APP_ID}\u002Fpolicies\" \\\n  -H \"Authorization: Bearer ${CF_TOKEN}\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Engineering team access\",\n    \"decision\": \"allow\",\n    \"include\": [\n      { \"group\": { \"id\": \"engineering-group-id\" } }\n    ],\n    \"require\": [\n      { \"login_method\": { \"id\": \"google-workspace-idp-id\" } }\n    ],\n    \"exclude\": [\n      { \"geo\": { \"country_code\": \"KP\" } }\n    ]\n  }'\n\n# Create a device posture rule\ncurl -X POST \"https:\u002F\u002Fapi.cloudflare.com\u002Fclient\u002Fv4\u002Faccounts\u002F${ACCOUNT_ID}\u002Fdevices\u002Fposture\" \\\n  -H \"Authorization: Bearer ${CF_TOKEN}\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Require disk encryption\",\n    \"type\": \"disk_encryption\",\n    \"match\": { \"platform\": \"linux\" },\n    \"schedule\": \"1h\",\n    \"input\": { \"requireAll\": true }\n  }'\n```\n\n### Cloudflare Access Terraform\n\n```hcl\nresource \"cloudflare_access_application\" \"dashboard\" {\n  account_id       = var.cloudflare_account_id\n  name             = \"Internal Dashboard\"\n  domain           = \"dashboard.internal.example.com\"\n  type             = \"self_hosted\"\n  session_duration = \"12h\"\n\n  auto_redirect_to_identity = true\n}\n\nresource \"cloudflare_access_policy\" \"engineering\" {\n  account_id     = var.cloudflare_account_id\n  application_id = cloudflare_access_application.dashboard.id\n  name           = \"Engineering team\"\n  precedence     = 1\n  decision       = \"allow\"\n\n  include {\n    group = [cloudflare_access_group.engineering.id]\n  }\n\n  require {\n    login_method = [var.google_idp_id]\n  }\n}\n\nresource \"cloudflare_access_group\" \"engineering\" {\n  account_id = var.cloudflare_account_id\n  name       = \"Engineering\"\n\n  include {\n    email_domain = [\"example.com\"]\n  }\n\n  require {\n    group = [\"engineering@example.com\"]\n  }\n}\n```\n\n## Identity-Aware Proxy with OAuth2 Proxy\n\n```yaml\n# oauth2-proxy deployment for protecting internal services\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: oauth2-proxy\n  namespace: auth\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: oauth2-proxy\n  template:\n    metadata:\n      labels:\n        app: oauth2-proxy\n    spec:\n      containers:\n        - name: oauth2-proxy\n          image: quay.io\u002Foauth2-proxy\u002Foauth2-proxy:v7.6.0\n          args:\n            - --provider=oidc\n            - --oidc-issuer-url=https:\u002F\u002Faccounts.google.com\n            - --client-id=$(CLIENT_ID)\n            - --client-secret=$(CLIENT_SECRET)\n            - --email-domain=example.com\n            - --upstream=http:\u002F\u002Finternal-service.default.svc:8080\n            - --http-address=0.0.0.0:4180\n            - --cookie-secret=$(COOKIE_SECRET)\n            - --cookie-secure=true\n            - --cookie-httponly=true\n            - --cookie-samesite=lax\n            - --set-xauthrequest=true\n            - --pass-access-token=true\n            - --skip-provider-button=true\n            - --session-store-type=redis\n            - --redis-connection-url=redis:\u002F\u002Fredis.auth.svc:6379\n          env:\n            - name: CLIENT_ID\n              valueFrom:\n                secretKeyRef:\n                  name: oauth2-proxy\n                  key: client-id\n            - name: CLIENT_SECRET\n              valueFrom:\n                secretKeyRef:\n                  name: oauth2-proxy\n                  key: client-secret\n            - name: COOKIE_SECRET\n              valueFrom:\n                secretKeyRef:\n                  name: oauth2-proxy\n                  key: cookie-secret\n          ports:\n            - containerPort: 4180\n---\n# Ingress routing through oauth2-proxy\napiVersion: networking.k8s.io\u002Fv1\nkind: Ingress\nmetadata:\n  name: internal-service\n  annotations:\n    nginx.ingress.kubernetes.io\u002Fauth-url: \"https:\u002F\u002Fauth.example.com\u002Foauth2\u002Fauth\"\n    nginx.ingress.kubernetes.io\u002Fauth-signin: \"https:\u002F\u002Fauth.example.com\u002Foauth2\u002Fstart?rd=$scheme:\u002F\u002F$host$request_uri\"\n    nginx.ingress.kubernetes.io\u002Fauth-response-headers: \"X-Auth-Request-User,X-Auth-Request-Email\"\nspec:\n  rules:\n    - host: dashboard.example.com\n      http:\n        paths:\n          - path: \u002F\n            pathType: Prefix\n            backend:\n              service:\n                name: internal-service\n                port:\n                  number: 8080\n```\n\n## Service Mesh mTLS (Istio)\n\n```yaml\n# Enforce strict mTLS across the mesh\napiVersion: security.istio.io\u002Fv1beta1\nkind: PeerAuthentication\nmetadata:\n  name: default\n  namespace: istio-system\nspec:\n  mtls:\n    mode: STRICT\n---\n# Authorization policy: frontend can call backend\napiVersion: security.istio.io\u002Fv1beta1\nkind: AuthorizationPolicy\nmetadata:\n  name: backend-access\n  namespace: default\nspec:\n  selector:\n    matchLabels:\n      app: backend\n  action: ALLOW\n  rules:\n    - from:\n        - source:\n            principals: [\"cluster.local\u002Fns\u002Fdefault\u002Fsa\u002Ffrontend\"]\n      to:\n        - operation:\n            methods: [\"GET\", \"POST\"]\n            paths: [\"\u002Fapi\u002F*\"]\n---\n# Default deny all in namespace\napiVersion: security.istio.io\u002Fv1beta1\nkind: AuthorizationPolicy\nmetadata:\n  name: deny-all\n  namespace: production\nspec: {}\n```\n\n## Micro-Segmentation with Kubernetes Network Policies\n\n```yaml\n# Default deny all traffic in namespace\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: default-deny-all\n  namespace: production\nspec:\n  podSelector: {}\n  policyTypes:\n    - Ingress\n    - Egress\n---\n# Allow DNS resolution for all pods\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: allow-dns\n  namespace: production\nspec:\n  podSelector: {}\n  policyTypes:\n    - Egress\n  egress:\n    - to: []\n      ports:\n        - protocol: UDP\n          port: 53\n        - protocol: TCP\n          port: 53\n---\n# Frontend: allow ingress from ingress controller, egress to backend\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: frontend-policy\n  namespace: production\nspec:\n  podSelector:\n    matchLabels:\n      app: frontend\n  policyTypes:\n    - Ingress\n    - Egress\n  ingress:\n    - from:\n        - namespaceSelector:\n            matchLabels:\n              name: ingress-nginx\n      ports:\n        - protocol: TCP\n          port: 8080\n  egress:\n    - to:\n        - podSelector:\n            matchLabels:\n              app: backend\n      ports:\n        - protocol: TCP\n          port: 8080\n---\n# Database: allow from backend only, no egress\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: database-policy\n  namespace: production\nspec:\n  podSelector:\n    matchLabels:\n      app: database\n  policyTypes:\n    - Ingress\n    - Egress\n  ingress:\n    - from:\n        - podSelector:\n            matchLabels:\n              app: backend\n      ports:\n        - protocol: TCP\n          port: 5432\n```\n\n## OPA Policy for Access Decisions\n\n```rego\n# policy.rego - Zero trust access decision\npackage zerotrust.access\n\nimport rego.v1\n\ndefault allow := false\n\nallow if {\n    identity_verified\n    device_compliant\n    authorized_for_resource\n    risk_acceptable\n}\n\nidentity_verified if {\n    input.identity.authenticated == true\n    input.identity.mfa_verified == true\n    time.now_ns() \u003C input.identity.session_expires_ns\n}\n\ndevice_compliant if {\n    input.device.encryption_enabled == true\n    input.device.os_updated == true\n    input.device.firewall_enabled == true\n    input.device.certificate_valid == true\n}\n\nauthorized_for_resource if {\n    some role in input.identity.roles\n    some permission in data.role_permissions[role]\n    permission == input.resource.required_permission\n}\n\nrisk_acceptable if {\n    input.risk.score \u003C 70\n    not input.risk.active_threat\n}\n\nstep_up_required if {\n    input.risk.score >= 50\n    input.risk.score \u003C 70\n    not input.identity.recent_mfa\n}\n```\n\n## Implementation Steps\n\n1. **Inventory assets and data flows** - Map every application, service, and data store\n2. **Deploy identity provider** - Centralize authentication with SSO and MFA\n3. **Implement identity-aware proxy** - Route all access through authentication layer\n4. **Enable mTLS for service mesh** - Encrypt and authenticate all service communication\n5. **Apply network policies** - Default deny with explicit allow rules\n6. **Add device posture checks** - Verify device compliance before granting access\n7. **Deploy continuous monitoring** - Log and analyze all access decisions\n8. **Iterate and refine** - Review policies based on monitoring data\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| Users cannot access internal apps | Identity provider misconfigured | Verify OIDC\u002FSAML settings; check redirect URIs |\n| mTLS connections failing | Certificate expired or wrong CA | Check cert expiry with `istioctl proxy-config secret`; verify CA chain |\n| Network policy blocking legitimate traffic | Missing egress or ingress rule | Use `kubectl describe networkpolicy`; verify pod labels match selectors |\n| Device posture check fails | MDM agent not reporting | Verify device agent is running; check compliance dashboard |\n| OAuth2 proxy returns 403 | User email domain not in allow-list | Add domain to `--email-domain` flag or update group membership |\n\n## Related Skills\n\n- service-mesh (`service-mesh`) - mTLS implementation\n- kubernetes-hardening (`kubernetes-hardening`) - K8s security\n- vpn-setup (`vpn-setup`) - Traditional VPN (contrast with zero trust)\n\n## Limitations\n\n- Apply guidance only within authorized scope; test destructive steps in non-production first.\n- Docs-only import: upstream scripts and templates not bundled.\n\n### Example\n\n```bash\n# Read-only first: inventory before any active step.\nwhich \u003Ctool> && \u003Ctool> --help | head -n 20\n```\n\n> Adapted from [BagelHole\u002FDevOps-Security-Agent-Skills](https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills) (MIT); frontmatter, When to Use\u002FLimitations, and safety boundaries added for upstream compliance. Docs-only import: helper scripts and templates not bundled.\n",{"name":5,"risk":31,"source":47,"license":14,"category":48,"metadata":49,"date_added":52,"description":7,"source_repo":53,"source_type":34,"compatibility":54,"license_source":55},"https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills","security",{"author":50,"version":51},"devops-skills","1.0","2026-09-20","BagelHole\u002FDevOps-Security-Agent-Skills","Requires the relevant security tooling (scanners, vault CLIs) and an authorized scope for any active assessment. Docs-only; helper scripts and templates not bundled.","https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Fzero-trust","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill zero-trust",{"tool":67,"command":68},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill zero-trust",{"tool":70,"command":71},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill zero-trust","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",true,[],[76,100,125,153,177,192],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":42},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[83,84,85,86,87,88,89,90,91,92,93,94,95,35,96,34,97,98,31,99],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","node","read","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":42},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[107,108,109,110,111,112,113,114,115,116,117,118,119,34,33,120,121,122,123,124],"transcript","youtube transcript","youtube","safe","github","codex","research","license","https","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":142,"publishedAt":42},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[131,134,137],{"categoryNo":132,"categoryName":133,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":135,"categoryName":136,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":138,"categoryName":139,"taxonomyType":140,"taxonomyTypeDesc":141},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[107,108,109,143,110,144,111,112,114,145,146,147,148,117,149,34,33,150,151,152],"youtube transcript skills","gemini","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":163,"publishedAt":42},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[159,162],{"categoryNo":160,"categoryName":161,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":135,"categoryName":136,"taxonomyType":20,"taxonomyTypeDesc":21},[109,164,165,87,110,166,167,168,169,114,147,170,171,172,173,33,174,120,175,176],"youtube notetaker","notetaker","workflow","official","notes","code","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":184,"publishedAt":42},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[183],{"categoryNo":132,"categoryName":133,"taxonomyType":20,"taxonomyTypeDesc":21},[185,109,186,187,110,144,145,188,189,146,147,148,117,190,149,34,33,150,191,123],"youtube full","full","google","server","dlp","credits","automatic",{"skillNo":193,"name":194,"nameZh":6,"description":195,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":196,"categories":197,"keywords":201,"publishedAt":42},"01M6Q0DKK9BWZZMRXG7F3Q0G3J","yao-meta-skill","Create, refactor, evaluate, and package agent skills from workflows, prompts, transcripts, docs, or notes. Use for skill creation, reusable workflow packaging, skill improvement, evals, and team-ready distribution.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyao-meta-skill\u002FSKILL.md",[198],{"categoryNo":199,"categoryName":200,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[202,203,204,205,87,110,166,206,168,207,169,208,209,210,211,34,33,212,213,214],"Meta","meta skill","yao meta skill","yao","workflows","create","Evaluation","team","packaging","ready","meta-skill","creation","distribution"]