melek-shell 🛡️
Melek AI Asistan Projesi'nin 20x Gelişmiş, Sıfır-Güven (Zero-Trust) Güvenlik Kalkanlı ve Asenkron Gölge Terminal Köprüsü.
Bu kütüphane, Windows işletim sistemi üzerinde çalışan yapay zeka asistanlarının sistem komutlarını güvenli, arındırılmış ve oturum durumunu (dizin hafızası) koruyacak şekilde çalıştırmasını sağlar.
✨ 20x Güvenlik ve Mimari Özellikleri
- Oturum/Dizin Hafızası (Stateful CWD):
cdkomutunu özel olarak algılar, tırnaklı/boşluklu yolları yönetir ve sonraki komutların o dizinde çalışmasını garanti eder. - Gelişmiş Güvenlik Duvarı & Base64 Payload Denetimi:
rmdir /s,del /f /s,format,diskpart,reg deletegibi tehlikeli CMD komutlarını engeller.Remove-Item -Recurse -Force,Format-Volumegibi PowerShell yıkım komutlarını engeller.- Şifreli Kod Çözücü:
powershell -enc <base64>şeklinde gizlenmiş zararlı komutları arka planda UTF-16LE çözüp içeriğindeki zararlı kodları yakalar ve engeller.
- Ortam Değişkeni Arındırma (Environment Sanitization):
- Alt süreçlerin ortam değişkenlerinden gizli API anahtarlarını, PyPI tokenlarını veya kimlik bilgilerini okumasını önler (
sanitize_env=True).
- Alt süreçlerin ortam değişkenlerinden gizli API anahtarlarını, PyPI tokenlarını veya kimlik bilgilerini okumasını önler (
- Yetim Süreç ve Ağaç Temizleyici (Process Tree Killer):
- Zaman aşımına uğrayan komutların arkasında kalan tüm çocuk/torun süreçleri (
psutilile) 2 saniyelik grace süresinin ardından zorla temizler.
- Zaman aşımına uğrayan komutların arkasında kalan tüm çocuk/torun süreçleri (
- Çift Kanallı Canlı Akış (Streaming):
stdoutvestderrçıktılarını birbirine karıştırmadan gerçek zamanlı olarak stream callback fonksiyonuna iletir. - Denetim Kayıtları (Audit Logging): Çalıştırılan veya engellenen tüm komutları, çalışma sürelerini ve durumlarını hafızada denetim amacıyla saklar (
get_audit_log()). - Akıllı Takma Adlar (Alias): Sık kullanılan komutlar için kısayol tanımları sağlar.
🚀 Kurulum
pip install melek-shell
💻 Kullanım Örnekleri
from melek_shell import MelekShellController
# Güvenlik kalkanı ve ortam arındırması aktif başlat
shell = MelekShellController(default_timeout=20, sanitize_env=True)
# 1. Normal Komut Çalıştırma
result = shell.execute_command("echo Melek AI Çekirdek Hazır")
print(result["stdout"])
# 2. Dizin Değiştirme Hafızası
shell.execute_command('cd "C:\\Windows"')
res = shell.execute_command("dir")
print("C:\\Windows altındaki dosya satır sayısı:", len(res["stdout"]))
# 3. Güvenlik Duvarı Engellemesi
res_blocked = shell.execute_command("format d:")
print("Engellendi mi?:", not res_blocked["success"])
print("Hata:", res_blocked["stderr"])
# 4. Denetim Günlüğü
print("Son loglar:", shell.get_audit_log(limit=3))
Metadata
Release files for melek-shell 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| melek_shell-1.0.0.tar.gz | 12.4 kB | Without provenance | Details for melek_shell-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| melek_shell-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for melek_shell-1.0.0-py3-none-any.whl |
Total release size: 21.4 kB
Release files / melek_shell-1.0.0.tar.gz
| Download URL | melek_shell-1.0.0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3707f610e505ba6e9f3394a4d1a2e75c4cb83e063932df24b8ac1c2df888f2b3
|
|
BLAKE2b-256 checksum How to use checksums |
07236593dad5eafa3b1b175caa30f2110fb83491213383790b7b248545768eb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|
Release files / melek_shell-1.0.0-py3-none-any.whl
| Download URL | melek_shell-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f80bdc79445515fa5d8ebb68eabe1c6aa53288a6eeab10887eb96dc9122d704
|
|
BLAKE2b-256 checksum How to use checksums |
090462881d82f87f1ebc10ae002df749d2d596b5687f5258fe011751f7f87563
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|
Security for melek-shell 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.