Skip to main content

Omni Security & Intelligence Library โ€” AI, MFT, GCS, CyberSecurity, Internet

Project description

๐Ÿ” OmniSec

Omni Security & Intelligence Python Library AI ยท MFT ยท GCS ยท CyberSecurity ยท Internet

Python License Modules

OmniSec is a unified Python library that brings together five essential domains under one consistent API:

Module Description
๐Ÿค– AI Text analysis, classification, summarisation, threat reporting via Claude API
๐Ÿ“ฆ MFT Managed File Transfer over SFTP/FTPS with AES-256 encryption and audit logs
โ˜๏ธ GCS Google Cloud Storage โ€” upload, download, signed URLs, metadata management
๐Ÿ”’ Security Hashing, AES/RSA encryption, password analysis, IoC extraction, header scoring
๐ŸŒ Internet HTTP client, DNS, port scanning, SSL inspection, IP geolocation, monitoring

๐Ÿ“ฆ Installation

# Base install
pip install omnisec

# With specific extras
pip install omnisec[ai]        # Anthropic Claude support
pip install omnisec[mft]       # SFTP + AES encryption
pip install omnisec[gcs]       # Google Cloud Storage
pip install omnisec[security]  # Full cryptography suite
pip install omnisec[internet]  # HTTP + DNS support
pip install omnisec[all]       # Everything

๐Ÿš€ Quick Start

import omnisec

# โ”€โ”€ AI Engine โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
engine = omnisec.AIEngine(api_key="your-anthropic-key")

summary = engine.summarize("Long document text...", max_sentences=3)
labels  = engine.classify("Suspicious email body", ["phishing", "spam", "legitimate"])
threat  = engine.analyze_security_log("Failed SSH from 10.0.0.5 - 50 attempts")

print(threat)
# {
#   "threat_level": "high",
#   "threat_type": "brute_force",
#   "indicators": ["10.0.0.5", "SSH port 22", "50 failed attempts"],
#   "recommendation": "Block IP 10.0.0.5 and enable fail2ban",
#   "summary": "Brute-force SSH attack detected from 10.0.0.5"
# }


# โ”€โ”€ MFT Client โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
with omnisec.MFTClient(
    host="sftp.example.com",
    username="user",
    key_path="~/.ssh/id_rsa",
    encrypt_transfers=True,
) as mft:
    record = mft.upload("report.pdf", "/remote/reports/report.pdf")
    print(f"SHA-256: {record.sha256}")
    mft.export_audit_csv("audit.csv")


# โ”€โ”€ GCS Client โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
gcs = omnisec.GCSClient(project="my-project", bucket="my-bucket")
gcs.upload("local/data.csv", "datasets/data.csv")
url = gcs.signed_url("datasets/data.csv", expiry_minutes=60)
objects = gcs.list_objects(prefix="datasets/")


# โ”€โ”€ Security Toolkit โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
sec = omnisec.SecurityToolkit()

# Hashing
h = sec.hash("password123", "sha256")
file_hash = sec.hash_file("/var/log/syslog", "sha512")

# AES-256-GCM Encryption
key, nonce, ct = sec.aes_encrypt(b"sensitive data")
plaintext = sec.aes_decrypt(key, nonce, ct)

# String encryption
enc = sec.aes_encrypt_string("top secret message")
plain = sec.aes_decrypt_string(enc)

# Password tools
pwd = sec.generate_password(length=20, use_symbols=True)
strength = sec.check_password_strength("P@ssw0rd!")
print(strength)
# {"score": 72, "strength": "good", "feedback": ["Add uppercase letters."]}

# IoC extraction
iocs = sec.extract_iocs("Malware from 192.168.1.50 hit CVE-2023-1234 via evil.com")
print(iocs["cves"])    # ['CVE-2023-1234']
print(iocs["ipv4"])    # ['192.168.1.50']
print(iocs["domains"]) # ['evil.com']

# Security header analysis
headers = {"Strict-Transport-Security": "max-age=31536000", "X-Frame-Options": "DENY"}
analysis = sec.analyze_headers(headers)
print(f"Score: {analysis['score']}/100  Grade: {analysis['grade']}")

# PBKDF2 password hashing
h, salt = sec.pbkdf2_hash("mypassword")
assert sec.pbkdf2_verify("mypassword", h, salt)


# โ”€โ”€ Internet Toolkit โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
net = omnisec.InternetToolkit(timeout=10, retries=3)

# HTTP
resp = net.get("https://api.ipify.org?format=json")
print(resp["json"]["ip"])

# Port scanning
result = net.port_scan("192.168.1.1", ports=[22, 80, 443, 3306])
for p in result["open_ports"]:
    print(f"  {p['port']}/TCP  {p['service']}")

# SSL inspection
cert = net.ssl_info("google.com")
print(f"Expires in {cert['days_remaining']} days")
print(f"Issuer: {cert['issuer'].get('organizationName')}")

