Problems with grr_api_client & grr_api_shell
See original GitHub issueHello all,
My goal is to have the ability to automate processes for GRR, like removing dead clients, with scripts.
We are using a single sign-on for authentication with GRR, and that can’t be removed.
Because of the single sign-on, I cannot use the grr_api_client or the grr_api_shell, as it receives the following error because it’s being blocked by single sign-on:
grr_api_client.errors.AccessForbiddenError: No username header found
(I can send the full error if needed)
Is there an undocumented way to get a list of all clients, sort them by “dead” clients, and then give the option to delete all “dead” clients, without the use of grr_api_client or grr_api_shell?
Is there undocumented commands that might be able to help me in the right direction?
Or maybe, is there a work around for single sign-on?
If that isn’t possible, is it possible to write a script that initializes the grr_console, authenticates with a password, and then executes commands line by line.
For example, could I execute this
In [1]: client = o("C.0a2d3036f8e0c4be")
In [2]: print client.Get(client.Schema.HOSTNAME)
example.host.com
In [3]: aff4.FACTORY.Delete("C.0a2d3036f8e0c4bf")
But in a script? From my attempts, I’m not confident it’s possible, but I thought I’d ask regardless.
Thank you in advance for any help!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Have you looked at the GRR cron jobs designed for keeping the datastore clean? The CleanInactive* cron jobs have a configurable TTL for how old each object type needs to be before it will delete it.
Thanks Misha, I didn’t know about the new raw API client. I will have to try it next week and see how it compares to just the console.
On Thu, 18 Oct 2018, 2:48 AM mbushkov notifications@github.com wrote: