Skip to main content

SecAutoBan SDK

Project description

SecAutoBan Python SDK

安装

pip3 install SecAutoBan

样例

告警模块

from SecAutoBan import SecAutoBan

def alarm_analysis(ws_client):
    ws_client.send_alarm("127.1.0.3", "NMAP 扫描 127.0.0.1")

sec_auto_ban = SecAutoBan(
    server_ip="127.0.0.1",
    server_port=8000,
    sk="sk-*****",
    client_type="alarm",
    alarm_analysis = alarm_analysis
)
sec_auto_ban.run()

封禁模块

from SecAutoBan import SecAutoBan

def block_ip(ip):
    if check_exist_ip(ip):
        return
    pass

def unblock_ip(ip):
    pass

def get_all_block_ip() -> list:
    ip_list = []
    return ip_list

def check_exist_ip(ip) -> bool:
    return ip in get_all_block_ip()

sec_auto_ban = SecAutoBan(
    server_ip="127.0.0.1",
    server_port=8000,
    sk="sk-*****",
    client_type="block",
    block_ip = block_ip,
    unblock_ip = unblock_ip,
    get_all_block_ip= get_all_block_ip
)
sec_auto_ban.run()

参数说明

参数 描述 是否需要填写
server_ip 核心模块回连IP 需要
server_port 核心模块回连端口 需要
sk 设备页面生成的密钥 需要
client_type 模块类型(alarm/block) 需要
alarm_analysis 告警分析函数 alarm模块必填
block_ip 封禁函数 block模块必填
unblock_ip 解禁函数 block模块必填
get_all_block_ip 获取设备中全部封禁IP函数 block模块可选

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

secautoban-1.3.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file secautoban-1.3.tar.gz.

File metadata

  • Download URL: secautoban-1.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for secautoban-1.3.tar.gz
Algorithm Hash digest
SHA256 15d9057bd5f739492d6b979687cc45be2ba630d5710ba6856aba16dd297b0efe
MD5 8f6d258cf67ace1c066814d3316d5f94
BLAKE2b-256 2d6746c291fb30bb01fe697ac0fc4f5c2fed2426de50a4a96c71afafa9b3b55c

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