Le guide
  • 📖Qui sommes-nous ?
  • prévention
    • 📱Les dangers des réseaux sociaux
    • 🔑Qu'est ce qu'un ransomware
    • 👀C'est quoi le phishing ?
    • 🌐Que peut-on faire avec une IP ?
    • Comment se rétracter lors d'un achat (ecommerce) ?
  • urgence
    • ⚡Cybermalveillance
    • 🩹Kit d'aide digital
    • 🚨Infos d'urgences
    • 📘Dernier poste
  • HELP
    • Dont ask to ask
    • Une alternative ?
    • 🎓Apprendre
      • 🇬🇧 Apprendre autre chose
      • Apprendre la cybersécurité
      • Apprendre le développement
      • liens utiles cybersec
      • Apprendre la création de jeux
      • Apprendre l’intelligence artificiel
      • Sauvegarder sous toutes les formes
  • Projets
    • Blukeys (en cours)
    • Communautés
      • Quark
  • Français
    • Comment bien écrire une liste ?
  • Cybersécurité - Hack
    • Outils
      • Introduction au reverse engineering
      • Outils de Base (introduction au Pentesting et la cybersécurité)
      • BurpSuite - Intercepter toutes les requêtes HTTP
      • 🇬🇧 fabacab/awesome-cybersecurity-blueteam
      • 🇬🇧 fabionoth/awesome-cyber-security
      • 🇬🇧 Bypassing Cloudflare WAF with the origin server IP address | Detectify Blog
    • OWASP Top 10
    • On dit chiffrer plutôt que crypter
    • Web security academy - WSA
    • Write-up ctf
      • TryHackMe - Retro
    • SANS - Formations en cybersécurité
  • Développement logiciels
    • Par où commencer ?
    • Principes et bonnes pratiques
      • POO (Programmation Orienté Objet)
    • Langages informatique
      • CSS, SASS
      • HTML
      • L'algorithmique
      • La famille C
      • La famille JS, TS
      • La famille JVM
      • PHP
      • Python
      • Ruby
      • RUST
      • SQL
    • Technologies
      • C'est quoi le Cloud Native ?
      • Installation Sqlite3 avec NPM ou Yarn
      • Les IDE recommandés
      • Base de données
      • Développement web sur windows
    • Toute les documentations
  • Cryptomonnaie
    • Tips navigateur Brave | Laisser un pourboire
  • Infrastructure
    • Générateur de configuration SSL
  • Qualité ingénierie logicielle
    • CI/CD Dév
    • CI/CD d'une infra
    • 🇬🇧 Introduction Mangle enables you to run chaos engineering experiments
      • Overview
      • Mangle Deployment and Administration Guide
      • Mangle Users Guide
      • Mangle Troubleshooting Guide
      • Mangle Developers' Guide
      • Contributing to Mangle
      • mangle-administration
        • Supported Deployment Models
          • Advanced Cassandra Configuration
        • Admin Settings
      • sre-developers-and-users
        • Adding Endpoints
        • Injecting Faults
          • Infrastructure Faults
          • Application Faults
          • Custom Faults
        • Requests and Reports
      • troubleshooting-guide
        • Deployment Stage
        • Boot/Initialization Stage
        • Endpoint Addition Stage
        • Fault Injection Stage
  • Web
    • Inspecteur de code web
    • Liste des APIs publique ( en cours )
    • Apprendre le SEO naturel
    • Tips pour fusionner des communautés Discord
    • Qu’est-ce que le rp ?
    • Google Admin Toolbox HAR Analyzer
  • Couche haute
    • HUGO
      • 🇬🇧 Quick Start
      • Mettre en place son premier site sous Hugo
    • 🇬🇧 Deno Introduction with Practical Examples
    • React-native
    • 🇬🇧 Angular HttpClient v9/8
    • 🇬🇧 Compiler un front Angular variabilisé comme un chef
    • 🇬🇧 Applying Angular Runtime Configurations in Dockerized Environments | Hacker Noon
  • Gaming
    • Installer Shadow Linux et Chrome book
    • Comment choisir son alimentation d'ordi ?
  • Linux
    • Git
    • Bash
    • Bases de linux
    • Installation LEMP sur Ubuntu 20.04 Digitalocean
    • 🇬🇧 Wireguard VPN on Ubuntu 20.04
    • Comment installer et utiliser Docker sur Ubuntu 20.04 | DigitalOcean
    • Sécuriser son serveur Linux sous Ubuntu
    • Introduction à tmux (terminal multiplexer)
  • Bot
    • Héberger son bot Discord
  • setup
    • Rainmeter personnalise ton Win10
  • Virtualisation
    • 🇬🇧 Dockerize Angular 9 App With Nginx
    • 🇬🇧 How To Remove Docker Images, Containers, Networks & Volumes
  • Architecture
    • L'Art De Créer Des Diagrammes d'Architecture
  • Marketing
    • Tips sur les réseaux sociaux 2021
  • Gestions IT (pro/perso)
    • Méthodes Agiles
    • Savoir utiliser la méthode GTD (Getting Things Done)
    • Méthode QQCOQP : analyse et résolution des problèmes
  • Nouveautés
    • 🇬🇧 Netflix-technologies
      • How Netflix Scales its API with GraphQL Federation (Part 1)
      • How Netflix Scales its API with GraphQL Federation (Part 2)
  • Autres
    • A classer
  • How to install Windows 10 root certificates [EASY STEPS]
  • 💕Nous soutenons
    • 💻Azales
    • Papi Uzumaki
    • 💻Beau de l'aire
    • Toshi
    • 🛡️ FCC (French Communuty Cybersecurity)
    • 🛡️Sharpforce
