How akto-api-security/tests-library works
• Test Library: Directories like “Broken-Function-Level-Authorization”, “Broken-User-Authentication”, “Command-Injection”, “Cross-Site-Scripting”, etc. contain YAML files that define specific vulnerability tests.
• Compliance Module: The “compliance” directory contains .conf files that likely define compliance test settings, thresholds, or policies.
• Remediation Content: The “remediation” directory holds Markdown (.md) documents that offer guidelines on how to fix each vulnerability, providing the “answers” to the tests.
• Resources: A “resources” folder that includes support files (e.g., a Geo-Country MMDB, HAR files, token files, and word lists) which likely support test execution or enrichment.
• License and Top-level README: These provide context for overall usage and deployment.
a. API Inventory Module – This is where APIs are ingested from various traffic sources (BurpSuite, AWS logs, gateways, Postman, etc). It maintains a continuous inventory.
b. Test Engine/Execution Module – This component uses the extensive test library (organized by vulnerability types in separate directories) to run business logic and security tests against the collected APIs.
c. Results and Vulnerability Analysis Module – This part collects test outcomes and flags vulnerabilities (from tests like BOLA, command injection, XSS, misconfigurations, etc.).
d. Remediation and Compliance Module – This reads from the “remediation” and “compliance” directories and maps detected issues to remediation steps and compliance validations.
e. Integration and Data Connectors – These represent how the system interfaces with different external traffic sources or tools (APIs from BurpSuite logs, AWS, gateways, etc.) and with CI/CD pipelines.
f. User and Reporting Interface – Although not extensively described in the file tree, based on the “How it works” flow (inventory creation, test execution, runtime vulnerability finding), an interface component is implied that displays dashboards and reports.
Interactions and Data Flows
c. Test Execution: The engine can run a diverse set of tests (each vulnerability category – e.g., “Broken-Object-Level-Authorization”, “CORS-Misconfiguration”, etc.) and outputs test results.
d. Analysis and Reporting: Test results are passed to the Results and Vulnerability Analysis Module. This module then either flags issues to be remediated or logs them for further analysis.
e. Remediation Guidance: When tests detect vulnerabilities, the system maps results to the remediation documentation. This connection assures that security teams know how to fix issues.
f. Dashboard/Interface: Finally, a reporting/user interface shows the API inventory, test results, remediation guidelines, and compliance status for continuous monitoring.
Architectural Patterns and Design Principles
a. Modular/Microservices-like design: Separate modules for test logic, inventory, and compliance. Although in the repo the tests exist as files, at runtime they are integrated into a larger “engine”.
b. Plug-n-Play Integration: “Akto” is advertised as “plug-n-play,” which suggests that connectors to external traffic sources (e.g., BurpSuite, AWS, gateways) are loosely coupled.
c. Separation of Concerns: Each vulnerability category is organized into its own directory, and remediation instructions are separated from test definitions. This maintains clarity and ease of updates.
d. CI/CD Integration: The design should highlight a pipeline connection that triggers security tests in CI/CD and pushes updated results to a central dashboard.
Final Touches
– Show external integrations (traffic ingestion, CI/CD pipeline) and internal repositories (test library, remediation guidelines) as distinct layers.
– Consider including a “Deployment” layer showing the underlying use of Docker containers for self-hosting based on the provided deploy script.