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

SecurityEngineering

A practical guide to credential handling, part 2

How we make the safe path the easy path.

A practicalguide tocredentialhandling,HALFTONE / JOURNAL
Dee Marsh
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 we measured

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.

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.

  • Skip what has not changed
  • Report problems in plain language
  • Cache what never changes

#Where we started

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.

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.

“Measure the time from done to live, and treat every minute of it as a bug.”
Kit Moreau

#What we would do differently

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

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
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}/` };
}

#The details

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.

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.

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.

Diagram of the request path before and after the change
Figure: the request path, before and after.

#Trade-offs

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

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.

  • Cache what never changes
  • Report problems in plain language
  • Keep the previous version one click away