feat: Add login page with dynamic RGB effects and password toggle functionality

feat: Implement package management utilities with JSON endpoints for listing and uninstalling packages

feat: Create plugin management utilities with endpoints for listing, configuring, and installing plugins

feat: Develop schedule and trigger management utilities with CRUD operations for schedules and triggers
This commit is contained in:
infinition
2026-03-19 00:40:04 +01:00
parent 3fa4d5742a
commit b0584a1a8e
176 changed files with 7795 additions and 1781 deletions

View File

@@ -0,0 +1,69 @@
"""example_notifier.py - Example Bjorn plugin that logs events to the console.
This plugin demonstrates how to:
- Extend BjornPlugin
- Use config values from plugin.json config_schema
- Subscribe to hooks (on_credential_found, on_vulnerability_found, etc.)
- Use the PluginLogger for namespaced logging
- Access the database via self.db
Copy this directory as a starting point for your own plugin!
"""
from bjorn_plugin import BjornPlugin
class ExampleNotifier(BjornPlugin):
"""Logs security events to the Bjorn console."""
def setup(self):
"""Called once when the plugin is loaded."""
self.prefix = self.config.get("custom_prefix", "ALERT")
self.log.info(f"Example Notifier ready (prefix={self.prefix})")
def teardown(self):
"""Called when the plugin is unloaded."""
self.log.info("Example Notifier stopped")
# ── Hook implementations ─────────────────────────────────────────
def on_host_discovered(self, host):
"""Fired when a new host appears on the network."""
mac = host.get("mac_address", "?")
ips = host.get("ips", "?")
self.log.info(f"[{self.prefix}] New host: {mac} ({ips})")
def on_credential_found(self, cred):
"""Fired when a new credential is stored in the DB."""
if not self.config.get("log_credentials", True):
return
service = cred.get("service", "?")
user = cred.get("user", "?")
ip = cred.get("ip", "?")
self.log.success(
f"[{self.prefix}] Credential found! {service}://{user}@{ip}"
)
def on_vulnerability_found(self, vuln):
"""Fired when a new vulnerability is recorded."""
if not self.config.get("log_vulnerabilities", True):
return
cve = vuln.get("cve_id", "?")
ip = vuln.get("ip", "?")
severity = vuln.get("severity", "?")
self.log.warning(
f"[{self.prefix}] Vulnerability: {cve} on {ip} (severity={severity})"
)
def on_action_complete(self, action_name, success, target):
"""Fired after any orchestrated action finishes."""
if not self.config.get("log_actions", False):
return
status = "SUCCESS" if success else "FAILED"
ip = target.get("ip", "?")
self.log.info(
f"[{self.prefix}] Action {action_name} {status} on {ip}"
)

View File

@@ -0,0 +1,52 @@
{
"id": "example_notifier",
"name": "Example Notifier",
"description": "Logs events to console when credentials or vulnerabilities are found. Use as a template for building your own plugins.",
"author": "Bjorn Team",
"version": "1.0.0",
"license": "MIT",
"type": "notifier",
"main": "example_notifier.py",
"class": "ExampleNotifier",
"tags": ["example", "template", "notifier"],
"config_schema": {
"log_credentials": {
"type": "boolean",
"label": "Log new credentials",
"default": true,
"help": "Log to console when new credentials are discovered"
},
"log_vulnerabilities": {
"type": "boolean",
"label": "Log new vulnerabilities",
"default": true,
"help": "Log to console when new vulnerabilities are found"
},
"log_actions": {
"type": "boolean",
"label": "Log action completions",
"default": false,
"help": "Log every action result (can be noisy)"
},
"custom_prefix": {
"type": "string",
"label": "Log prefix",
"default": "ALERT",
"help": "Custom prefix for log messages"
}
},
"hooks": [
"on_credential_found",
"on_vulnerability_found",
"on_action_complete",
"on_host_discovered"
],
"requires": {
"pip": [],
"system": [],
"bjorn_min_version": "1.0.0"
}
}