Skip to content
NewSee how fast an edit goes live on this site
Halftone

Security

Our approach to credential handling, part 2

Practical steps, not promises.

Our approachto credentialhandling,part 2HALFTONE / JOURNAL
Cam Okafor
Published 2 min read

We assume something will go wrong and design for recovery. Containment, rollback and clear alerts matter more than any single control. This post covers what we changed, why, and what it means for you.

#What's next

Credentials never reach the code that runs on your behalf. A broker holds them and hands out short-lived tokens scoped to a single task.

We publish what we change and why. Customers should be able to check our work, not just take our word for it.

Security work is mostly about making the safe path the easy path. If doing the right thing takes extra steps, people will eventually skip them.

ts
const key = `${route}:${hash(content)}:${hash(template)}`;
const hit = await cache.match(key);
if (hit) return hit;

#Trade-offs

Every action is attributed to a person or an agent acting for one. The audit log answers who did what, when, and with which permissions.

Permissions only shrink during a run. A task can give up access it no longer needs, but it can never gain access it did not start with.

We assume something will go wrong and design for recovery. Containment, rollback and clear alerts matter more than any single control.

“Good defaults are invisible until they are missing.”
Ada Rivers

#What we measured

Credentials never reach the code that runs on your behalf. A broker holds them and hands out short-lived tokens scoped to a single task.

We publish what we change and why. Customers should be able to check our work, not just take our word for it.

ts
export async function publish(post: Post) {
  const problems = validate(post);
  if (problems.length) return { ok: false, problems };
  await commit(post);
  return { ok: true, url: `/blog/${post.slug}/` };
}

#Rolling it out

Security work is mostly about making the safe path the easy path. If doing the right thing takes extra steps, people will eventually skip them.

Every action is attributed to a person or an agent acting for one. The audit log answers who did what, when, and with which permissions.

Permissions only shrink during a run. A task can give up access it no longer needs, but it can never gain access it did not start with.

StepBeforeAfter
Install94s12s
Build41s7s
Deploy18s4s

#The constraint

We assume something will go wrong and design for recovery. Containment, rollback and clear alerts matter more than any single control.

Credentials never reach the code that runs on your behalf. A broker holds them and hands out short-lived tokens scoped to a single task.

We publish what we change and why. Customers should be able to check our work, not just take our word for it.

StepBeforeAfter
Install94s12s
Build41s7s
Deploy18s4s

#Results

Security work is mostly about making the safe path the easy path. If doing the right thing takes extra steps, people will eventually skip them.

Every action is attributed to a person or an agent acting for one. The audit log answers who did what, when, and with which permissions.

“The safe path has to be the easy path.”
Hana Pike