Cybersecurity
CastleCTF v1.0.0: Building a Training Platform I Can Operate
From training paths and HTB workflows to authentication, recovery rehearsals, and an honest first release: the story behind CastleCTF v1.0.0.
The most useful part of building CastleCTF has been watching it become a place where training work connects: a module leads to a lab session, a session produces notes, and those notes become something I can return to when the next challenge looks familiar.
Getting to v1.0.0 also meant answering less visible questions. Who can change a record? What survives a restart? Can I restore the database? What does a successful recovery test actually prove?
CastleCTF now has an accepted v1.0.0 Git tag, and the release commit and tags have been pushed to GitHub. The release includes a deliberate, documented limitation: isolated rollback was tested, but live production rollback remains untested.
This is a retrospective of that release milestone, not a live service-status report.
From a dashboard to a connected workspace
The v0.3 development checkpoint introduced training paths, module progress, and a live dashboard. That gave CastleCTF a useful foundation: organize what I want to learn, record progress, and see where the work stands.
The next phase connected that foundation to HTB Enterprise and Academy workflows. Searchable paths and modules made the catalog easier to navigate. Local progress tracking, persistent lab sessions, and a dedicated module workspace connected the catalog to work happening inside CastleCTF.
The distinction between provider data and local records matters. A locally recorded study session is useful evidence of my work, but it should not quietly become a claim of provider-verified completion. Verified mappings, batch mapping review, and controlled progress reconciliation help keep those relationships explicit.
Module resources then brought notes and related work closer to the training context. Direct navigation and deep links reduced the number of steps between finding a module and opening the material associated with it.
Later milestones added session lifecycle controls, study analytics, CSV reports, trends, milestones, daily focus, and persistent weekly goals. Together, these features give me a better way to plan a session and understand what happened afterward.
Inside the live workspace
These two screenshots were captured from the running CastleCTF application on November 8, 2026. They show the Operations Center and HTB workspace at that moment; the progress values are local CastleCTF records, not HTB-verified completions. The captures are cropped to the application workspace, with browser addresses and account controls excluded.
The architecture behind it
CastleCTF uses a React frontend built with Vite, served by Nginx, with a FastAPI backend and PostgreSQL for structured data. Alembic migrations track changes to the database schema. A separate private vault holds Markdown and other file-based content.
The request path is straightforward:
- The browser reaches the application through an HTTPS reverse proxy.
- Nginx serves the interface and forwards API requests.
- FastAPI applies the application’s identity and business rules.
- PostgreSQL stores structured records, while the vault stores file content.
- The backend handles HTB Enterprise requests using credentials that stay on the server.
Docker Compose ties those services together with health checks and separated networks. The backend runs as a non-root user, and the deployment configuration includes resource limits and privilege restrictions.
Keeping the database and vault separate makes the storage model understandable. It also creates an operational responsibility: both must be included in recovery planning.
Security had to grow with the features
Once an application holds private notes and account-specific progress, a working login screen is only the beginning.
CastleCTF’s authentication implementation uses Argon2 password hashing and randomly generated session tokens. Stored session values are hashed, sessions expire, and logout revokes the session. Browser cookies use Secure, HttpOnly, and SameSite protections. Origin validation and session-bound CSRF checks support the authentication workflow.
Login throttling also needed attention to concurrency. Database-backed counters and short locking transactions help keep simultaneous requests from bypassing counter updates, while expensive password verification stays outside those locks.
Authorization required its own acceptance work. An authenticated account should not automatically gain access to another account’s private records or to administrator-only actions. The release plan therefore separates login behavior, account isolation, and write authorization.
One useful lesson was learning to describe security checks precisely. A route inventory helps identify what needs review. An anonymous request being rejected proves that particular boundary. Neither result, by itself, proves that every authorized and unauthorized write behaves correctly.
Recovery became part of the product
The later milestones focused heavily on the work around the application: diagnostics, update preflight, verified backups, restore checks, release gates, and an acceptance register.
A backup archive is a starting point. Restoring it into a disposable database provides stronger evidence. Starting the application against that recovered database answers another question. Recovering vault content addresses a separate part of the system.
The isolated qualification work brought these pieces together. It restored PostgreSQL into disposable storage, recovered selected Markdown content from a local snapshot, checked file integrity, and started the frontend and backend against the recovered database. Health and anonymous-access checks helped confirm that the services could operate together.
Those checks have limits. Restoring selected content does not demonstrate restoration of an entire vault. A local snapshot does not establish independent offsite recovery. Service startup does not replace authenticated testing of every workflow.
Making those distinctions explicit became one of the most valuable parts of the release process.
The rollback exception, clearly stated
The final recovery rehearsal exercised three transitions in an isolated environment:
- Start the release candidate.
- Switch to the previous application version.
- Return to the release candidate.
The recorded rehearsal passed, and the existing production containers remained unchanged.
The original REC-03 acceptance item concerned a production rollback rehearsal. I approved the maintenance plan and explicitly accepted the isolated rehearsal as a scoped exception for the initial v1.0.0 release.
That approval does not mean a live production rollback was performed. It remains untested. Production database downgrade was also not tested, and independent offsite recovery remains unverified.
These limitations belong beside the release result. They are part of understanding what was accepted and what still needs work.
What the 1.0 release records
The final tag records eleven accepted requirements across authentication, application workflows, security review, and recovery, including the REC-03 exception. Some workflow results were operator-attested; the count should not be read as eleven independently reproduced production tests.
The accepted release points to commit c2d8fa3. Its frontend and backend retain their 1.0.0-rc1 image labels. Final sign-off accepted the already deployed candidate, so creating the final Git tag did not require another rebuild or restart.
The final synchronization pushed five commits and their release tags to GitHub without force-pushing. A Git tag and a GitHub Release page are separate artifacts; no separate GitHub Release entry was present when this retrospective was prepared.
For me, the milestone is having a useful application paired with a clearer record of how it was checked, how it can be recovered, and where confidence still has limits.
Keeping CastleCTF focused
The project also needed a clearer boundary with CastleOSINT.
CastleCTF’s focus is training, challenges, lab sessions, progress, and learning notes. Formal investigations, original evidence preservation, custody, and investigative reporting belong with CastleOSINT.
Existing investigative code was preserved while its navigation was separated from the main training experience. That is preparation for a careful migration, not a claim that migration is complete. Moving evidence and ownership records requires its own verification before old functionality can be retired.
What I learned
The visible interface is only part of the engineering work. A useful module workspace depends on reliable persistence, explicit ownership, sensible navigation, and recovery procedures that account for all its data.
Release language matters too. “The restore passed” is only meaningful when the record explains what was restored, where it was restored, and what was checked afterward.
I also want future release records to make the relationship between source commits, application versions, container images, and operational tooling easier to follow. Those identifiers can move at different times, especially when a release adds qualification tools without changing the running application.
Most of all, I want exceptions to stay visible. Recording a limitation clearly gives the next round of work a concrete starting point.
Where CastleCTF goes next
The proposed next roadmap starts with strengthening recovery evidence: complete vault restoration, independent offsite recovery, and a controlled live rollback exercise if required by the operating policy.
For v1.1, the product priorities are smoother HTB workflows, clearer synchronization and mapping status, and better connections between modules, sessions, notes, and analytics. The CastleOSINT boundary will continue to guide integration work, with explicit ownership and verified migration rather than shared storage shortcuts.
CastleCTF v1.0.0 gives me a useful training platform and a release I can explain. The next phase is making that platform more dependable and easier to use in the everyday work of learning.
Explore the CastleCTF project for the broader direction.