Propulsé par GitBook
Sur cette page

Cet article vous a-t-il été utile ?

Exporter en PDF
  1. Qualité ingénierie logicielle
  2. 🇬🇧 Introduction Mangle enables you to run chaos engineering experiments
  3. sre-developers-and-users
  4. Injecting Faults

Custom Faults

Task-Extension: An example is available as HelloManglePluginTaskHelper at package com.vmware.mangle.test.plugin.helpers of mangle-plugin-skeleton. This task Helper is an implementation of AbstractRemoteCommandExecutionTaskHelper. The implementation of AbstractRemoteCommandExecutionTaskHelper is only expected to provide the implementation for below methods:

​

public Task init(T faultSpec) throws MangleException;

Should provide the Implementation to initialize the Task Helper for executing the Fault. And the commands required for injection/remediation of the Fault are expected to be provided here. More details on the model for providing the Command Information is explained later.

​

public Task init(T taskData, String injectedTaskId) throws MangleException;

Should provide the Implementation to initialize the Task Helper for executing the Fault, if the existing Task id also provided. This method will be used for executing the Remediation on a Task if the Remediation is available. This initialization is not used for task rerun or the Re-trigger.

​

public void executeTask(Task task) throws MangleException;

Provide the Implementation for execution steps required in addition to Implementation available in AbstractRemoteCommandExecutionTaskHelper. Plugin developer can use this interface to invoke his own implementation of Helpers for supporting his Fault across multiple endpoints supported in mangle.

​

protected ICommandExecutor getExecutor(Task task) throws MangleException;

Provide the Implementation for defining the Executor required for the Fault Execution. Mangle provide a default implementation of a executor for each Supported Endpoint. The Plugin user is free to use his own executor as long as he is implementing the resource as per the interface ICommandExecutor available at package com.vmware.mangle.utils;

​

protected void checkTaskSpecificPrerequisites(Task task) throws MangleException;

Provide the Implementation if the Fault being developed expect the test machine to be satisfying a condition for the execution. This step is separated from the Fault execution as Mangle wants to make sure the Fault execution or Remediation will not leave the user environment in a irrecoverable state due to execution of them in a non-perquisite satisfying machine.

​

protected void prepareEndpoint(Task task, List listOfFaultInjectionScripts) throws MangleException; Provide the Implementation if the Fault execution needs certain changes to the Test Machine before execution. Examples are Copying a binary file required to execute a fault. This step is optional for user as the predefined implementation already copies the files returned by listFaultInjectionScripts() to the remote machine.

​

public String getDescription(Task task);

Provide Implementation to generate description for Fault based on user inputs to help him to identify the task in future through the description. A generic implementation is already available at TaskDescriptionUtils.getDescription(task).

​

public List listFaultInjectionScripts(Task task);

Provide a implementation that return details of the support scrips to be copied to test machine required for executing the fault getting implemented.

​

Task-Extension Deep Dive: An example is available as HelloManglePluginTaskHelper at package com.vmware.mangle.plugin.tasks.impl of mangle-plugin-skeleton. This task Helper is an implementation of AbstractRemoteCommandExecutionTaskHelper. The implementation of AbstractRemoteCommandExecutionTaskHelper is only expected to provide the implementation for below methods:

​

public Task init(T faultSpec) throws MangleException ;

Should provide the Implementation to initialize the Task Helper for executing the Fault. And the commands required for injection/remediation of the Fault are expected to be provided here. More details on the model for providing the Command Information is explained later.

​

public Task init(T taskData, String injectedTaskId) throws MangleException;

Should provide the Implementation to initialize the Task Helper for executing the Fault, if the existing Task id also provided. This method will be used for executing the Remediation on a Task if the Remediation is available. This initialization is not used for task rerun or the Re-trigger.

​

public void executeTask(Task task) throws MangleException;

Provide the Implementation for execution steps required in addition to Implementation available in AbstractRemoteCommandExecutionTaskHelper. Plugin developer can use this interface to invoke his own implementation of Helpers for supporting his Fault across multiple endpoints supported in mangle.

