A Python implementation of the Ampla security‑analysis pipeline.
This engine replaces the original XSLT system with a modular and testable architecture.
Original XSLT implementation:
https://github.com/Ampla/SecurityAnalysis
- Project structure normalization
- Metadata extraction
- Hash computation
- Property filtering
- Type and reference processing
- Class definition handling
- Expression parsing
- AuthStore normalization
- User, role, and scope mapping
- Specialized transforms:
- CycleManager cycles
- Resolver defaults
- Historical expression annotation
- Home and Favorites counters
- Rule engine
- XPath‑style pattern matching
- Context indexing
- Permission and scope validation
- HTML reporting
- CLI interface
- Python API
- Golden‑file validation
- Functional and integration tests
- Full documentation
- Python 3.10+
lxml
git clone <repository>
cd SecurityAnalysis-master
python3 -m venv .venv
source .venv/bin/activate
pip install .For development:
pip install .[dev]python -m ampla_security.cli.analyze \
--project AmplaProject.xml \
--authstore AuthStore.xml \
--output security_report.html--help
--normalize-only
--verbose
from lxml import etree
from ampla_security.normalization.project_normalizer import ProjectNormalizer
tree = etree.parse("AmplaProject.xml")
normalizer = ProjectNormalizer(tree)
normalized = normalizer.normalize()
users = normalized.getroot().xpath("//Item[@type='Citect.Ampla.StandardItems.User']")
print(len(users))pytest -v
pytest --cov=ampla_securityGolden‑file validation:
python -c "from ampla_security.testing.golden_validator import GoldenValidator; \
GoldenValidator('.').validate_pipeline('synthetic_project.xml', 'synthetic_authstore.xml')"- Modular pipeline: normalization → extraction → analysis → reporting
- Rule engine replaces XSLT templates
- Deterministic hashing
- Structured error handling
- Version‑aware defaults
- Python 3.10+
- lxml 4.6+
- Linux, macOS, Windows
docs/SECURITY_ANALYSIS.mddocs/SECURITY_PIPELINE.mddocs/NORMALIZATION_REFERENCE.mddocs/DEVELOPER_GUIDE.mddocs/VALIDATION_REPORT.md
- Extended rule library
- REST API
- Database backend
- Multi‑project analysis
- Performance improvements