Connector script for Macs and servers
One short, read-only script that tells Tinfoil Hat what's installed on a machine.
For machines no repo describes, like a VPS, a build server or a developer's Mac, the connector lists what's installed and uploads it as an SBOM to one system on the Systems page. Tinfoil Hat then checks it like everything else.
What it reads
- Debian, Ubuntu and Alpine packages (dpkg-query, apk).
- Homebrew formulas that are server software, like nginx, PostgreSQL, Node.js or OpenSSL.
- Versions of common server programs on the path (nginx -v, psql --version, openssl version, and more).
- Global npm and pip packages, and the tags of local Docker images.
It only runs list and version commands. It changes nothing, installs nothing, needs no root, and sends nothing unless you add --send. It needs only sh and curl.
Run it
- On Systems, add the machine and press Upload Token. Copy the token.
- Download the script, check it, and read it:
curl -fsSLO https://tinfoilhat.doneby.ai/connector/tinfoil-report.sh
shasum -a 256 tinfoil-report.sh
less tinfoil-report.shThe checksum should be 9a17cc23e513030c456373511084f80f1084a7fb05b08713b43bbeeddfc4f3e1. If it isn't, don't run the file.
- See what it finds. This sends nothing:
sh tinfoil-report.sh
sh tinfoil-report.sh --out sbom.json # everything, to a file- Send it:
TINFOIL_URL=https://tinfoilhat.doneby.ai TINFOIL_TOKEN=ths_your_token sh tinfoil-report.sh --sendThe token is read from the environment, never the command line, so it stays out of process lists.
Keep it current
Run it daily with cron (Linux and macOS). Keep the token in a file only you can read:
# /etc/tinfoil.env, chmod 600
TINFOIL_URL=https://tinfoilhat.doneby.ai
TINFOIL_TOKEN=ths_your_token
# crontab -e
17 6 * * * . /etc/tinfoil.env && export TINFOIL_URL TINFOIL_TOKEN && sh /opt/tinfoil/tinfoil-report.sh --send >/dev/nullEach run replaces that machine's previous report. Use --name to label it differently from the hostname.
Not covered
- What's inside your Docker images. The connector sends image tags only; for the packages inside, upload an image SBOM (see Upload an SBOM).
- macOS itself and Mac App Store apps, Windows, and Red Hat style systems (rpm). Tell us if you need these.
Troubleshooting
- "Set TINFOIL_URL and TINFOIL_TOKEN first": both must be exported in the same shell or cron line.
- Upload failed (curl exit 22): usually a revoked token or a disconnected system. Create a new token.
- Fewer items than expected: run --out sbom.json and look. Operating system packages are only checked when the distribution feeds are on (see Operating system packages).
Still stuck? Email privacy@doneby.ai with what you tried and what happened.