jmpsec / osctrl

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

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

Closed javuto closed 3 months ago

javuto commented 3 months 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;