Guides · 6 of 8
Import Linux and Windows servers
Two small scripts read a server and tell Dawnsentry what it runs: one for Linux, one for Windows. Download them under Inventory → Import → Other systems. Each reads only the server it runs on, needs nothing installed and no root or administrator rights, and changes nothing. Run it once and upload the file it writes, or let it send what it reads straight in every night.
What they read
| Linux Ubuntu, Debian, Proxmox VE, RHEL, Rocky, Alma, Oracle Linux, SLES | The release from /etc/os-release, the host name, the kernel, every installed package with the version dpkg or rpm reports, and the server's own IP addresses with interface and MAC. A POSIX shell script (sh). |
| Windows Windows Server 2012 R2 and later, Windows 10 and 11 | The build with its update revision (10.0.20348.2849), the installed programs, each SQL Server instance's patch level, the Exchange build, and the server's own IP addresses with interface and MAC. Windows PowerShell 5.1 (on 2012 R2, with WMF 5.1) or PowerShell 7. |
The whole package or program list is sent; Dawnsentry keeps only what it recognises. You get an item for the system (Ubuntu 24.04 LTS, Windows Server 2022) and one under it for each product it knows: BIND, OpenSSH, Apache, nginx, PostgreSQL, Samba, Kerberos, 389 Directory Server, SQL Server, Exchange, Tomcat, Veeam and more. Libraries that are on nearly every server (OpenSSL, curl and sudo on Linux; .NET, PowerShell, browsers and 7-Zip on Windows) are offered unticked; --libraries or -Programs takes them too.
Why the package version matters
Ubuntu, Debian and Red Hat keep the version a release ships and backport security fixes into it. OpenSSH on Ubuntu 24.04 stays 9.6p1 for the release's whole life, so the version ranges in a CVE would call it vulnerable long after Canonical fixed it. The package version (1:9.6p1-3ubuntu13.5) says which build you have, and Dawnsentry judges it by the distribution's own security data: Canonical's for Ubuntu, Debian's security tracker for Debian and Proxmox VE, Red Hat's for RHEL and its rebuilds, SUSE's security updates for SLES. A package from somewhere else, such as a PPA or the PostgreSQL project's own repository, is judged by the upstream version instead.
Run it once
On Linux, as any user:
sh dawnsentry_packages_export.shOn Windows, in PowerShell:
powershell -ExecutionPolicy Bypass -File .\dawnsentry_windows_export.ps1Each writes one JSON file named after the server. Upload it on the same import page: you see what was found, untick what you don't want, and press Import. This also works from an air-gapped network: carry the file out, or upload it to a self-hosted Dawnsentry inside.
Send it in every night
With an API key the script sends what it reads directly, and Dawnsentry imports what the review would have ticked. Make a key under Users & alerts → Integrations → API keys with Read and write; one key per server, or per group of servers, lets you revoke one without touching the rest. The script sends over HTTPS to your Dawnsentry address, so the server needs to reach it on port 443; nothing has to reach the server. With a private certificate authority, add --ca-file ca.pem on Linux.
On Linux, a cron file (it holds the key, so only root may read it: chmod 600):
# /etc/cron.d/dawnsentry
DAWNSENTRY_API_KEY=dsk_…
17 3 * * * nobody sh /usr/local/lib/dawnsentry_packages_export.sh --push https://app.dawnsentry.com --out /tmp/dawnsentry-packages.jsonOn Windows, a scheduled task that runs as SYSTEM every night, made in an administrator PowerShell:
$run = '-NoProfile -ExecutionPolicy Bypass -File C:\ProgramData\Dawnsentry\dawnsentry_windows_export.ps1 ' +
'-Push https://app.dawnsentry.com -ApiKey dsk_… -Out C:\ProgramData\Dawnsentry\last.json'
Register-ScheduledTask -TaskName "Dawnsentry" -User SYSTEM -RunLevel Highest `
-Action (New-ScheduledTaskAction -Execute powershell.exe -Argument $run) `
-Trigger (New-ScheduledTaskTrigger -Daily -At 3:17am)The script prints what Dawnsentry did, for example web01: 0 items created, 5 updated. When something goes wrong it says so and keeps the file, so you can upload it by hand. --exposure internet (or -Exposure internet) makes new items internet-facing; the default is internal.
What happens on the next run
- Versions are updated in place. The script remembers each item by the server's machine ID and the package, so the same items are updated. Names, exposure, site and notes you changed in Dawnsentry stay. Findings the new versions fix close by themselves.
- New products become new items, under the server's system item.
- A product on a new line keeps its item. When PostgreSQL moves from postgresql-15 to postgresql-16, the new package updates the PostgreSQL item that was already under the server, rather than adding a second one.
- What the server no longer has is marked, not deleted. Each run is the whole server, so an item an earlier run made that this run didn't find (a package removed from the server) shows as not found in the inventory and on its page. Remove it there, or press Keep it to make it an item of your own that the script leaves alone. If the next run finds it again, the mark goes. A run that lists no packages at all marks nothing, since something went wrong on the server.
IP addresses
The server's own addresses go on its system item under IP addresses: global ones only (not loopback, link-local or IPv6 privacy addresses, and not the bridges Docker, Kubernetes and virtual machines get). Each lands in the VLAN or block that holds it, with the interface and MAC, and is marked DHCP when the server got it by DHCP. An address another item already holds stays with that item, and nothing is ever removed, so an address the server gave up stays until you release it. Leave them out with --no-addresses or -NoAddresses.
Next: How findings are scored and flagged · Questions? info@dawnsentry.com