Cb Response: Can I add multiple Sensor Groups via the database?
Cb Response: All Versions
Our environment needs to bulk add Sensor Groups, can this be done via the database?
Creating a group via the database is not supported and can have severe consequences. When a group is created via the UI, multiple tables within the cb database are updated with information, including group certificates.
Groups should be created either through the UI or API to ensure proper table updates and cert generation.
If you do attempt creating Sensor Groups via direct database update, you will see sensors fail to check in with 500 errors in /var/log/cb/nginx/access.log
/var/log/cb/sensorservices/debug will show an error similar to the following. This indicates there is no group certificate in the database that matches the sensor group.
2017-11-16 17:21:52 <err> cb.sensor.engine - Sensor[#####]: Group cert (id: ##) not found in cache
2017-11-16 17:21:52 <err> cb.flask.sensor_app - Exception on /sensor/checkin/#####[POST]
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1687, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1360, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1358, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1344, in dispatch_request