# sekoia-io/automation-library architecture

> Architecture diagram of the GitHub repository sekoia-io/automation-library, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sekoia-io/automation-library
- Repository: https://github.com/sekoia-io/automation-library

## Overview

##### Major System Components
- Automation Engine/Core Orchestrator – Although there isn’t one single “engine” file at the repository’s root, note that each vendor directory usually contains its own main.py and manifests. These act as orchestrators for their respective integrations.
- Connector/Module Components – Every vendor (e.g., 1Password, AWS, Azure, CrowdStrike, etc.) represents a self-contained module that follows a similar internal design: it has client libraries, configuration, actions/triggers (often in trigger_*.json files), and tests. These modules form the “pluggable” parts that provide automation for specific external products or platforms.
- Shared Utilities and Compliance Validators – The _utils directory (especially _utils/compliance) includes common components – such as validators for manifests, Dockerfiles, and module structure. They ensure that new modules conform to repository standards.
- Documentation/Contributing Guidelines – Represented by the docs folder (with README.md, module.md, organization.md, etc.), these are vital for maintainability and clarity.
- Tests – Each module directory includes its own tests subdirectory. They verify that each module works correctly and remains up-to-date. You may show these as supporting components that interact with every module.

##### Relationships & Data Flow
- There should be directional flows from the module into external services (like APIs, cloud platforms, etc.) and vice versa. Indicate that the triggers (with filenames trigger_*.json) respond to incoming events or changes.
- Shared utility modules (found under _utils and doc/compliance validators) act as foundational libraries that support all independent modules in terms of compliance and consistency. Show these as a common service connected to every module for validation and configuration.

##### Emphasizing Architectural Patterns & Technologies
- Test-Driven Architecture: Each module includes a tests directory. Represent testing as a parallel sub-system that verifies the behavior of every component.
- Containerization: Many modules have Dockerfiles, which suggest containerized deployment. Indicate that these components are designed to be developed, deployed, and scaled independently.
- Consistency through Compliance: The existence of _utils/compliance validators suggests that automated checks and quality controls feed into the CI/CD workflow (visible by files like “.github/workflows/*”). You might show a CI/CD pipeline component that validates modules before integration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    lib["Sekoia.io Automation Library"]:::hub
    docs["Documentation & Guidelines"]:::docs
    utils["Shared Utilities & Compliance"]:::utils
    ext["External Security Platforms"]:::external
    pipeline["CI/CD Pipeline"]:::pipeline

    %% Vendor Modules Subgraph
    subgraph "Vendor Modules"
        %% 1Password Module
        subgraph "1Password Module"
            p1_main["1Password Main"]:::vendor
            p1_connector["1Password Connector"]:::vendor
            p1_trigger["1Password Trigger"]:::vendor
            p1_tests["1Password Tests"]:::vendor
        end
        %% AWS Module
        subgraph "AWS Module"
            aws_main["AWS Main"]:::vendor
            aws_connector["AWS Connector"]:::vendor
            aws_trigger["AWS Trigger"]:::vendor
            aws_tests["AWS Tests"]:::vendor
        end
        %% Azure Module
        subgraph "Azure Module"
            az_main["Azure Main"]:::vendor
            az_connector["Azure Connector"]:::vendor
            az_trigger["Azure Trigger"]:::vendor
            az_tests["Azure Tests"]:::vendor
        end
        %% CrowdStrike Module
        subgraph "CrowdStrike Module"
            cs_main["CrowdStrike Main"]:::vendor
            cs_connector["CrowdStrike Connector"]:::vendor
            cs_trigger["CrowdStrike Trigger"]:::vendor
            cs_tests["CrowdStrike Tests"]:::vendor
        end
    end

    %% Top-level Connections from the Library
    lib --> p1_main
    lib --> aws_main
    lib --> az_main
    lib --> cs_main
    lib --> docs

    %% Internal Vendor Module Flows
    p1_main --> p1_connector
    p1_main --> p1_trigger
    aws_main --> aws_connector
    aws_main --> aws_trigger
    az_main --> az_connector
    az_main --> az_trigger
    cs_main --> cs_connector
    cs_main --> cs_trigger

    %% Integration with Shared Utilities for Compliance/Validation
    p1_main --> utils
    aws_main --> utils
    az_main --> utils
    cs_main --> utils

    %% Data Flow to External Security Platforms
    p1_connector --> ext
    p1_trigger --> ext
    aws_connector --> ext
    aws_trigger --> ext
    az_connector --> ext
    az_trigger --> ext
    cs_connector --> ext
    cs_trigger --> ext

    %% Testing Flows to CI/CD Pipeline
    p1_tests --> pipeline
    aws_tests --> pipeline
    az_tests --> pipeline
    cs_tests --> pipeline

    %% Styling Classes
    classDef hub fill:#C0EAFD,stroke:#333,stroke-width:2px;
    classDef vendor fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef utils fill:#F7E18E,stroke:#333,stroke-width:2px;
    classDef docs fill:#C4FDBE,stroke:#333,stroke-width:2px;
    classDef external fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef pipeline fill:#F5B7B1,stroke:#333,stroke-width:2px;

    %% Click Events
    click lib "https://github.com/sekoia-io/automation-library/blob/main/Sekoia.io/main.py"
    click p1_main "https://github.com/sekoia-io/automation-library/blob/main/1Password/main.py"
    click p1_connector "https://github.com/sekoia-io/automation-library/blob/main/1Password/connector_1password_epm.py"
    click p1_trigger "https://github.com/sekoia-io/automation-library/blob/main/1Password/trigger_1password_epm.json"
    click p1_tests "https://github.com/sekoia-io/automation-library/tree/main/1Password/tests"
    click aws_main "https://github.com/sekoia-io/automation-library/blob/main/AWS/main.py"
    click aws_tests "https://github.com/sekoia-io/automation-library/tree/main/AWS/tests"
    click az_main "https://github.com/sekoia-io/automation-library/blob/main/Azure/main.py"
    click az_tests "https://github.com/sekoia-io/automation-library/tree/main/Azure/tests"
    click cs_main "https://github.com/sekoia-io/automation-library/blob/main/CrowdStrike/main.py"
    click cs_tests "https://github.com/sekoia-io/automation-library/tree/main/CrowdStrike/tests"
    click utils "https://github.com/sekoia-io/automation-library/tree/main/_utils/compliance"
    click docs "https://github.com/sekoia-io/automation-library/blob/main/docs/README.md"
```
