Skip to main content

OSINTBuddy - mine, merge, and map data for novel insights

Project description

OSINTBuddy plugins and extensions

The plugins library for jerlendds/osintbuddy.

2023-12-02_demo.webm

Please note: OSINTBuddy plugins are still in early alpha and breaking changes may occasionally occur in the API. That said, if you remain on the main branch and avoid accessing protected methods we will try our best to avoid introducing breaking changes.

NOTICE: There has been a major update to plugins, any created plugins will have to be updated to use the new, and more convenient data access method:

  • Remove name from any ob.Plugin
  • Update node['data'] access to be node.label_defined_in_node
    • Please see the introduction to the plugin system below

The osintbuddy plugin system at its core is very simple. An OBRegistry class holds all registered OBPlugin classes within the application. This registry is loaded into the osintbuddy application where it is then used to load the available entities for the user when they access a project graph, load transforms when a user opens the context menu of a node, and perform transformations which expect a Plugin.blueprint() to be returned. The returned data of a transform decorated method will be automatically mapped to a JanusGraph database through gremlin according to the labels (as snakecase) you previously set in the classes node for whatever Plugin.blueprint() you return.

To make this a bit more clear please see the below example...

from pydantic import BaseModel
import osintbuddy import transform, Plugin
from osintbuddy.elements import TextInput, DropdownInput, Title, CopyText
from osintbuddy.errors import OBPluginError


class CSESearchResults(Plugin):
    label = "CSE Result"
    name = "CSE result"
    show_label = False  # do not show this on the entities dialog 
    # the user sees on the left of the project graph screen
    color = "#058F63"
    node = [
        Title(label="Result"),
        CopyText(label="URL"),
        CopyText(label="Cache URL"),
    ]


class CSESearchPlugin(Plugin):
    label = "CSE Search"
    name = "CSE search"
    color = "#2C7237"
    node = [
        [
            TextInput(label="Query", icon="search"),
            TextInput(label="Pages", icon="123", default="1"),
        ],
        DropdownInput(label="CSE Categories", options=cse_link_options)
    ]

    @transform(label="To cse results", icon="search")
    async def transform_to_cse_results(
      self,
      node: BaseModel,  # dynamically generated pydantic model 
      # that is mapped from the above labels contained within `node`
      use  # a pydantic model allowing you to access a selenium instance
      # (and eventually a gremlin graph and settings api) 
    ):
        results = []

        if not node.query:
          raise OBPluginError((
            'You can send error messages to the user here'
            'if they forget to submit data or if some other error occurs'
          ))

        # notice how you can access data returned from the context menu
        # of this node; using the label name in snake case
        print(node.cse_categories, node.query, node.pages) 

        ... # (removed code for clarity)

        if resp:
            for result in resp["results"]:
                url = result.get("breadcrumbUrl", {})
                # some elements you can store more than just a string,
                # (these elements storing dicts are mapped 
                # to janusgraph as properties with the names
                # result_title, result_subtitle, and result_text)
                blueprint = CSESearchResults.blueprint(
                    result={
                        "title": result.get("titleNoFormatting"),
                        "subtitle": url.get("host") + url.get("crumbs"),
                        "text": result.get("contentNoFormatting"),
                    },
                    url=result.get("unescapedUrl"),
                    cache_url=result.get("cacheUrl"),
                )
                results.append(blueprint)
        # here we return a list of blueprints (blueprints are dicts)
        # but you can also return a single blueprint without a list
        return results

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osintbuddy-0.0.4rc51.post1.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

osintbuddy-0.0.4rc51.post1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file osintbuddy-0.0.4rc51.post1.tar.gz.

File metadata

  • Download URL: osintbuddy-0.0.4rc51.post1.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for osintbuddy-0.0.4rc51.post1.tar.gz
Algorithm Hash digest
SHA256 7d0f5778a57caa07d522c2493f28a64b6fa739b96c8c7c9d8ac0890b74ac9001
MD5 765e969a4a8b017a4e788c00628a2ef5
BLAKE2b-256 4acecf11b0d66a4b41823578c0154eb65834bc04d172d0403d19d75cb56c6e85

See more details on using hashes here.

File details

Details for the file osintbuddy-0.0.4rc51.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for osintbuddy-0.0.4rc51.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b62ec2ebdede0896e437dd892b39722d9cf78f5283e5bc45a460890167a9d11
MD5 a6e1d6e0eddd549b06c0e5234f6bf852
BLAKE2b-256 fe7802f2b98a14d90d9b37f0b68a61fcc45614f7f197e321495977b2d8db9c6f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page