ML Infrastructure Security Intermediate
The infrastructure supporting AI systems - model registries, training pipelines, GPU clusters, and serving platforms - presents traditional IT security risks amplified by the high value of ML assets. This lesson covers security testing of ML infrastructure components, supply chain assessment, and container security for AI deployments.
ML Infrastructure Components
| Component | Examples | Key Risks |
|---|---|---|
| Model Registry | MLflow, SageMaker Registry, Vertex AI | Unauthorized model access, model replacement, metadata tampering |
| Feature Store | Feast, Tecton, SageMaker Feature Store | Feature poisoning, unauthorized access to sensitive features |
| Training Pipelines | Kubeflow, Airflow, SageMaker Pipelines | Pipeline injection, credential theft, resource hijacking |
| Serving Platform | TorchServe, TF Serving, Triton, KServe | Deserialization attacks, container escape, resource exhaustion |
| Notebook Servers | JupyterHub, SageMaker Studio, Colab | Code execution, credential exposure, lateral movement |
Model Registry Security
Model registries store trained models, metadata, and deployment configurations. Test for:
- Access control - Can unauthorized users download model artifacts or weights?
- Model integrity - Are model checksums verified during deployment?
- Version control - Can an attacker replace a model version with a backdoored copy?
- Metadata exposure - Do model cards or metadata reveal sensitive training details?
- API authentication - Are registry APIs protected against unauthorized access?
Training Pipeline Security
Training pipelines often run with elevated privileges and access sensitive data:
- Pipeline injection - Can an attacker modify pipeline definitions to inject malicious training steps?
- Credential management - Are API keys, database credentials, or cloud tokens properly secured?
- Data access controls - Can training jobs access data outside their intended scope?
- Compute hijacking - Can GPU resources be diverted for cryptocurrency mining?
- Artifact integrity - Are intermediate artifacts (checkpoints, features) verified?
Container and Serving Security
ML serving often uses containers with ML frameworks that have large attack surfaces:
CONTAINER SECURITY CHECKS: [ ] Base images scanned for CVEs [ ] ML framework versions checked for known vulnerabilities [ ] No unnecessary packages installed (minimize attack surface) [ ] Containers run as non-root user [ ] Read-only file system where possible [ ] Network policies restrict container communication [ ] Secrets not baked into images [ ] Resource limits set (CPU, memory, GPU) DESERIALIZATION RISKS: [ ] Pickle files not loaded from untrusted sources [ ] SafeTensors used instead of pickle for model weights [ ] Custom deserialization code reviewed for vulnerabilities [ ] Model loading sandboxed or restricted
torch.save() or pickle.dump() can contain arbitrary Python code that executes on load. Always use safe serialization formats like SafeTensors or ONNX for untrusted models.
Supply Chain Assessment
- Audit all ML framework dependencies for known CVEs
- Verify checksums and signatures for pretrained models downloaded from model hubs
- Scan pip/conda packages for typosquatting (e.g.,
tensorfowvstensorflow) - Review third-party dataset provenance and integrity
- Assess CI/CD pipeline security for training and deployment workflows
Ready for Best Practices?
The final lesson covers professional report writing, continuous testing strategies, and building an AI penetration testing practice.
Next: Best Practices →Ready to Go Deeper?
Live instructor-led courses from our partners. Affiliate disclosure.
AI & ML Courses - 30% Off
Live instructor-led AI, machine learning, data science, and cloud courses for working professionals. Use code Limited30 at checkout.
EdurekaDataCamp - AI & Data Science
Hands-on Python, machine learning, and AI courses with interactive exercises and real projects.
DataCampedX - Top AI Courses
University-level AI courses from MIT, Harvard, Stanford. Earn certificates that employers recognize.
edX