jmpsec / osctrl

Fast and efficient osquery management
https://osctrl.net
MIT License
371 stars 50 forks source link

Adding tags and platforms by environment in osctrl-api #478

Closed javuto closed 1 month ago

javuto commented 1 month ago

In addition to adding to osctrl-api the ability to query tags and platforms by environment, this PR also adds environment_id to the tags table in the DB. Keep in mind that existing tags won't have the value set, and the table tagged_nodes will need to be used to keep data integrity. Example of the SQL to be used:

UPDATE admin_tags a SET environment_id = (SELECT environment_id FROM osquery_nodes WHERE id = t.node_id) FROM tagged_nodes t;