# DNS
records = net.dns_resolve("example.com", "A")
hostname = net.reverse_dns("8.8.8.8")

# IP intelligence
info = net.ip_info("8.8.8.8")
print(f"{info['org']} โ€” {info['city']}, {info['country']}")

# URL monitoring
statuses = net.monitor_urls(["https://google.com", "https://github.com"])
for s in statuses:
    status = "โœ…" if s["ok"] else "โŒ"
    print(f"{status} {s['url']}  {s['elapsed_ms']}ms")

๐Ÿ–ฅ๏ธ CLI Usage

# Hash a string
omnisec hash sha256 "hello world"

# Generate a secure password
omnisec password generate --length 24

# Check password strength
omnisec password check "P@ssword123!"

# Port scan
omnisec port-scan 192.168.1.1 --ports 22 80 443 3306 5432

# SSL certificate info
omnisec ssl-info google.com

# IP geolocation
omnisec ip-info 8.8.8.8

# DNS lookup
omnisec dns google.com --type MX

# URL availability check
omnisec ping https://example.com

# Extract IoCs from text
omnisec extract-iocs "Attack from 10.0.0.1 via CVE-2024-1234"

โš™๏ธ Configuration

from omnisec import OmniConfig

# Programmatic configuration
cfg = OmniConfig(
    ai_model="claude-sonnet-4-6",
    gcs_bucket="my-bucket",
    mft_host="sftp.example.com",
    net_timeout=15,
)
cfg.save("omnisec.json")

# Reload from file
cfg = OmniConfig.load("omnisec.json")

# Environment variables (auto-detected)
# ANTHROPIC_API_KEY, GOOGLE_CLOUD_PROJECT, OMNISEC_GCS_BUCKET,
# OMNISEC_MFT_HOST, OMNISEC_NET_TIMEOUT, etc.

๐Ÿ—‚๏ธ Project Structure

omnisec/
โ”œโ”€โ”€ omnisec/
โ”‚   โ”œโ”€โ”€ __init__.py          # Top-level exports
โ”‚   โ”œโ”€โ”€ cli.py               # CLI entry point
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ config.py        # Centralised OmniConfig
โ”‚   โ”‚   โ””โ”€โ”€ logger.py        # Structured colour logger
โ”‚   โ”œโ”€โ”€ ai/
โ”‚   โ”‚   โ””โ”€โ”€ __init__.py      # AIEngine (Claude API)
โ”‚   โ”œโ”€โ”€ mft/
โ”‚   โ”‚   โ””โ”€โ”€ __init__.py      # MFTClient (SFTP/FTPS + AES)
โ”‚   โ”œโ”€โ”€ gcs/
โ”‚   โ”‚   โ””โ”€โ”€ __init__.py      # GCSClient (Google Cloud Storage)
โ”‚   โ”œโ”€โ”€ security/
โ”‚   โ”‚   โ””โ”€โ”€ __init__.py      # SecurityToolkit (crypto + threat intel)
โ”‚   โ””โ”€โ”€ internet/
โ”‚       โ””โ”€โ”€ __init__.py      # InternetToolkit (HTTP + DNS + scanning)
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_security.py
โ”‚   โ”œโ”€โ”€ test_internet.py
โ”‚   โ””โ”€โ”€ test_mft.py
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ ai_demo.py
โ”‚   โ”œโ”€โ”€ mft_demo.py
โ”‚   โ”œโ”€โ”€ gcs_demo.py
โ”‚   โ”œโ”€โ”€ security_demo.py
โ”‚   โ””โ”€โ”€ internet_demo.py
โ”œโ”€โ”€ setup.py
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

๐Ÿงช Running Tests

pip install omnisec[all] pytest
pytest tests/ -v

๐Ÿ“œ License

MIT License โ€” see LICENSE for details.


๐Ÿค Contributing

Pull requests are welcome. For major changes, open an issue first. Please ensure all tests pass and new features include docstrings and examples.

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

omnisec-1.0.0.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omnisec-1.0.0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file omnisec-1.0.0.tar.gz.

File metadata

  • Download URL: omnisec-1.0.0.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for omnisec-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e4eb150b4a1e3ab6e9526cddcf66631efffd343e6c2cb6e30ae739d299147463
MD5 afe15208feac2fae3f58fab8eed281ce
BLAKE2b-256 7eae019971b3d892e1b0e764522d817d831c951467a9d63828f5289ea5f2d1fb

See more details on using hashes here.

File details

Details for the file omnisec-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: omnisec-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for omnisec-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee5f47b5cd6168056dd9aae73b16286199d020a037f7e4f2be90860884e86469
MD5 78549edfd129e2d79f78f06ea034d622
BLAKE2b-256 b8554e15c1e23839167349cc1a28afd1e5de6856d40b2961770cb2fe21367c28

See more details on using hashes here.

Supported by

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