https://github.com/crowdstrike/foundry-js

https://github.com/crowdstrike/foundry-js

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.9%) to scientific vocabulary

Keywords from Contributors

falcon-foundry projection archival sequencers profiles chart annotation packaging optimism interactive
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: CrowdStrike
  • License: mit
  • Language: TypeScript
  • Default Branch: main
  • Size: 3.97 MB
Statistics
  • Stars: 7
  • Watchers: 10
  • Forks: 3
  • Open Issues: 2
  • Releases: 25
Created about 3 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License Code of conduct

README.md

@crowdstrike/foundry-js

@crowdstrike/foundry-js

The foundry-js JavaScript library provides convenient access to CrowdStrike's Foundry API for authoring UI pages and extensions.

Installation

```sh npm install @crowdstrike/foundry-js

or

yarn add @crowdstrike/foundry-js

or

pnpm add @crowdstrike/foundry-js ```

Overview 🔎

SDK provides abstractions to build Foundry Pages, Extensions and interact with Foundry artifacts - Workflows, Collections, LogScale, API Integrations and CrowdStrike APIs.

Usage

When application starts, it should establish connection to Falcon Console. If connection is not establishes in first 5 seconds - app or extension will be dropped from loading on the page.

```javascript import FalconApi from '@crowdstrike/foundry-js';

(async () => { const falcon = new FalconApi();

await falcon.connect(); }); ```

Receive events from Falcon Console

When UI extensions is loaded, it might receive data for the context it is loaded, for example if UI extension was built for Detection side panel, it will receive detection associated data. If data is updated in Falcon Console - event will automatically execute and pass new data.

