SW-COLLECTOR(8)

πŸ“¦
version 6.0.7 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– SW-COLLECTOR πŸ’–

okay bestie, so you know that whole "what even is installed on this machine and when did it get there" saga? yeah. that's this. it's sw-collector, it lives in section 8 of the manual (the big-girl sysadmin section, we love her), and it ships with strongSwan. let's get into it 🫢


✨ NAME ✨

sw-collector β€” pulls software installation events out of the dpkg history log, no cap πŸ’…


🌸 SYNOPSIS 🌸

sw-collector [--debug level] [--quiet] [--count event-count]

sw-collector [--debug level] [--quiet] [--installed|--removed]
             --list|--unregistered

sw-collector [--debug level] [--quiet] [--installed|--removed] [--full]
             --generate

sw-collector [--debug level] [--quiet] --migrate

sw-collector [--debug level] [--quiet] --check

sw-collector -h | --help

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea β˜•: sw-collector goes digging through the apt history log and finds all the moments where a software package got installed, updated, or yeeted off the system. Then it takes those software events and tucks them safely into an SQLite database. πŸ’Ύ

But wait, there's more β€” because just trusting the log alone would be it's giving chaos. So the history info it pulled gets merged and made consistent with the actual list of installed packages, which it grabs with dpkg-query. So the database matches reality, not just the receipts. iconic behaviour, honestly. πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

  • -h, --help β€” prints the usage info plus a lil short summary of all the commands you can run. your lil cheat sheet, bestie.
  • -v, --debug level β€” sets the debug level. default is 2.
  • -q, --quiet β€” turns OFF debug output to stderr. shhh 🀫
  • -i, --installed β€” applies the command to installed software packages only. just the ones that are still here.
  • -r, --removed β€” applies the command to removed software packages only. the ones that ghosted us πŸ’€
  • -f, --full β€” generates ISO 19770-2:2015 SWID tags with full file information. heads up: this is only possible for installed software packages, ok? don't try it on the removed ones.
  • -l, --list β€” lists every software package stored in the collector database, showing their installation status. a whole roster ✨
  • -u, --unregistered β€” lists all the software packages that are sitting in the local collector database but have no SWID tags yet in a central collector database that you reach via a REST interface. basically: "who hasn't been registered yet πŸ‘€"
  • -g, --generate β€” generates ISO 19770-2:2015 SWID tags for all software packages chillin' in the local collector database that don't have SWID tags in a central collector database reachable via a REST interface. tag 'em up πŸ’…
  • -m, --migrate β€” for migrating collector database versions. right now what it does is remove all architecture suffixes from dpkg package names. glow-up for your database.
  • -C, --check β€” checks the integrity of the collector database against the actual list of installed packages obtained with dpkg-query. vibe check, but make it forensic πŸ”

🌈 CONFIGURATION 🌈

these parameters can be configured in strongswan.conf:

sw-collector {
   database = sqlite:///etc/pts/collector.db
   history = /var/log/apt/history.log
   first_time = 2016-04-22T20:55:14Z
   rest_api {
      uri = https://admin-user:ietf99hackathon@tnc.strongswan.org/api/
      timeout = 120
   }
}

and the parameters of the swid_generator that gets used with the --generate command? those can be changed in the libimcv section of strongswan.conf:

libimcv {
   swid_gen {
      command = /usr/local/bin/swid_generator
      tag_creator {
         name = strongSwan Project
         regid = strongswan.org
      }
   }
}

πŸ“ FILES πŸ“

  • @PKGDATADIR@/templates/database/sw-collector/sw_collector_tables.sql

🧚 SEE ALSO 🧚


and that's the whole page, bestie, no notes πŸ’œ

okay so final lil sign-off: this whole thing is version 6.0.7, dated 2017-08-25, and yeah the copyright vibe belongs to the strongSwan crew. periodt. πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from