​

protected ICommandExecutor getExecutor(Task task) throws MangleException;

Provide the Implementation for defining the Executor required for the Fault Execution. Mangle provide a default implementation of a executor for each Supported Endpoint. The Plugin user should use appropriate executor as per the endpoint provided as the target. Below is the Mapping of Executors to their Endpoint Types.

  1. REMOTE_MACHINE – SSHUtils

  2. DOCKER - DockerCommandUtils

  3. AWS - AWSCommandExecutor

  4. K8s - KubernetesCommandLineClient

  5. vCENTER - VCenterCommandExecutor

EndpointClientFactory class of mangle-task-framework can be used for initializing the appropriate Executor for Injecting the Fault as per user request.

All these executors expect the user to provide a command to be executed on the target machine with associated meta data to mark if it is executed successfully.

​

protected void checkTaskSpecificPrerequisites(Task task) throws MangleException;

Provide the Implementation if the Fault being developed expect the test machine to be satisfying a condition for the execution. This step is separated from the Fault execution as Mangle wants to make sure the Fault execution or Remediation will not leave the user environment in a irrecoverable state due to execution of them in a non-perquisite satisfying machine.

​

protected void prepareEndpoint(Task task, List listOfFaultInjectionScripts) throws MangleException; Provide the Implementation if the Fault execution needs certain changes to the Test Machine before execution. Examples are Copying a binary file required to execute a fault. This step is optional for user as the predefined implementation already copies the files returned by listFaultInjectionScripts() to the remote machine.

​

public String getDescription(Task task);

Provide Implementation to generate description for Fault based on user inputs to help him to identify the task in future through the description. A generic implementation is already available at TaskDescriptionUtils.getDescription(task).

​

public List listFaultInjectionScripts(Task task);

Provide an implementation that return details of the support scrips to be copied to test machine required for executing the fault getting implemented. The support files can be any file required to be placed in the target in order to execute the developed fault. All the out of the box executors is capable of copying files to the corresponding targeted endpoint and the process completes automatically by default implementation of the AbstractRemoteCommandExecutionTaskHelper, provide that the names of the files are returned through listFaultInjectionScripts() implementation.

​

private List getInjectionCommandInfoList(T faultSpec) {}

Provide the commands to be executed for the Fault to be Injected. The commands should be provided as List. The fields and descriptions for the CommandInfo Fields.

  1. private String command; String value of the actual command with references to members in pool of variables will be available to executor during command execution. The types and the accessing mechanism are explained in below section.

  2. private boolean ignoreExitValueCheck; Boolean value to find if a command execution result should consider the return value of the command execution. Can be given false where there can be possibility that the command execution need not be resulted in only success return value, but it will be based on the command output.

  3. private List expectedCommandOutputList; List of patterns to be provided to validate a command execution output to consider if the execution is success. The relation among the patterns verification is defaulted to logical ‘or’.

  4. private int noOfRetries; Retries to be attempted by the executor before marking the command execution as a Failure.

  5. private int retryInterval; Interval in seconds between any two attempts of a command execution incase of execution failures and opted for retry attempts.

  6. private int timeout; Timeout interval in milliseconds to consider a command execution failure if the response was not received by the executor from the target.

  7. private Map knownFailureMap; Mapping of Patterns to be looked for in the command execution output, to provide easier troubleshooting messages to user by masking stack traces in the result.

  8. private List commandOutputProcessingInfoList; Explained in detailed below.

    ​

    public class CommandOutputProcessingInfo

    Fields are

    1. private String regExpression;

      Regular Expression Pattern to be used to collect an crucial information from current command’s execution to make it available throughout the Fault execution.

    2. private String extractedPropertyName;

      Name should be given to the collected information using the pattern given as regExpression

    ​

    Types of Variables and Their Usage:

    The information provided by the user or collected during the runtime of Fault are made available to command executor as below types of Variables.

    1. TaskTroubleShootingInfo of the Task holds the extracted information from the command execution Output.

    2. args field of CommandExecutionFaultSpec available as taskData in Task holds the data received from the user as args.

    3. $FI_ADD_INFO_FieldName can be used to refer to variables from TaskTroubleShootingInfo

    4. $FI_ARG_Fieldname can be used to refer to variables from args.

    5. $FI_STACK can be used to refer to the output of the previous command.

    ​

  9. private List getRemediationCommandInfoList(T faultSpec) {}

    Provide the commands to for remediating the fault already Injected. The semantics of CommandInfo is same as it described in the previous section. The args and TaskTroubleShootingInfo collected during the injection will be available during the execution of remediation as well. Hence the dependency data from injection task can be passed to remediation by using the References in the commands.

PrécédentApplication FaultsSuivantRequests and Reports

Dernière mise à jour il y a 4 ans

Cet article vous a-t-il été utile ?