javascript (async () => { falcon.events.on('data', (data) => { // store received `data` and use it inside your application }); });

Working with Workflows

To call on-demand workflow:

```javascript (async () => { const config = { name: 'WorkflowName', depth: 0 };

const pendingResult = await falcon.api.workflows.postEntitiesExecuteV1({}, config);

const result = await falcon.api.workflows.getEntitiesExecutionResultsV1({ ids: triggerResult.resources[0] });
}); ```

Working with Collections

```javascript (async () => { const sampleData = { "name": "John", "age": 42, "aliases": ["Doe", "Foundry"] };

const collection = falcon .collection({collection: '' });

// to write a collection const result = await collection.write('test-key', sampleData);

// read collection const record = await collection.read('test-key'); // record.age === 42

// search collection, filter does NOT use FQL (Falcon Query Language). An exact match for the name has to be used in this example below const searchResult = await collection.search({ filter: name:'exact-name-value' });

// list the object keys in the collection, pagination is supported using; start, end and limit. const listResult = await collection.list({ start, end, limit });

// deletes record const deleteResponse = await collection.delete('test-key'); }); ```

Working with LogScale

```javascript (async () => { // write to LogScale const writeResult = await falcon.logscale.write({ test: 'check' }); // writeResult.resources?.[0]?.rows_written === 1

// run dynamic query const queryResult = await falcon.logscale.query({ searchquery: "*", start: "1h" }); // queryResult.resources?.[0]?.eventcount > 0

// run saved query const savedQueryResult = await falcon.logscale.savedQuery({ id: "", start: "30d", mode: 'sync' }); // savedQueryResult.resources?.[0]?.event_count > 0 }); ```

Working with API Integration

To call API Integration, App should be initially provisioned, and configuration for API Integration should be set up.

```javascript (async () => { // we assume, that API Integration was created and operation Get Cities exists

const apiIntegration = falcon.apiIntegration({ definitionId: '', operationId: 'Get Cities', });

const response = await apiIntegration.execute({ request: { params: { path: { country: 'Spain' } } } }); // response.resources?.[0]?.statuscode === 200 // date is at response.resources[0].responsebody }); ```

Working with Cloud Functions

```javascript (async () => { const config = { name: 'CloudFunctionName', version: 1 };

const cloudFunction = falcon.cloudFunction(config);

// you can specify path parameters that will be passsed to your Cloud Function. // id and mode - example query params that your Cloud Function will receive const getResponse = await cloudFunction.path('/?id=150&mode=compact') .get();

// you can call different HTTP methods - GET, POST, PATCH, PUT, DELETE const postResponse = await cloudFunction.path('/') .post({ name: 'test' });

const patchResponse = cloudFunction.path('/') .patch({ name: 'test' });

const putResponse = cloudFunction.path('/') .put({ name: 'test' });

const deleteResponse = cloudFunction.path('/?id=100') .delete(); }); ```

Navigation utilities

As Page or UI extension will run inside sandboxed iframe, clicking links or navigating will be limited. When browser URL changes, Foundry UI Page will receive that data via iframe hash change event. You can listen to hash change event and process your app internal navigation.

```javascript window.addEventListener("hashchange", (event) => { let rawHash = new URL(event.newURL).hash;

const path = rawHash.substring(1); }, false);

// to read initial hash when your app loads: const initialPath = document.location.hash.substring(1); ```

If you have links in your application, that point to the internal URLs of your application (for example navigation from /page-1 to /page-2) - you can add data- attribute to those links, and add onClick handler, that will handle navigation outside of iframe and will update iframe hash.

javascript // find all links with data attribute - `data-internal-link` document.querySelector('[data-internal-link]') .addEventListener('click', (event) => falcon.navigation.onClick(event, '_self', 'internal'));

If you have external links that you want to navigate to, for example www.crowdstrike.com, you can add data- attribute to identify those:

javascript // find all links with data attribute - `data-external-link` document.querySelector('[data-external-link]') .addEventListener('click', (event) => falcon.navigation.onClick(event));

Modal utility

To open a modal within Falcon Console, rendering UI extension of your choice:

```javascript const result = await api.ui.openModal( { id: '', type: 'extension' // 'extension' | 'page' }, 'Modal title', { path: '/', // initial path that will be set when page or extension loads
data: { foo: 'bar' }, // data to pass to the modal size: 'lg', // width of the modal - 'sm', 'md', 'lg', 'xl'. 'md' is default align: 'top', // vertical alignment - 'top' or undefined } // OpenModalOptions );

// to close modal: await api.ui.closeModal();

await api.ui.closeModal({ foo: 'bar' });// you can pass payload ```

Sample apps

| Application | Framework | |------------------------------------------------------------------------------------|-----------| | Triage with MITRE Attack | Vue | | Scalable RTR | React | | Rapid Response | React |

Additionally

| | Description | |-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------| | Javascript Blueprint | Starter Javascript blueprint used in Foundry CLI | | React Blueprint | Starter React blueprint used in Foundry CLI | | Falcon Shoelace | Shoelace Library of web components styled to fit in Falcon Console |

Owner

  • Name: CrowdStrike
  • Login: CrowdStrike
  • Kind: organization
  • Email: github@crowdstrike.com
  • Location: United States of America

GitHub Events

Total
  • Create event: 80
  • Release event: 4
  • Issues event: 5
  • Watch event: 4
  • Delete event: 53
  • Issue comment event: 111
  • Push event: 176
  • Pull request review comment event: 5
  • Pull request review event: 73
  • Pull request event: 147
  • Fork event: 2
Last Year
  • Create event: 80
  • Release event: 4
  • Issues event: 5
  • Watch event: 4
  • Delete event: 53
  • Issue comment event: 111
  • Push event: 176
  • Pull request review comment event: 5
  • Pull request review event: 73
  • Pull request event: 147
  • Fork event: 2

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 147
  • Total Committers: 11
  • Avg Commits per committer: 13.364
  • Development Distribution Score (DDS): 0.639
Past Year
  • Commits: 38
  • Committers: 6
  • Avg Commits per committer: 6.333
  • Development Distribution Score (DDS): 0.395
Top Committers
Name Email Commits
Simon Ihmig s****g@g****m 53
Ruslan Zavacky r****y@c****m 28
github-actions[bot] g****] 23
dependabot[bot] 4****] 23
Paul Rosset p****t@c****m 5
Rob Lucha r****a@c****m 4
Youri Svahn y****n@c****m 3
Matt Raible m****e@c****m 2
Ade Adesokan a****n@c****m 2
Ryan Hinchey r****y@c****m 2
Drew Neil d****l@c****m 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 5
  • Total pull requests: 218
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 7 days
  • Total issue authors: 5
  • Total pull request authors: 11
  • Average comments per issue: 1.8
  • Average comments per pull request: 0.84
  • Merged pull requests: 154
  • Bot issues: 0
  • Bot pull requests: 154
Past Year
  • Issues: 3
  • Pull requests: 162
  • Average time to close issues: 3 days
  • Average time to close pull requests: 3 days
  • Issue authors: 3
  • Pull request authors: 7
  • Average comments per issue: 1.33
  • Average comments per pull request: 0.94
  • Merged pull requests: 103
  • Bot issues: 0
  • Bot pull requests: 136
Top Authors
Issue Authors
  • dweissbacher (1)
  • rhinchey-cs (1)
  • Res260 (1)
  • rmchapa (1)
  • mraible (1)
Pull Request Authors
  • dependabot[bot] (126)
  • github-actions[bot] (28)
  • simonihmig (20)
  • RuslanZavacky (9)
  • mraible (8)
  • karbi-cs (7)
  • rhinchey-cs (6)
  • cs-ade-adesokan (5)
  • rlucha-crowdstrike (4)
  • PaulRosset (3)
  • nelstrom (2)
Top Labels
Issue Labels
Pull Request Labels
dependencies (126) javascript (120) github_actions (6) bug (1)

Packages

  • Total packages: 1
  • Total downloads:
    • npm 1,296 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 26
  • Total maintainers: 2
npmjs.org: @crowdstrike/foundry-js

foundry-js is the JavaScript SDK for authoring UI Extensions for CrowdStrike's Foundry platform.

  • Versions: 26
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,296 Last month
Rankings
Downloads: 9.1%
Average: 33.5%
Dependent repos count: 37.5%
Dependent packages count: 54.0%
Last synced: 11 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/push-dist.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • kategengler/put-built-npm-package-contents-on-branch v1.0.0 composite
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • changesets/action v1 composite
package.json npm
  • @changesets/changelog-github ^0.4.8 development
  • @changesets/cli ^2.26.2 development
  • @rollup/plugin-node-resolve 14.1.0 development
  • @rollup/plugin-replace ^5.0.2 development
  • @rollup/plugin-typescript 11.0.0 development
  • @types/uuid 9.0.1 development
  • @typescript-eslint/eslint-plugin ^5.59.2 development
  • @typescript-eslint/parser ^5.59.2 development
  • concurrently ^8.0.1 development
  • eslint ^8.40.0 development
  • eslint-config-prettier ^9.0.0 development
  • eslint-plugin-import ^2.28.1 development
  • eslint-plugin-prettier ^5.0.0 development
  • eslint-plugin-sort-imports-es6-autofix ^0.6.0 development
  • happy-dom ^9.10.9 development
  • p-event ^5.0.1 development
  • prettier ^3.0.3 development
  • rollup 2.79.1 development
  • tslib 2.5.0 development
  • typedoc ^0.25.1 development
  • typedoc-plugin-missing-exports ^2.1.0 development
  • typedoc-plugin-rename-defaults ^0.6.6 development
  • typescript 5.0.2 development
  • vitest ^0.31.0 development
  • emittery ^1.0.1
  • typescript-memoize ^1.1.1
  • uuid 9.0.0
yarn.lock npm
  • 548 dependencies