Sign inSign up

browsertotal/browsertotal-scanner

By browsertotal

•Updated 9 months ago

Scan URLs, browser extensions, IDE plugins, and packages for security threats using BrowserTotal.com

Image
Security
Machine learning & AI
Developer tools
1

752

browsertotal/browsertotal-scanner repository overview

BrowserTotal

⁠BrowserTotal Scanner Docker

docker version image size node version

REST API for scanning URLs, browser extensions, IDE plugins, and packages using BrowserTotal.com⁠


⁠Overview

A containerized REST API that wraps the @browsertotal/scanner⁠ package, providing an easy-to-deploy service for security scanning.

Features:

  • Scans URLs, browser extensions, IDE plugins, and packages
  • Pre-configured Chromium for headless scanning
  • Simple REST API interface
  • Docker-ready for easy deployment

⁠Quick Start

⁠Pull from Docker Hub
docker pull browsertotal/browsertotal-scanner
⁠Run the Container
docker run -p 3000:3000 --shm-size=4g --tmpfs /tmp:size=20G browsertotal/browsertotal-scanner
⁠Verify It's Running
curl http://localhost:3000/health

⁠API Reference

⁠Health Check
GET /health

Response:

{
  "status": "ok",
  "version": "1.0.0"
}

⁠Scan URL
POST /api/scan/url

Request:

curl -X POST http://localhost:3000/api/scan/url \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Response:

{
  "url": "https://example.com",
  "status": "low",
  "score": 0,
  "threats": [],
  "scanUrl": "https://browsertotal.com/analysis/...",
  "timestamp": "2024-01-15T10:30:00.000Z"
}

⁠Scan Browser Extension
POST /api/scan/extension

Supported stores: chrome, firefox, edge, opera, safari, brave

Request:

curl -X POST http://localhost:3000/api/scan/extension \
  -H "Content-Type: application/json" \
  -d '{"extensionId": "cjpalhdlnbpafiamejdnhcphjbkeiagm", "store": "chrome"}'

⁠Scan VS Code Extension
POST /api/scan/vscode

Request:

curl -X POST http://localhost:3000/api/scan/vscode \
  -H "Content-Type: application/json" \
  -d '{"extensionId": "ms-python.python"}'

⁠Scan OpenVSX Extension
POST /api/scan/openvsx

Request:

curl -X POST http://localhost:3000/api/scan/openvsx \
  -H "Content-Type: application/json" \
  -d '{"extensionId": "rust-lang.rust-analyzer"}'

⁠Scan JetBrains Plugin
POST /api/scan/jetbrains

Request:

curl -X POST http://localhost:3000/api/scan/jetbrains \
  -H "Content-Type: application/json" \
  -d '{"pluginId": "7724"}'

⁠Scan npm Package
POST /api/scan/npm

Request:

curl -X POST http://localhost:3000/api/scan/npm \
  -H "Content-Type: application/json" \
  -d '{"packageName": "lodash"}'

⁠Scan PyPI Package
POST /api/scan/pypi

Request:

curl -X POST http://localhost:3000/api/scan/pypi \
  -H "Content-Type: application/json" \
  -d '{"packageName": "requests"}'

⁠Scan WordPress Plugin
POST /api/scan/wordpress

Request:

curl -X POST http://localhost:3000/api/scan/wordpress \
  -H "Content-Type: application/json" \
  -d '{"pluginSlug": "akismet"}'

⁠Scan Hugging Face Model
POST /api/scan/huggingface

Request:

curl -X POST http://localhost:3000/api/scan/huggingface \
  -H "Content-Type: application/json" \
  -d '{"modelId": "bert-base-uncased"}'

⁠Scan AppSource Add-in
POST /api/scan/appsource

Request:

curl -X POST http://localhost:3000/api/scan/appsource \
  -H "Content-Type: application/json" \
  -d '{"addinId": "WA104379633"}'

⁠Scan PowerShell Module
POST /api/scan/powershell

Request:

curl -X POST http://localhost:3000/api/scan/powershell \
  -H "Content-Type: application/json" \
  -d '{"moduleName": "Az"}'

⁠Scan Salesforce App
POST /api/scan/salesforce

Request:

curl -X POST http://localhost:3000/api/scan/salesforce \
  -H "Content-Type: application/json" \
  -d '{"appId": "some-app-id"}'

⁠Generic Platform Scan
POST /api/scan/platform

Supported platforms: vscode, openvsx, jetbrains, npmjs, pypi, wordpress, huggingface, appsource, powershellgallery, salesforce, chrome, firefox, edge, opera, safari, brave

Request:

curl -X POST http://localhost:3000/api/scan/platform \
  -H "Content-Type: application/json" \
  -d '{"identifier": "lodash", "platform": "npmjs"}'

⁠Configuration

⁠Environment Variables
VariableDefaultDescription
PORT3000Server port
CHROMIUM_PATH/usr/bin/chromium-browserPath to Chromium executable
DISABLE_AItrueDisable AI analysis for faster scans
SCAN_TIMEOUT420000Scan timeout in milliseconds (7 minutes)
⁠Docker Run Options
OptionRequiredDescription
--shm-size=4gYesShared memory for Chromium
--tmpfs /tmp:size=20GYesTemp filesystem for browser profiles

⁠Docker Compose

version: '3.8'

services:
  browsertotal-scanner:
    image: browsertotal/browsertotal-scanner
    ports:
      - "3000:3000"
    environment:
      - PORT=3000
      - DISABLE_AI=true
      - SCAN_TIMEOUT=420000
    shm_size: '4gb'
    tmpfs:
      - /tmp:size=20G
    restart: unless-stopped

⁠Building from Source

git clone https://github.com/AzureMarker/BrowserTotal.git
cd sdks/browsertotal-scanner-docker

# Build
docker build -t browsertotal/browsertotal-scanner .

# Run
docker run -p 3000:3000 --shm-size=4g --tmpfs /tmp:size=20G browsertotal/browsertotal-scanner

⁠Response Types

⁠Risk Status
StatusDescription
criticalCritical security threat detected
highHigh-risk security issues
mediumMedium-risk concerns
lowLow or no risk detected
unknownUnable to determine risk level
errorScan failed
⁠Scan Result Fields
FieldTypeDescription
statusstringRisk level (see above)
scorenumberNumeric risk score (0-100)
threatsarrayList of detected threats
scanUrlstringURL to full analysis on BrowserTotal
timestampstringISO 8601 timestamp
rawobjectFull analysis data including AI results


⁠License

MIT

Tag summary

Content type

Image

Digest

sha256:774de317d…

Size

380.5 MB

Last updated

9 months ago

docker pull browsertotal/browsertotal-scanner