Metadata-Version: 2.5
Name: cloudarq-issuers
Version: 0.2.0
Summary: A census of the OIDC issuers clouds federate to for workload identity, with tenancy, subject grammar, claim vocabulary and who controls the audience.
Project-URL: Homepage, https://github.com/CloudArq-net/issuers
Project-URL: Source, https://github.com/CloudArq-net/issuers
Author: Abdallah Khaldi
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: aws,azure,federation,gcp,iam,oidc,trust-policy,workload-identity
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Systems Administration
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# cloudarq-issuers

A census of the OIDC issuers a cloud provider will federate to for workload identity —
GitHub Actions, GitLab, CircleCI, HCP Terraform, Kubernetes and 39 others, 44 entries in
all — with the fields a policy evaluator needs.

Apache-2.0. No dependencies, and the package makes no network call.

```bash
pip install cloudarq-issuers
```

## Why

Evaluating a cloud trust policy correctly means knowing things about the issuer that are not
in the policy: what its subject looks like, which claims it emits, whether it is shared
between every customer of that vendor, and who can get a token from it at all. That knowledge
is spread across each vendor's own documentation. This census collects it in one
machine-readable file, with the vendor's sentence beside each value it rests on.

## Four fields that carry most of the weight

### `aud_controlled_by` — who picks the audience

`aud` reads like a boundary. On **17 of 44** issuers it is not one, because the workload
requesting the token chooses it. From GitHub's own documentation: *"You can customize values
for `audience` claims."* So any repository on GitHub can request a token carrying
`aud: sts.amazonaws.com`, and a trust policy leaning on `aud` alone has trusted all of them.

```python
from cloudarq_issuers import audience_is_boundary

audience_is_boundary("token.actions.githubusercontent.com")   # False
audience_is_boundary("login.microsoftonline.com")             # True
audience_is_boundary("nobody.surveyed.this")                  # None   <- not False
```

### `vendor_example_verdict` — what the vendor's own example admits

A trust policy copied from a vendor's documented example admits what the example admits.
CircleCI's AWS example carries **no `sub` condition at all**. Google's recommended attribute condition,
`assertion.repository_owner=='ORGANIZATION'`, admits every repository in the organisation.

### `control_test` — what a bogus tenant returns

Two UUIDs invented at random each returned a complete, well-formed AWS discovery document
echoing the invented UUID back as its own `issuer`. Only the JWKS refused them.

> **A discovery document is not proof a tenant exists. Only the JWKS is.**

### `immutable_id_claims` — names, or identifiers

**29 of 44** entries have none, so every subject written against them is a recyclable name.
Kubernetes is the sharp case: delete a service account, recreate one with the same name in
the same namespace, and it silently re-inherits every role that trusted it.

## Who can hold a token

Since 0.2.0 the census records, for the issuers it has researched, the facts that decide who
can get a token an issuer mints, each resting on the vendor's own sentences kept beside it:
the page, the sentence verbatim, and the date it was read.

- `anonymous_tokens`: whether the issuer mints tokens to people with no account anywhere.
  Amazon Cognito identity pools do, in a pool that allows guests.
- `tenancy_claims` and `not_tenancy`: the claims that name a tenant (an owner, a repository
  or an enterprise), each with its `kind`, `name` or `id`; and the claims that look like
  tenants and are never read as naming one, such as GitHub's `job_workflow_ref`, which names
  the called workflow, and GitHub's `enterprise`, which no sentence shows to name one
  enterprise.
- `subject_forms`: every documented form of `sub` with a tenant at its head, as a leading
  literal and the owner's parts, each with the delimiter after it; `never_pin` lists the
  literals whose subjects name no tenant.
- `owner_charset` and `names_unique_regardless_of_case`: the characters an owner name can
  hold, and whether names that differ only in case are one owner.
- `match` and `tenant_membership`: for an issuer whose URL names its tenant, how to read it,
  and whether the tenant's owner controls who obtains its tokens. Six of the nine patterns
  record that it does, the three clusters on a chain of Kubernetes' and each platform's
  sentences; Spacelift's, Bitbucket Pipelines' and Microsoft Entra ID's read `unverified`.
- `built_in`: the providers AWS STS accepts with no identity provider in the account.
- `aws_condition_keys`: the condition keys AWS documents for the issuer, each with the `claim`
  AWS's table says AWS reads it from, which is not always the key's own name (`oaud` reads
  `aud`), and a `fallback_claim` where AWS reads another claim when the token sets none (`aud`
  reads `azp`, or `aud`). GitHub's tab has `repository_owner_id` and no `repository_owner`.
  Google's `google/organization_number` has no `claim`, only AWS's spelling in `table_claim`:
  Google's reference prints the number inside a `google` claim, and no page says which AWS
  reads. AWS does not document what a condition on a key it does not list tests; read as
  unread, such a condition never pins and never narrows, whichever it tests. Each key says
  whether it is `multivalued`: `amr` is, on AWS's sentence "The key is multivalued, meaning
  that you test it in a policy using condition set operators.", since a signed-in user's
  `amr` holds `authenticated` and the login provider; every other key reads `unverified`.
- `multi_valued_claims`: the claims the issuer's tokens may carry with several values, each
  on the sentences that say so. The EKS, AKS and GKE cluster issuers, AWS's outbound tokens
  and Bitbucket Pipelines record `aud`: Kubernetes says of a service account token's
  audience "May be repeated to request a token valid for multiple audiences.", AWS's
  `GetWebIdentityToken` takes an array of up to ten, and a pipeline declares a list,
  "Maximum of 10 audiences allowed." A claim not listed is not thereby one value.
