Giter VIP home page Giter VIP logo

Comments (1)

ianhelle avatar ianhelle commented on May 11, 2024

Rough plan:

TI Providers are of 2 types:

  • those that support one observable at a time
  • those that support queries with multiple observables (e.g. Sentinel provider)

The architecture is currently

  • TILookup - (with main funcs lookup_ioc and lookup_iocs) is a facade/proxy class that handles dispatching calls to each configured provider
    • it simple iterates through the providers in a for loop and combines the results to be returned in a DF
  • ti_providers are derived from ti_provider_base. The lookup_iocs implemented in ti_provider_base simply iterates (via a generator) through the supplied iterable/DF of observables, calling the lookup_ioc method implemented for the specific provider.

Constraints:

  • we probably don't want to default to hammering TI providers with a big set of async requests since we'll probably quickly hit request limits.
  • some users may have enterprise licenses and want the requests for some providers to be async - so maybe we need handle async requests differently depending on user configuration.
  • can we handle per-provider request limits? What would this look like? Process N reqs per minute then sleep until minute expires? (N is req limit/min)

Proposed solution:

Phase 1

  • in TILookup create an async task list for each provider
  • For multiple requests, split the list into some multiple of batches (for feedback via TQDM) - e.g. 10
  • TQDM look tracks # of batches (not # of providers)
  • Have synchronous for loop handle request chunks
  • Dispatch to async tasks for each configured provider.

Phase 2

  • Allow individual providers to be configured for async
  • Re-implement async version of ti_provider_base.lookup_iocs that can dispatch batch of requests asynchronously
  • When called with async=True (config) send via async
  • Otherwise just look synchronously.

from msticpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.