Repository navigation
Releases
v0.4.29
Fixed
- Google Cloud's log names the agent on a connection with no service account of its own. 0.4.28 asked through the agent's account only where the connection named a
service_account; a project connected under an organization names none, so its leases were bab's own token and the log named no agent. Such a lease is now asked for through the agent's account and back to bab's own (bab, the agent, bab): the same roles, andserviceAccountDelegationInfocarries the agent. It needs the agents' accounts, or a group they are in, to hold Service Account Token Creator on bab's own account. Where that grant is missing, the lease is bab's own token as before and its note says the log does not name the agent.
Image: ghcr.io/tenishai/bab@sha256:e39b9d5f64e6c403696bfd2d3d82364f3fcc03e09f3a5ce1c0b200387ddf508c (tags v0.4.29, f136127; linux/amd64, linux/arm64)
v0.4.28
Added
- Google Cloud's own log names the agent. With
BAB_GCP_AGENT_ACCOUNTset to the pattern of each agent's service account (agent-{agent}@<project>.iam.gserviceaccount.com), a lease on a connection that names aservice_accountis asked for through the agent's account, and Cloud Audit Logs record that account on every call made with the token (serviceAccountDelegationInfo). bab needs Token Creator on the agent's account, and the agent's account needs it on the connection's. Where Google refuses the chain bab asks directly, as before, and the lease note says the cloud's log does not name the agent. Unset, nothing changes (#93).
Changed
.gitignoreopens with a block shared by every tenish repo (keys, env files, local databases, Terraform state, editor folders), with this repo's own lines under it.
Image: ghcr.io/tenishai/bab@sha256:b442e4fed57ce7929f520795c26a1b8004a854a424725e95584e110dc3fb4c90 (tags v0.4.28, fdeb167; linux/amd64, linux/arm64)
v0.4.27
Changed
- Licence: MIT. The project moves from AGPL-3.0-or-later to MIT, with the agreement of every contributor (tenishai/agora discussion 69). Releases already published keep the licence they shipped under.
- CI runs on GitHub-hosted runners, behind one
cicheck. TheCI_RUNNERvariable is gone: every job names a hosted image. A last job,ci, needs every other job and is the one check the branch rules require, withdco(tenishai/agora discussion 71). CI also pins its actions by commit, reads the repository with a read-only token, and checks the architecture cards. New:CODEOWNERSand weekly Dependabot updates for actions and Python dependencies. - Community files. A code of conduct, issue templates (bug, feature, question) and a pull request template, the same as the sibling projects.
- A release checks what it ships. A pushed tag now runs all of CI on the tagged commit, then builds the image and refuses to publish it when it does not start, when a Python package in it has a licence we cannot ship (
scripts/check_licences.py), or when it has a high or critical vulnerability that has a fix (.grype.yamlsays what the scan leaves out). The published image carries an SBOM and build provenance; the release carries the wheel, the sdist, the SBOM andSHA256SUMS, with its notes taken from this file. The OS package upgrade in the image runs again on every release instead of coming out of the build cache.RELEASING.mdis how to cut one.
Fixed
bab serveignores theBAB_PORT=tcp://<ip>:<port>Kubernetes injects for a Service named bab, and listens on 8080. It used to take that Service's port, so a Service on 80 in front of the container moved bab to 80 and every probe on 8080 was refused.
Image: ghcr.io/tenishai/bab@sha256:bd083ee9b67179dbc2a9c6675e222b16666ce6fdb0a9824da958b79c1008f791 (tags v0.4.27, 3e53212; linux/amd64, linux/arm64)
bab 0.4.26
Added
-
A repository set can be every repository, for Read alone. An agent that reads code across
an organization had to have every repository picked by name, and a new repository waited for
someone to add it. A child of a service connection may now sayall_repositories: true: the
token is an installation token with no repository list and only the read tier's permissions.
Nothing on such a set can change a repository:- a level beyond Read is refused when it is asked for, and again when it is decided;
- a set that holds or awaits more than Read cannot become every repository, whoever writes it;
- the minter mints from the read-tier permissions alone, whatever the row says.
It is only ever an agent's set under a service connection, never the connection itself (every
child would inherit it) and never beside a list (422 either way). A lease on such a set carries
Read alone and names only that as granted.An owner picks it as they pick repositories. Once the set carries a grant, every repository
widens it, so it waits for a reviewer as arepositoriesrequest with the proposal
{"all": true}. Back to named repositories is a narrowing and lands.GET /integrations
saysall_repositorieson each row, and the answer to a write says it back.
Image: ghcr.io/tenishai/bab@sha256:ddfbf07e9d83bd6b687efc736fac74c8c71fa64422240ac9dc920e4ebe11dcd1 (tags v0.4.26, b289c09; linux/amd64, linux/arm64)
bab 0.4.25
Changed
-
An agent keeps one Datadog application key, where bab has somewhere to keep it. A lease
was a new application key, so Datadog recorded a key made and a key deleted every hour for
every agent, and told the service account's owner each time. Datadog's keys do not expire,
and the hour was always bab's: the lease. So with a key store configured (below), an agent
has one key per Datadog connection, namedbab-<agent>, and each lease on everything it
holds there hands out that same key. Nothing else about a lease changes: it is an hour, it
is a row in the ledger, and when it runs out the next call asks for another. The key is
deleted, and the next one made with the new scopes, when what the agent may do there
changes: a permission approved, a grant revoked or lapsed, the agent removed, Datadog
disconnected. A revoke still deletes the key in the agent's hand at once. A key Datadog
refuses to delete at that moment is never handed out again. Every kept key is checked
against the ledger after a lease is given (any agent's lease, at most every five minutes,
after the answer is sent, so a slow Datadog never slows a lease) and onPOST /sweep: one whose delete was
refused, or that carries a scope its agent no longer holds because a grant ran out while
the agent was not asking, is deleted then. A
lease that names its permissions (permissionsonPOST /leases) still gets a key of its
own, deleted with the lease. The wait for Datadog to accept a new key (below) is now paid
once per key, not once an hour.Without a key store nothing changes: a key per lease, as before. bab does not keep a
secret in its ledger, and a key held only in memory would be remade for every agent at
each restart, with the old ones left behind.
Added
-
A key store: bab keeps a vendor key in the room's secret store (sero). Four settings
turn it on, all or none:BAB_SERO_URL,BAB_SERO_AUDIENCE(the audience sero's machine
lane pins to bab's own identity; it needs one of its own, not another caller's),
BAB_SERO_NAMESPACE(the namespace that caller is pinned to) andBAB_SERO_ACTING_EMAIL
(the address sero records beside each write; no person is behind these writes, so name the
service's own). bab writes each agent's key as one value atapps/bab/datadog-keys
(BAB_SERO_APPrenames the application) and asks sero once to deliver that path to its own
namespace as the Secretbab-datadog-keys, re-read every minute. sero never returns a
value, so bab reads its keys back from that Secret, mounted atBAB_DATADOG_KEYS_DIR
(default/etc/bab/datadog-keys; mount itoptional: true, it does not exist before the
first key). bab only needs the mount after a restart. A key read from it is checked with
Datadog once before it is handed out, because the mount lags a delete by about a minute.
A key the store would not take is used for its one lease and deleted with it. bab tells
sero the namespace it runs in when it asks for the delivery, and asks again (at most once
a minute) whenever the store holds a key the mount does not show, so a delivery that was
refused once does not leave a kept key out of reach.An agent never has two kept keys. Only its record knows a kept key's id, so a second one
would leave the first in Datadog for good. Datadog itself keeps one application key per
name on a service account (a second create answers 409; measured). So whenever bab cannot
tell whether a kept key is already standing, the lease gets a key of its own, deleted
with the lease, and the log says why once: after a restart until the mount shows the
store's record, while the store does not answer, while Datadog will not say whether a key
read back is still there, and when Datadog already has a key under that name that bab
does not hold. A connection moved to another service account deletes the kept keys on the
old one while its management key still can, and names them in the log when it cannot. An
agent with a dot in its name gets a key per lease.Limits. One bab process, as the lease cache already assumes. A kept key is checked
against the ledger only when some lease is asked for, or on a sweep. A key under an
agent's kept name that bab does not hold has to be deleted in Datadog by a person; the
log names it. Two rooms that mint on one Datadog service account and each have an agent
of the same name share that agent's kept name, and the second room's agent gets a key per
lease. -
A lease is checked against the grants again once it is recorded. A revoke or an
approval that landed while the credential was made found no lease to end, and the one
made a moment later carried what had just been taken back (for a kept Datadog key, for as
long as the key was kept), or was a key the approval had just deleted. Now the grants, and
for Datadog whether the key is still one to hand out, are asked again after the lease is
recorded; a change from then on finds the lease and ends it. When the answer changed the
lease is ended at once and refused (409, "no lease: access changed while this lease was
made; ask again"), and the ledger recordslease.failed.
When the store cannot answer the second check the lease is refused with 503. This holds
for every vendor.
Fixed
- A Datadog lease is not handed out before Datadog accepts its key. Datadog refuses a new
application key for a moment after it creates it: measured from the service's own pod, five
keys of five answered 403 for 0.7 to 1.8 seconds after the create returned (3.1 in a later run), then 200, and
never 403 again. A lease handed out inside that moment failed the agent's first call, and
read as a missing permission. The minter now reads with the new key until Datadog answers
200, then hands it out. The read is one the key's own scopes allow (monitors_read,
events_readortimeseries_query); a key that carries none of those is held for 2.5
seconds instead. The wait is bounded at 6 seconds. A key Datadog still has not accepted by
then is handed out anyway, with a note on the lease and a warning in the log, so a slow
Datadog never costs an agent its lease. A Datadog lease request now takes 1 to 3 seconds
longer the first time in each hour; a caller that waits less than that on a lease should
wait longer. - Two Datadog keys made for one agent in the same minute no longer collide. A key made
for one lease is named for its agent and the minute, and Datadog refuses a second key
under a name. The second now carries a short suffix.
Image: ghcr.io/tenishai/bab@sha256:eae2e63fbe5908ee97a83e3e1559154800a87ba674dbc78cb26e0e4d15436205 (tags v0.4.25, e63b475; linux/amd64, linux/arm64)
bab 0.4.24
Added
- Okta in the room catalogue. A new service vendor,
okta, with two levels:
okta_directory_read(read tier, label "Look up people and groups") and
okta_access_write(mutate tier, label "Change group membership and assignments").
Nothing is minted for it: a room holds one API token for the org and its gateway opens
the matching tools only to an agent granted the level. The token's own admin role in
Okta is the outer wall.
Image: ghcr.io/tenishai/bab@sha256:64a88bff9a492445d21b6d4600c31727c6994183b3c72ca7a929af31b42f8145 (tags v0.4.24, f16fc94; linux/amd64, linux/arm64)
bab 0.4.23
Added
- The room allows its own default. A room that gives a newborn agent Read on its own
repository asks for it as itself, with nobody there to click yes, andPOST /requests/decide
took an admin or security reviewer from every caller, so the default never landed. One
caller on no team may now approve: the room, whose actor isroom@<BAB_ROOM>
(Settings.room_actor; no new setting), and only its own default. Every request in the batch
must be pending, a level request (not a pick of repositories), raised by that same actor,
made only of permissions the catalogue marksroom_default, and on an agent's repository
set: a child of a service connection that names its repositories, never the connection
itself. Anything else in the batch, a denial included, refuses the whole batch with the 403
every non-reviewer gets. The grant'sgranted_by, the request'sdecided_byand the
request.decidedevent name the room, and the event carriesroom_default: true. room_defaultin the catalogue. An action may carryroom_default: true(read tier
only; anything else is a catalogue error). The room's catalogue sets it on
github_repos_readand nothing else.GET /catalogue/{vendor}carries it on every
permission.DELETE /agents/{agent}: the room says an agent is gone. Nothing removed what a
departed agent held: its repository set, its grants on other integrations and its pending
requests stayed behind, and a later agent of the same name would have inherited them. Like
the topology, this is the room's own fact: the console token is the authority and the actor
is recorded. It answers 409 while the topology still lists the agent. Otherwise it revokes
every active grant the agent holds on any integration and deletes the tuples, ends the
credentials it has in hand where the vendor allows, withdraws its pending requests, removes
its repository set (<connection>-<agent>) and itsagentsintegration with the grants on
it, and writes oneagent.removedevent. A set another agent still holds a level on, or is
waiting for one on, is kept and named underkept. The answer is
{agent, grants_revoked, requests_withdrawn, integrations_removed, tuples_deleted, leases_ended, removed, kept}; calling it again answers zeros.
Fixed
- A missing integration is 404 whoever asks.
DELETE /integrations/{id}ran the reviewer
gate before looking for the row, so a caller on no team got 403 for a row that was not
there and could not tell "already gone" from "not yours". A row that exists still takes a
reviewer (or is anagentsrow).
Image: ghcr.io/tenishai/bab@sha256:f33e7816e1545d9ace4d25c19abe79f8761e437412cf2b5bf431ebe2ae6cb3ef (tags v0.4.23, edfe3a9; linux/amd64, linux/arm64)
bab 0.4.22
Fixed
- An agent's owner can pick its repositories.
PUT /integrations/{id}took an admin or
security reviewer for every vendor butagents, so a console that lets an agent's owner pick
the repositories the agent may reach (a set under the GitHub connection) was refused for
anyone not on those teams. A caller on no team may now write that one shape: a child of a
service connection whose spec names itsrepositories, for a vendor whose credential is
narrowed by them (GitHub). Picking grants nothing; the level is still asked for and decided
by a reviewer, who sees the set. An empty set stays a reviewer's (it would be the whole
connection), and of such a write the repositories alone are taken: an existing set keeps its
ceiling and the rest of its spec, a new one starts with the repositories only. - Naming the
agentsvendor no longer opens another vendor's row. Any actor may write an
agentsintegration, and the check read the vendor from the request, so a caller on no team
could re-describe any integration as anagentsone and then delete it. The lane is now for
rows that are, or are about to be,agentsrows. - Disconnecting an integration takes back what waited on it. Requests still pending on a
deleted integration are markedwithdrawn, so none can be approved onto a row that later
takes the same name.
Added
- A repository added to a set that carries grants waits for a reviewer. Once an agent
holds a level on its set, or has asked for one a reviewer has yet to decide, an owner's pick
is split: what it removes leaves the set at once, and what it adds becomes one request of
kindrepositories(proposal: {added, removed};permissionsthe levels held or asked
for on the set, read again each time the request is listed and frozen when it is decided, so
the reviewer sees what the new repositories would be reached with). ThePUTanswers 202 with the set as it stands and the request under
pending; picking again replaces what waits, and saving the set without the addition (or a
reviewer writing the set) marks itwithdrawn.POST /requests/decideapplies an approved
one to the set; a denial leaves it.GET /requestsrows carryproposal(null on a
permission request). Therequeststable gains aproposalcolumn at boot. - A changed set reaches the agent on its next call. Writing a set that carries grants, or
approving an addition to it, drops the credential cached for it, so the next lease is minted
for the new set instead of the old one being handed out until its hour ran out.
Image: ghcr.io/tenishai/bab@sha256:9a139c1e90224f428877b0cfac3cff86d7f7efe71780585367cc84db8e155091 (tags v0.4.22, 43df984; linux/amd64, linux/arm64)
bab 0.4.21
Fixed
- A new grant replaces the credential in hand. Approving a request now ends what the agent
holds on that integration, the way a revoke always has (Datadog deletes the key; the cached
credential is dropped), and the decide answer carriesleases_ended. Before, a credential
minted with two permissions stayed in use beside a grant of two more: an agent granted
metrics a few minutes after its first Datadog call kept answering 403 until the hour ran out.
A tool gateway that holds a lease for its whole hour still has to ask again to see the new
one:POST /leases/for-agentanswers the lease in hand while the grants stand, so asking
every few seconds is cheap.
Image: ghcr.io/tenishai/bab@sha256:253b91921034de6d412573f6eed94f5652d3bd64372764b3dc29e0eaa2dc0b7a (tags v0.4.21, 29476da; linux/amd64, linux/arm64)
bab 0.4.20
Changed
- Google Cloud discover no longer probes each project after the tree search:
projects:search
lists only what bab's identity may read, so every project it returns is reachable by
construction. Probing 737 projects one by one took minutes and tripped Resource Manager's
rate limit, which marked readable projects "not granted" in the console. AWS discover still
probes each account through the hub (that is the only way to know the spoke role exists).
Image: ghcr.io/tenishai/bab@sha256:38176d0ad73083cfd8a6a68a81074c68edc2cb3e2051ce77989389d2caba7f8e (tags v0.4.20, c55e7ca; linux/amd64, linux/arm64)