
SecureML - AL 모델 보안 및 워터마킹
OpenSSF Model Signing 기반 엔터프라이즈급 AI 모델 보안
SecureAIML은 "모델 보안의 Stripe"입니다. 엔터프라이즈급 AI 모델 보호를 모든 조직이 접근 가능하고, 사용자 친화적이며, 프로덕션에 바로 사용할 수 있는 수준으로 만들어 줍니다.
AI/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은 필요에 맞는 4가지 보안 레벨을 제공합니다:
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]")
from transformers import AutoModel
from secureml import SecureModel
model = AutoModel.from_pretrained("bert-base-uncased")
model.save_pretrained("./my_model")
secure_model = SecureModel.load_from_path("./my_model")
secure_model.sign_and_save("bert_model.sml", identity="[email protected]")
# Basic installation
pip install secureaiml
# With ML framework support
pip install secureaiml[xgboost,pytorch,sklearn]
# With CLI tools
pip install secureaiml[cli]
# Everything (all ML frameworks + CLI + dev tools)
pip install secureaiml[all]
# Sign a model
secureml sign model.pkl --identity "[email protected]" --output model.sml
# Verify a model
secureml verify model.sml
# Get model info
secureml info model.sml
# Validate compliance
secureml compliance model.sml --framework soc2 --framework iso27001
# Generate audit report
secureml audit --start-date 2024-01-01 --end-date 2024-12-31 --output audit.json
import mlflow
from secureml.integrations.mlflow_integration import SecureMLflowModel
with mlflow.start_run():
model = train_model()
# Log with SecureML
secure_model = SecureMLflowModel(model)
secure_model.log_model(
"model",
signature=True,
identity="[email protected]"
)
from secureml.integrations.huggingface_integration import SecureHFModel
secure_model = SecureHFModel.from_pretrained("bert-base-uncased")
secure_model.sign(identity="[email protected]")
secure_model.push_to_hub("my-org/secure-bert", signed=True)
기여를 환영합니다! 자세한 내용은 CONTRIBUTING.md를 참조하세요.
보안 문제가 있는 경우 SECURITY.md를 참조하세요.
Apache 2.0 - 자세한 내용은 LICENSE를 참조하세요.
다음을 기반으로 구축되었습니다:
SecureAIML은 ML 모델 보안을 모든 사람이 쉽게 이용할 수 있도록 하는 데 중점을 둔 OWASP 프로젝트입니다.
SecureAIML - AI 모델 보안을 모든 사람이 이용할 수 있도록 🚀
OWASP 프로젝트
| 레벨 | 사용 사례 | 기능 |
|---|
| BASIC | 개발, 테스트 | OpenSSF 서명만 |
| STANDARD | 프로덕션 배포 | + 핑거프린팅, 감사 로깅 |
| ENTERPRISE | 규제 산업 | + Merkle 트리, 위협 탐지, 규정 준수 |
| MAXIMUM | 고보안 환경 | + 암호화, 포렌식, 다중 서명 |