- `accounts`: the platform whose accounts hold the issuer's tenants, as the vendor names it,
  and, for GitHub Actions, the namespace a consumer declares its owners under, `github`.
- `researched`: whether this release researched the entry at all.

## `unverified` never means absent

Sixteen entries were fetched live against the public `.well-known` endpoint, each on the
date in its `verified_at`. Everything else says `unverified` — nobody confirmed it, which is
a different claim from *"there is nothing there"*. No field is inferred from another field,
and where an older value rests on a vendor's example rather than a sentence, its note says
so.

In a tenancy field, `unverified` means exactly that no vendor sentence establishes the value
in this release, whatever the reason, and every reader answers it the cautious way: an issuer
may mint tokens to people with no account, no claim or `sub` prefix pins a tenant, any
character may occur in an owner name, names compare exactly, a condition key or a claim may
hold several values, and a tenant is not known to control who joins it, and its name may
pass to someone else.

The API keeps that distinction. `audience_is_boundary` returns `None`, never `False`, for
anything unconfirmed, because a caller that reads an unknown as a boundary has widened its
own trust without noticing.

## API

```python
import cloudarq_issuers as ci

ci.CENSUS_DATE                  # "2026-09-13"
ci.issuers()                    # every entry, as plain dicts
ci.get("gitlab.com")            # one entry by host, or None if unsurveyed
ci.multi_tenant_hosts()         # frozenset[str] -- issuers shared across a vendor's tenants
ci.audience_is_boundary(host)   # True | False | None
ci.subjects_are_recyclable(host)
ci.host_of("https://gitlab.com/x")   # "gitlab.com"

entry, tenant = ci.match("https://oidc.eks.us-east-1.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE")
ci.match("https://login.microsoftonline.com/common/v2.0")    # None: common is not a tenant
ci.tenancy(entry)               # the values a classifier reads, nothing unverified

anonymous, known = ci.issues_anonymous_tokens(entry)
controlled, known = ci.controlled_tenant(entry, tenant)
recyclable, known = ci.tenant_is_recyclable(entry)
without_case, known = ci.names_compare_without_case(entry)

gh = ci.get("token.actions.githubusercontent.com")
ci.claim_is_recyclable(gh, "enterprise_id")        # (True, False): no sentence says it cannot pass on
ci.aws_maps_condition_key(gh, "repository_owner")  # (False, True): AWS's GitHub tab has no such key
ci.aws_condition_key(gh, "oaud")                   # {"key": "oaud", "claim": "aud"}: AWS reads oaud from aud
ci.aws_condition_key_is_multivalued(gh, "amr")     # (True, True): AWS documents amr as multivalued
ci.aws_condition_key_is_multivalued(gh, "oaud")    # (True, False): not known, so it may hold several
ci.claim_is_multi_valued(gh, "aud")                # (True, False): not known, so it may carry several
ci.claim_is_multi_valued(ci.get("api.bitbucket.org"), "aud")  # (True, True): a pipeline declares a list
ci.owner_name_may_contain(entry, "/")                         # True when nothing is recorded
```

`issuers`, `get` and `match` hand out copies: edit an entry however deep and the next
answer is still the census's. Hosts compare without ASCII case and no other, so a
look-alike such as one spelled with the Kelvin sign is not a census host.

`match` reads an issuer URL's path as well as its host, and returns the entry and the tenant
the URL names, or `None` for an issuer nobody surveyed: never a sign that it is safe. Each
reader returns an `Answer`, a `(value, known)` pair; when `known` is false the value is the
cautious one, and an `Answer` refuses to be read as true or false, so an unknown cannot pass
for an answer by accident.

`multi_tenant_hosts()` is a drop-in for a hard-coded set of the same shape. A host missing
from it is not thereby known to identify a tenant.

## Also available as a Go module

```bash
go get github.com/CloudArq-net/issuers
```

Same data, same source of truth, and the same answers: the Go and Python packages are tested
against one file of what each reader says about every entry. The YAML is authoritative and
carries the comments; a JSON built from it is what both packages embed, which is why neither
needs a YAML parser at runtime and neither has a dependency.

## Source, contributing, and how it stays current

[github.com/CloudArq-net/issuers](https://github.com/CloudArq-net/issuers)

A scheduled job re-fetches each discovery document the census records as fetched at a fixed
URL, and its JWKS, and opens an issue when one has moved, so drift is visible rather than
silent. Issuers move: Microsoft's documentation says Azure DevOps's issuer,
`https://vstoken.dev.azure.com`, "retires on July 1, 2027" (read 2026-09-27), and AWS became
an issuer in its own right at `<uuid>.tokens.sts.global.api.aws` — `sts.amazonaws.com` is not
one and returns 400 saying so.

An entry with `discovery_status: ok` must be reproducible: paste the `curl` and its output in
the pull request. Anything else is `unverified`, and that is a perfectly good state for an
entry to be in. A tenancy value other than `unverified` needs the vendor's sentence behind it.
Issues are welcome, and pull requests are accepted under Apache-2.0.

A value that could make a consumer trust more than it should can be reported privately,
through GitHub's private vulnerability reporting on the repository or to
support@cloudarq.net.

## Licence

Apache-2.0 (`LICENSE`). The census quotes sentences from vendors' documentation; those
sentences are their publishers' text, and `NOTICE` names each publisher and the licence it
states for its pages. Both files ship in the package.
