GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — velociraptor: get_client_flow_results - optional artifact, no IndexError on multi-source artifacts (fixes #458) by chiefghost47 · Pull Request #461 · Shuffle/python-apps

Conversation

@chiefghost47

@chiefghost47 chiefghost47 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Problem

get_client_flow_results raises IndexError: list index out of range for artifacts with more than
one source, e.g. Generic.Client.Info (#458). Without an artifact= argument, flow_results()
returns no rows for those, and the method returns results[0].

Fix

  • api.yaml: an optional artifact parameter on get_client_flow_results (an artifact name, or
    Artifact/Source, e.g. Generic.Client.Info/BasicInformation).
  • src/app.py:
    • when artifact is set, it is passed to flow_results() and all rows are returned;
    • when it is empty, the previous return value is kept (the first row), but an empty result now
      returns [] instead of raising IndexError.
  • artifact is checked against [A-Za-z0-9_.]+(/[A-Za-z0-9_.]+)? before it is placed in the query,
    so the new input cannot alter the VQL.

There is no behaviour change for existing workflows that get results today.

Testing

Against Velociraptor 0.77.3, calling the app's own methods in an image built with the repo's
Dockerfile:

Case Before After
Multi-source artifact (Generic.Client.Info), no artifact IndexError returns [], no exception
The same flow with artifact='Generic.Client.Info/BasicInformation' n/a returns the rows
artifact value x') FROM scope() -- n/a refused with ValueError before any query
Single-source artifact (Linux.Sys.Users), no artifact first row first row, unchanged

The test image also carried #457 (org_id) so the calls could run in a non-root org. Both PRs change
the get_client_flow_results signature, so whichever is merged second needs a one-line rebase. I'm
happy to do that.

Fixes #458

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chiefghost47
velociraptor: get_client_flow_results no longer crashes on multi-sour…
e47df18
…ce artifacts (Shuffle#458)

Optional artifact parameter (Artifact or Artifact/Source, validated) is passed to
flow_results(); without it the previous return value is kept, but an empty result
returns [] instead of raising IndexError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

velociraptor: get_client_flow_results raises IndexError for multi-source artifacts

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@chiefghost47
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.