riskops
A risk is not solved; its level is lowered.
A web application that records an organisation's IT and cyber-security risks, scores them by likelihood and impact, tracks mitigating actions and produces documents fit for management.
DashboardRisk distribution, overdue actions and recent changes
Why
RiskOps covers the whole risk life cycle: recording the risk, the 5×5 assessment, tracking mitigating actions and management reporting.
Its most important design decision is what it is not: it is not a help desk or ticket system. There is no request to close here, only an ongoing risk state. The data model is built on that difference: a risk has several assessment records and old ones are never deleted, so "where did this risk go in six months" can be answered.
Features
Risk register
Automatic risk codes from a race-safe sequence generator, 10 filters, 12 sortable columns and full-text search. Deletion is soft; no record disappears.
5×5 matrix
The likelihood and impact matrix is rendered on the server and works with JavaScript switched off. The score is a generated column in the database; level thresholds are managed in settings and all records are relabelled when a threshold changes.
Action tracking
Mitigating actions linked to a risk, with an owner and a due date. Overdue actions are flagged separately on the dashboard and in reports.
Reporting
Six ready-made reports and a one-page Executive Risk Summary. A4 print output with letterhead, confidentiality notice and signature block; CSV in two formats, for Excel and raw.
Collaboration
Comments and file attachments on risk records. A comment stays even if its author is deleted.
No framework
There is no framework and no Composer package; session security, CSRF, the permission matrix and the query layer are written by hand. The code is commented with the reasons behind the decisions.
How it works
Every request goes through a single entry point.
Page
The request reaches the page file, which calls the shared bootstrap first.
Bootstrap
Environment settings and error handlers, the lazy PDO connection, settings from the database, CSRF, the role matrix, the audit log and the risk helpers are loaded.
Authorisation
Permission checks run at the top of every page, on the server; hiding things in the interface is never the only control.
Logic and output
Queries run as prepared statements; content is rendered between the shared header and footer, and all output is escaped.
Security approach
Rules set from the start: no plain-text passwords, no concatenated SQL, no unescaped output, no role checks in the interface only, no POST without CSRF and no deletion over GET.
| Topic | Implementation |
|---|---|
| Passwords | password_hash and password_verify; the need to rehash is checked at login |
| SQL injection | Every query is a PDO prepared statement; emulation is off |
| XSS | All output goes through the escaping function |
| CSRF | Session token with constant-time comparison; required on every POST |
| Session fixation | The session ID is regenerated on login and on password change |
| Brute force | A login-attempts table with separate counters for e-mail and IP |
| User enumeration | A fixed-cost dummy hash evens out the timing difference |
Tests and CI
| Job | What it does |
|---|---|
| Syntax | All files on PHP 8.2, 8.3 and 8.4 |
| Unit tests | PHPUnit, without a database, on three PHP versions |
| Integration | MariaDB 10.11 and 11.4; the schema is loaded from scratch, then once more, then all test scripts run |
| Code quality | Format check, PHPStan level 8, a conventions check and a check that no secret entered version control |
Architecture decisions
Why things were done the way they were is kept in separate decision records; each one covers the context, the decision, the consequences, the accepted cost and the alternatives considered.
- No framework was used: installing is copying files; the cost is maintaining about 18,500 lines.
- Inline scripts were removed from the content security policy: the impact of an XSS is limited.
- The score is generated in the database, the level is not: thresholds can change in settings, the definition of the score cannot.
- Last-admin protection uses a locking read: a race condition could leave the system without an administrator.
Installation
docker compose up
The application opens at http://localhost:8080. On first start the schema is installed and 18 sample risks and 22 actions are loaded. The read-only demo account is in the README.
docker compose down -v && docker compose up
This compose file is for local use and demonstration; it must not be used on a server open to the internet. Steps for installing without Docker are in the README.
What it is not
- Not a help desk or ticket system: there is no request to close, only an ongoing risk state.
- Not an ITSM tool: asset inventory, change management and SLA tracking are out of scope.
- Not a vulnerability scanner: it does not scan; it is where scan results are managed.
- Not a SIEM: it collects no logs and does no correlation.