Reporting Agent for Windows security design
How the DataReel Reporting Agent for Windows protects a fleet inventory: a non-exportable machine key per computer, certificate registration and approval, signed uploads with timestamps and one-time nonces, the report server checks, the file share and SCP deliveries, the protections on the computer, and the limits.
The current copy is at https://datareel.com/windows_reporting_agent/security_design.php.
Release: 3.6, with the report server pages of the same release. Audience: security reviewers, administrators and anyone deciding whether to run the agent on their computers or trust the reports it sends. The source code is published, so everything on this page can be checked against it; the design does not depend on keeping it secret. The documentation has the setup steps, and the programs are on the downloads page.
1. What the agent protects, and from whom
The agent is a Windows service that collects an inventory of the computer (service tag, IP addresses, user profile names, installed programs, Windows updates and hotfixes, Windows Defender alerts, usage counters and, after a scan, the security updates still to install) and sends it as a text report to a report server, a Windows file share or an SSH server. The goals are:
- Only your computers report: the report server keeps a report only from a computer that has registered its own key and has been approved by an administrator, or by an enrollment token the site chose to use.
- Reports cannot be changed or replayed: every upload is signed over the report's hash, the computer's name, the time and a one-time value. A changed report, a report sent again later or a report signed by another computer is refused.
- One computer cannot speak for another: a report is always saved under the name of the computer that signed it, and a name stays bound to the first key that registered it.
- No stolen identities: the computer's private key is created inside the Windows key store and cannot be exported, so copying files from the computer does not copy its identity.
- No open ports: the service only makes outgoing connections. Nothing on the network connects to it, and the DataReel System Monitor (DRSM) reads the reports without ever connecting to a Windows computer.
- Inventory kept private: on the computer the report and the agent state are readable only by SYSTEM and Administrators; on the network HTTPS keeps it private; on the server the pages that show it need a login.
The agent does not protect against someone who is an administrator on a computer (they can make it send any report they like), against an attacker who controls the report server, or against a site that runs the server over plain HTTP. It reports what Windows tells it; it is an inventory, not an intrusion detection system.
2. The parts and how they trust each other
| Part | Trusts | Is trusted for |
| Agent service (LocalSystem) | Windows (WMI, registry, event log, Windows Update), the settings file, the server's TLS certificate as Windows checks it | Reporting what Windows tells it about its own computer |
register.php, upload.php, hook.php | Nothing in a request until its signature, approval state, time and nonce are checked | Keeping only approved, signed, fresh reports |
admin.php, status.php, report.php | The web server login, or the DRSM dashboard login | Approving computers and showing the inventory to signed-in people |
| DRSM | The report files in its reports folder | Alerts, the dashboard, trends and the Vulnerabilities page |
3. The computer's identity
- The key: on its first run the agent creates a 3072-bit RSA key named
DataReelReportAgentin the Microsoft Software Key Storage Provider, as a machine key (CNGNCRYPT_MACHINE_KEY_FLAG), with an export policy of none. Windows keeps the private key; the agent only asks Windows to sign with it, and no program, the agent included, can read it out. A computer upgraded from a test build keeps its old key,WindowsReportAgent, so it stays approved. - The certificate: a self-signed X.509 certificate for that key, subject
CN=<computer name>(lower case), SHA-256 with RSA, valid for 20 years, saved asagent_cert.pemin the agent data folder. It is not used for TLS: it only carries the public key to the server. On every run the agent checks that the saved certificate matches the key and the computer name, and makes a new one if not. - The fingerprint: the SHA-256 of the DER public key (SubjectPublicKeyInfo), written to
drra.logon the computer and shown onadmin.php, so an administrator can match the two before approving. - Random values (nonces and multipart boundaries) come from
BCryptGenRandomwith the system generator; hashes are SHA-256 from Windows CNG.
4. Registration and approval
- The agent registers before it sends anything over HTTPS. It posts its host name, a timestamp, a random
128-bit nonce, its certificate, the enrollment token (empty if none) and an RSA signature over
register\n<host>\n<time>\n<nonce>\n<SHA-256 hex of the certificate>. register.phprefuses the request unless the host name matches^[a-z0-9][a-z0-9_-]{0,62}$, the nonce is 32 hex digits, the time is withinmax_clock_skew_seconds(300 by default) of the server's clock, the certificate's CN is the host name, the signature verifies with the certificate's own key, and the nonce has not been used.- A host name that is already registered with a different key fingerprint is refused with
key_mismatch(HTTP 409); only an administrator can delete the old registration. A known host with the same key only gets its current state back; its saved certificate is not replaced. - Approval: a new computer is saved as
pendingand waits for an administrator to approve it onadmin.php. If the site sets anenrollment_tokeninserver.iniand keepsauto_approve_with_token = 1, a computer that sends the same token is approved at once; the token is compared in constant time (hash_equals), and a wrong token is refused withbad_token. A computer that sends no token is registered as pending. - Revoke and delete: a revoked computer stays listed and its uploads are refused. Deleting the registration lets the name register again, with any key.
5. Signed uploads
- Each upload carries the host name, a timestamp, a new random 128-bit nonce, the report and an RSA PKCS#1
v1.5 SHA-256 signature, made by the key store, over
upload\n<host>\n<time>\n<nonce>\n<SHA-256 hex of the report>. The server checks it withopenssl_verifyagainst the certificate saved at registration, never against anything in the request. - Replay protection: the nonce is recorded per host, under a file lock, and a nonce that was already
used is refused with
replay. Nonces are kept for twice the clock window, and older requests fail the time check anyway, so a captured request cannot be sent again. - Where it is saved: as
<host>_windows_report_agent.txtfor the host that signed, whatever file name was sent, written to a temporary name and renamed, so a reader never sees half a report. - Replies are a
STATUS:line the agent acts on. When the server saysnot_registered,pending,revokedorkey_mismatch, the agent clears its saved state and registers again on its next cycle, so it notices a revoke or a deleted registration without anyone touching the computer. - Hook uploads (reports from other tools, sent with
drra_svc.exe submit) go tohook.phpwith the same checks, signed overhook\n<host>\n<time>\n<nonce>\n<hook ID>\n<subject>\n<SHA-256 of the envelope>\n<SHA-256 of the payload>. The server also requires a manifest for that hook ID on the server, a subject that is the signing host itself, an envelope that matches the request, the manifest's size limit and minimum interval. The payload is parsed once, by the manifest's format, into plain text lines for DRSM.
6. Transport and delivery methods
- HTTPS uses WinINet, so the server's certificate is checked by Windows against the computer's
trusted roots, and TLS versions and cipher suites are Windows' own (Schannel). The agent pins no
certificate.
ignore_cert_revocation=1, the default, skips only the CRL and OCSP revocation check, for networks that block revocation servers; set it to0where they can be reached.use_https=0sends plain HTTP and is only for a test server: the signature still stops changed or forged reports, but the inventory can be read on the network. - File share (CIFS): the service connects as the computer account on a domain, or with a share login
whose password is kept in
cifs_password.dat, encrypted with DPAPI for the computer (CRYPTPROTECT_LOCAL_MACHINE). The report is copied under a temporary name and renamed. These copies are not signed: who can write is decided by the share and folder permissions. SMB signing and encryption are the file server's and Windows' settings. - SCP: the service runs the Windows OpenSSH
scp.exein batch mode with a key file that has no passphrase (the service runs unattended),StrictHostKeyChecking=yesby default against its ownknown_hostsfile, and a timeout. Not signed either: the SSH account decides who can write. - DRSM reads report files; it trusts whatever is in its reports folder. Give only the report server or the share write access to that folder.
7. On the Windows computer
- The service runs as LocalSystem, needs no inbound firewall rule and opens no port.
- Setup limits
C:\ProgramData\DataReel\ReportingAgent(the report, the log, the certificate, the registration state, the share password, the scan results and the hook upload folders) to SYSTEM and Administrators, with inheritance removed. Standard users cannot read the inventory, change the registration state or queue a hook upload. - The settings file,
drra.ini, is inC:\Program Files\DataReel\ReportingAgent, which only administrators can change. It holds the server name and the enrollment token, but never a password. Up to release 3.5 standard users could read it, like the rest of the program folder; from release 3.6 setup limitsdrra.iniitself to SYSTEM and Administrators on every install and upgrade (section 11). - The share password is read from
cifs_password.datonly for the connection and wiped from memory after use (SecureZeroMemory).set-cifs-passwordasks for it at a prompt. - Setup uninstalls the service and programs but keeps the settings and the data folder, so a reinstall keeps the same key and does not need to be approved again. Removing the agent completely means deleting them by hand.
- The vulnerability scan uses the Windows Update Agent API, the same search Settings > Windows Update runs, against Windows Update or the site's WSUS server. It downloads and installs nothing.
8. On the report server
server.ini, the registrations, the nonces, the reports, the hook data and the admin password file live inDATA_DIR.install_server.shputs it outside the web root, or, on shared hosting, inside it with aRequire all denied.htaccess. The library pages (wra_lib.php,wra_page.php,wra_auth.php,hook_lib.php) cannot be opened from the web.- Host names and hook IDs are checked against fixed patterns before they are used in a file name, so a request cannot reach another folder.
admin.php,status.phpandreport.phpneed a login: Apache Basic authentication (withrequire_remote_user = 1the pages refuse to run without it) or, withlogin = drsm, the DRSM dashboard login and its users and lockouts. Every change onadmin.phpneeds a per-session CSRF token, and all output is HTML-escaped.[status] public = 1lets the status pages run without a login. It is only for the demo with sample data.- Files are written to a temporary name and renamed into place. Registration files are JSON per host.
9. Cryptography and FIPS
| Use | Algorithm | Done by |
| Computer identity | RSA 3072, non-exportable machine key | Microsoft Software Key Storage Provider (CNG) |
| Request signatures | RSA PKCS#1 v1.5 with SHA-256 | CNG on the computer, PHP OpenSSL on the server |
| Report and certificate hashes, fingerprint | SHA-256 | CNG, PHP |
| Nonces | 128 random bits | BCryptGenRandom, system generator |
| Share password at rest | DPAPI, machine scope | Windows |
| Transport | TLS as negotiated by Windows and the web server | WinINet / Schannel, Apache |
The agent has no FIPS mode of its own and makes no FIPS claim. Its cryptography is done by Windows CNG and, on the server, by PHP's OpenSSL extension; whether those modules run in a validated FIPS mode depends on the Windows build and policy and on the server's OpenSSL. Check them with your security office if your site needs FIPS 140-3.
10. What a report holds
A report names the computer, its service tag and asset tag, IP addresses, the user profile folders, every installed program and version, the Windows updates and hotfixes, Defender alerts (with threat names and file paths), usage counters and the security updates still missing. Together the reports are a map of the fleet and its weak spots, so treat the reports folder like any other sensitive inventory: keep the status pages behind a login, keep backups private, and give DRSM and other readers access only to what they need. The agent sends no passwords, no file contents and no browsing data.
11. Limits, stated plainly
- An administrator on a computer can make it send any report. The signature proves which computer sent a report and that it was not changed on the way, not that its contents are true.
- The enrollment token is a shared secret, kept in
drra.ini, which local users can read on releases before 3.6 (3.6 limits it to administrators; upgrade, or runicaclson it the same way). With auto-approval on, anyone who has it can register a computer under an unused name. Use admin approval, or turn auto-approval off or change the token after a rollout, if that matters to you. - The first key to register a name wins. A computer that registers before the real one, with the token or an approval by mistake, holds that name until an administrator deletes it: check fingerprints before approving.
- File share and SCP deliveries are not signed, and DRSM trusts its reports folder.
- The share password is encrypted for the computer, not for a user: any program running as an administrator or SYSTEM on that computer can decrypt it. The folder ACL is what keeps it from standard users.
- The SCP key has no passphrase. Limit the SSH account to the reports folder on the server.
- Revocation checks of the server's TLS certificate are off by default (
ignore_cert_revocation=1). - Reports are saved on the server with mode 644. On a shared host, make sure other accounts cannot read
DATA_DIR. - The replay check depends on the clocks: a server whose clock is far off refuses good reports
(
bad_timestamp), and the fix is the clock, not a larger window. - The agent's own security updates come with new releases; it does not update itself.
12. Quantum computing
- What is at stake: the agent encrypts nothing itself; its RSA key only signs. A quantum computer that can break RSA could forge a computer's signature once it exists, but it could not read anything from old signatures. Reports recorded on the network today are protected by TLS, so their privacy against later quantum attacks depends on the key exchange that Windows and the web server negotiate.
- Quantum-resistant today: SHA-256 (report hashes and fingerprints) and the nonce and time checks.
- Not quantum-resistant: the RSA signatures, the self-signed certificates and RSA or elliptic-curve TLS key exchange.
- Moving on: a later release can sign with ML-DSA (NIST FIPS 204) once both the Windows key storage provider on the supported Windows versions and the PHP OpenSSL extension on report servers support it, with a new registration for each computer. For TLS, enable hybrid ML-KEM key exchange on the web server and in Windows when they offer it; the agent uses whatever Windows negotiates. No change to the agent is needed for that.
13. AI-assisted use
The AI-assisted guide (AGENTS.md) keeps
an AI agent away from every secret on this page: it never reads the enrollment token, a share password, an
SCP key, server.ini or the admin passwords, never suggests exporting the machine key or weakening a
check, and never approves a computer without the fingerprint check. People run or approve every step.
14. Reporting a security issue
Report security issues privately through the contact page, not in public issue trackers. Fixes go into the next release; the change log lists every release and what changed.