
SecureML - Защита моделей AL и нанесение водяных знаков
Безопасность ИИ-моделей корпоративного уровня на базе OpenSSF Model Signing
SecureAIML — это «Stripe для безопасности моделей»: он делает защиту ИИ-моделей корпоративного уровня доступной, удобной и готовой к продакшену для любой организации.
В эпоху ИИ/ML безопасность моделей критически важна. SecureAIML заключает мощный стандарт OpenSSF Model Signing в интуитивно понятный, готовый к использованию в корпоративной среде интерфейс, который делает защиту ваших ML-моделей такой же простой, как:
pip install secureaiml
from secureml import SecureModel
import joblib
# Load your model
model = joblib.load("model.pkl")
# Secure it in one line
secure_model = SecureModel(model)
secure_model.sign_and_save("model.sml", identity="[email protected]")
# Load and verify
verified_model = SecureModel.load("model.sml", verify=True)
predictions = verified_model.predict(X_test)
from secureml import SecureModel
import joblib
# Train your model (any framework)
from xgboost import XGBClassifier
model = XGBClassifier()
model.fit(X_train, y_train)
# Secure it
secure_model = SecureModel(model)
secure_model.sign_and_save(
"fraud_detection_model.sml",
identity="[email protected]",
version="2.0.0",
description="Production fraud detection model"
)
# Load and verify
model = SecureModel.load("fraud_detection_model.sml", verify=True)
if model.is_verified:
predictions = model.predict(X_test)
from secureml.api.advanced import AdvancedSecureModel
from secureml.utils.config import SecurityConfig, SecurityLevel, ComplianceFramework
# Configure enterprise security
config = SecurityConfig.from_level(SecurityLevel.ENTERPRISE)
config.enable_fingerprinting = True
config.enable_merkle_trees = True
config.compliance_frameworks = [ComplianceFramework.SOC2, ComplianceFramework.ISO27001]
# Create advanced secure model
advanced = AdvancedSecureModel(model, config=config)
# Sign with AWS KMS
advanced.add_signature(
identity="[email protected]",
use_cloud_kms=True,
kms_key_id="arn:aws:kms:us-east-1:123456789:key/abc-def",
cloud_provider="aws"
)
# Validate compliance
compliance_report = advanced.validate_compliance(
frameworks=[ComplianceFramework.SOC2, ComplianceFramework.HIPAA],
generate_report=True,
report_path="compliance_report.json"
)
print(f"Compliance Status: {compliance_report['overall_status']}")
SecureML построен как слой расширения поверх OpenSSF Model Signing:
┌─────────────────────────────────────────────────────┐
│ Your Application │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ SecureML API Layer │
│ • Simple API • Advanced API • CLI │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ SecureML Enterprise Features │
│ • HSM/KMS • Compliance • Audit • Forensics │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ OpenSSF Model Signing (Core) │
│ Sigstore Infrastructure │
└─────────────────────────────────────────────────────┘
SecureML предоставляет четыре уровня безопасности для любых потребностей:
| Уровень | Вариант использования | Возможности |
|---|---|---|
| BASIC | Разработка, тестирование | Только подпись OpenSSF |
| STANDARD | Продакшен-развёртывания | + Fingerprinting, журналирование аудита |
| ENTERPRISE | Регулируемые отрасли | + Деревья Меркла, обнаружение угроз, соответствие требованиям |
| MAXIMUM | Среды с высокими требованиями безопасности | + Шифрование, форензика, мультиподпись |
SecureML помогает соответствовать регуляторным требованиям:
from secureml import SecureModel
import xgboost as xgb
model = xgb.XGBClassifier()
model.fit(X_train, y_train)
secure_model = SecureModel(model)
secure_model.sign_and_save("xgb_model.sml", identity="[email protected]")
import torch
from secureml import SecureModel
model = torch.nn.Sequential(...)
torch.save(model.state_dict(), "model.pth")
secure_model = SecureModel.load_from_path("model.pth")
secure_model.sign_and_save("pytorch_model.sml", identity="[email protected]")