Henry Carrasco

Lapse

Finds everything that expires in an organization — certificates, domains, Entra ID secrets — assigns an owner, warns in time and checks the renewal happened.

Year
2026
My role
Design, development and open-source release
Team
just me
Sector
Operational security and DevOps tooling
  • C#
  • .NET
  • Native AOT
  • SQLite
  • Microsoft Graph
  • GitHub Actions
  • Docker
The Lapse HTML report from a real scan: a summary by status and the list of certificates, domains and SAML metadata with their remaining days

The problem

What was wrong

A surprising share of outages is not caused by a bug but by something that expired: the API certificate, the company domain, the secret an integration uses to talk to Microsoft 365, the certificate used for invoicing. The date was written down from day one. What failed was organization: nobody knew the thing existed, the reminder went to someone who had left, or it was "renewed" while the server kept serving the old one. It will happen more often: since March 2026 a public TLS certificate lasts at most 200 days, and by 2029 it will be 47. Existing tools warn about what you already told them exists; I wanted one that finds what was forgotten, gives it an owner and only considers something renewed once it sees it.

The constraints

  • Store no secrets. A tool that watches credentials cannot become yet another place where they pile up: nobody would install it and it would be a valuable target.
  • No server and no accounts. Each installation lives on its user's machine, with no telemetry and no backend to maintain.
  • A single native executable for Windows, Linux and macOS with no runtime installed, because a one-minute install decides whether anyone tries it.
  • Minimal dependencies: every package is someone else's code with network and disk access on another person's machine.
  • A network failure cannot wipe the inventory: if a tenant or host does not answer, what was already known is kept.

What I built

The solution

  • Sources for TLS certificates on any host, including STARTTLS on SMTP, IMAP, POP3 and PostgreSQL; domain dates through RDAP; certificates published in SAML metadata; certificate files; secrets and certificates of Entra ID applications; and manual items.
  • Discovery through Certificate Transparency: it queries crt.sh and lists certificates issued for a domain that nobody was watching.
  • A dependency-free core with a single path: every source returns observations, a reconciler decides what is new, renewed or failing, and a planner decides which alert is due and for whom.
  • Alerts by email, webhook, Microsoft Teams and Telegram at 30, 14, 7 and 1 days, with an owner and a backup, and a SQLite ledger that never sends the same alert twice.
  • Seven commands plus an HTML report that works offline, and lapse check, which fails a CI pipeline when something expires soon.
  • The full release: CI on Windows, Linux and macOS, CodeQL, Native AOT executables, an unprivileged Docker image, an SBOM, checksums and a website with an interactive demo on GitHub Pages.

Seeing it work

Screenshots

How I did it

My part and my decisions

Separating what I designed from what I implemented does not take anything away: it is what lets you tell whether I can carry a design or only execute one.

01

What was mine

What I designed

The idea and its scope: what problem it solves, for whom, and what it does not do — it is neither a secrets manager nor an uptime monitor. The security model before the first line of code, the three-project architecture with an isolated core, and four design decisions written as ADRs in the repository.

What I implemented

All the code: 56 C# files and about 3,600 lines, plus 131 tests that need no internet because they generate their own certificates and start a local TLS server. The release workflows, the project website and the demo, which is built in CI from the same data the report uses.

Who I worked with

A personal, public project, published on my GitHub under the Apache-2.0 license. The contribution rules, the protection of the main branch and the first issues for contributors are there so others can add sources without breaking the core's rules.

What I learned here

That in a security tool what you do not do weighs as much as what you do: not storing secrets, not completing the TLS session, not following a pagination link outside Microsoft. Also that using what you build finds bugs no test finds: I hit the first real one pointing Lapse at my own website.

02

Technical decisions

Lapse watches dates, not secrets

Almost everything that expires publishes its date openly: a server hands its certificate to anyone and a domain's expiration is public. Where a credential is needed, as with Entra ID or the alert email, only a reference to an environment variable or a file is accepted; it is resolved in memory and printed as ***. Private keys are rejected at two points, when the configuration is validated and when the file is read. As a result the configuration file can go to Git and a leaked database grants access to nothing.

Reading the certificate without opening the session

Reading a server's certificate means starting a TLS handshake, and the usual way to accept any certificate is to return true from validation. I did the opposite: validation captures the certificate and returns false, so the session never completes and Lapse sends not a single byte of data to a server it does not trust. It works the same with expired or self-signed certificates, which are exactly the ones worth seeing.

What is missing: Entra ID tested against real tenants

The Microsoft Graph integration is covered by tests with recorded responses, including the security ones: the secret only travels to Microsoft and the token never follows a link to another domain. It has not yet run against many real tenants, so I released it marked as beta and opened an issue asking users for results.

03

What broke, and how I fixed it

A bug that only showed up on Windows

The first test run found that X509Certificate2.GetCertContentType throws on Windows when the content is not a certificate, instead of answering "unknown" as on other platforms. In production that would have been a scan crashing on a badly chosen file. The private-key check moved inside the block that already turned those errors into a controlled result, and a test has pinned it ever since.

The message that explained nothing

Testing Lapse against my own site on Netlify, the domain returned "HTTP 400". The fault was not in the code but in the message: I had declared a subdomain, which has no expiration date of its own. Lapse now says exactly that and suggests the registered domain. I fixed it before the first release, and it is why I run every version against real services before tagging it.

How it holds up

Security, errors, performance and maintainability

What keeps a system standing after it is written. Where I have not measured it, I say so.

Security
No stored secrets, private keys rejected, credentials only as references and never in the output, XML external entities disabled when reading SAML metadata, and an HTML report with a content security policy that blocks every network request and inserts names as text so a malicious certificate cannot inject code. Every outbound connection is documented and the tool opens no ports.
Errors
Expected failures, such as a host that does not answer or a registry without a date, are results, not exceptions, and each one says what to do. If a source fails, its items are kept and marked as not verified, and an alert that could not be sent is retried on the next scan without duplicating the ones that went out.
Performance
A native executable of about 10 MB that starts instantly and scans up to eight targets in parallel with short timeouts. The RDAP server directory is cached for a week, and Microsoft Graph queries are paginated.
Maintainability
Three projects and one rule enforced by an architecture test: the core depends on nothing. Adding a source means writing one class. Warnings are errors, formatting is checked in CI, every new dependency needs an ADR and the CHANGELOG follows semantic versioning.

Outcome

What changed

Released as open source in two versions, with executables for Windows, Linux and macOS, a Docker image and a website with an interactive demo. Today it watches TLS and STARTTLS certificates, domains, SAML certificates, Entra ID secrets and certificate files, and I tested it against Gmail, Office 365, Microsoft's metadata and my own site before tagging each version. It is the project that best sums up how I work: scope and security decided in writing before the code, and every decision in the repository where anyone can read it.