Skip to content

velociraptor: label actions never run (stray quote after FROM scope()) #459

Description

@chiefghost47

Problem

add_client_label, get_client_label and remove_client_label never do anything. Each query ends
with a stray single quote after FROM scope():

query = "SELECT label(client_id='" + client_id + "', labels=['" + label  +"'], op='set') FROM scope()'"

Velociraptor does not run the statement: the action returns [], and the label is not set, checked
or removed.

Reproduce

  1. Call add_client_label for a client and a new label. It returns [].
  2. SELECT labels FROM clients(client_id='<client>'): the label is not there.
  3. Run the same query without the trailing ': the label is applied ({"ClientId": ..., "Labels": [...], "Op": "set"}).

Tested with app velociraptor/1.0.0 at b264148 against Velociraptor 0.77.3.

Fix

Remove the trailing ' in the three label queries. Happy to send a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions