Cloud identity and auth

From Tibsfox/gsd-skill-creator · View interactive version

Cloud identity and auth is an AI agent skill from the GitHub repository Tibsfox/gsd-skill-creator. Identity, authentication, authorization, and token management for cloud platforms. Covers Keystone-style scoped tokens, OAuth 2.0 flows, OpenID Connect, JWT structure and pitfalls, federation with SAML/OIDC, service-to-service auth with mTLS and SPIFFE, principle of least privilege, IAM role design,

How to use this skill

Skill file

Cloud Identity and Authentication

Identity is the bedrock of cloud security. Every API call, every internal RPC, every resource access must ultimately be attributable to a principal — a user, a service account, a workload — and must be authorized against a policy that the platform enforces uniformly. Getting this layer right is what separates a cloud platform from a collection of servers. Getting it wrong is the source of most breach post-mortems. This skill covers the core concepts and failure modes a cloud-systems practitioner has to handle.

Agent affinity: hamilton-cloud (IAM at AWS scale), vogels (service-to-service identity in SOA), lamport (formal reasoning about capability and delegation)

Concept IDs: cloud-keystone-auth, cloud-security-groups-policies, cloud-requirements-tracing

The Three Questions

Every identity system answers three questions in order:

  1. Authentication (authn). Who are you? Prove it.
  2. Authorization (authz). What are you allowed to do?
  3. Accounting. What did you do? (Audit logs.)

Separating these cleanly is the first design decision. Authentication produces an attested identity (a token, a certificate, a signed assertion). Authorization consumes that identity and a resource reference and returns allow/deny. Accounting records both.

The Keystone Model: Scoped Tokens

OpenStack Keystone — and most cloud platforms that followed — use a scoped token model. A user authenticates and requests a token scoped to a project (or tenant, or organization). The token carries:

Every downstream service (Nova, Neutron, Cinder, etc.) validates the token against Keystone and then consults its own policy file to determine whether the user's roles permit the requested action. The token is the authentication; the service's policy engine is the authorization.

The Service Catalog Pattern

A scoped token also carries a service catalog — a list of endpoints the user can reach. Each service has three interface types:

Separating these by URL (not just by authz check) adds a network layer defense: even if someone acquires credentials, they need to be on the admin network to hit the admin endpoint.

OAuth 2.0 and OpenID Connect

OAuth 2.0 is a delegation framework: a resource owner grants a client limited access to a resource without sharing credentials. It defines four main flows:

Avoid the legacy flows. The implicit flow and resource owner password credentials grant are deprecated. They exist only to support very old clients and should not be used in new systems.

OpenID Connect (OIDC) sits on top of OAuth 2.0 and adds authentication. The authorization server issues both an access token (for API access) and an ID token (a JWT that attests to the user's identity). OIDC is the standard for federated single sign-on across cloud services.

JWT: Structure and Pitfalls

A JSON Web Token is a compact, URL-safe, self-describing credential. Three base64url-encoded parts separated by dots: header, payload, signature.

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NSIsImV4cCI6MTcxMjM0NTY3OH0.abc...

The header declares the signing algorithm. The payload contains claims (standard ones like iss, sub, aud, exp, and application-specific ones). The signature is computed over header and payload with a secret (HMAC) or private key (RSA/ECDSA).

JWT Failure Modes

Federation

Federation lets users from one identity provider (an organization's AD, Google Workspace, Okta) authenticate to another system without that system holding their credentials. Two dominant protocols:

The cloud platform (service provider) trusts the identity provider to attest to user identity and group membership, and maps those groups to local roles. Federation shifts credential management to one place, at the cost of making the identity provider a single point of failure and a high-value target.

Service-to-Service Authentication

Inter-service calls inside a cloud platform cannot use human credentials. Several patterns:

Authorization Models

Least Privilege

The baseline security principle: a principal should have the minimum permissions required to do its job. Implementation:

Common Failure Modes

| Failure | Example | Mitigation |

|---|---|---|

| Overprivileged default role | New service gets admin because "we'll tighten later" | Start with deny-all; document and track exceptions |

| Secrets in env vars committed to git | AWS keys in .env pushed to GitHub | Pre-commit hooks, secret scanning, rotate on detection |

| Long-lived API keys | Customer's key from 2018 still works | Mandatory rotation, expiration on all keys |

| Token scope too broad | API token with full account access for a single read op | Per-operation scopes, prefer OAuth scopes over raw keys |

| Missing audit trail | No record of who accessed what | Log every authz decision with principal, resource, action |

| Audit logs tamperable | Admin can edit logs | Append-only store, off-box shipping, hash chains |

When to Use This Skill

When NOT to Use This Skill

Decision Guidance

| Need | Recommended |

|---|---|

| Enterprise SSO | OIDC (preferred) or SAML 2.0 |

| API access for web app | OAuth 2.0 authorization code with PKCE |

| Machine-to-machine API | Client credentials flow, or SigV4-style signing |

| Inter-service auth in cluster | mTLS via SPIFFE/SPIRE, or service mesh |

| Fine-grained resource policy | ABAC with policy-as-code (Rego, Cedar) |

| Coarse organizational policy | RBAC with periodic review |

| Audit log integrity | Append-only storage, off-box shipping |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.