|
|
- [_Lazart documentation_](../home)
|
|
|
|
|
|
This page presents the process of an Analysis inside Lazart and the [`Analysis`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.Analysis) object.
|
|
|
This page presents the process of an Analysis inside Lazart and the [`Analysis`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.Analysis) object.
|
|
|
|
|
|
**Summary:**
|
|
|
|
... | ... | @@ -12,17 +12,17 @@ This page presents the process of an Analysis inside Lazart and the [`Analysis`] |
|
|
|
|
|
# Analysis parameters
|
|
|
|
|
|
The [`lazart.core.Analysis`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.Analysis) type represents an analysis with **Lazart**. It contains all parameters necessary to an analysis.
|
|
|
The [`lazart.core.Analysis`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.Analysis) type represents an analysis with **Lazart**. It contains all parameters necessary to an analysis.
|
|
|
|
|
|
An analysis object requires at least the attack model (see corresponding [section](attack-model)) that describes the faults that can be injected by the attackers and the list of input files to be compiled.
|
|
|
|
|
|
Several optional parameters can be passed and this section list few of them. For a full list of available parameters, please refer to the [documentation](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.Analysis).
|
|
|
Several optional parameters can be passed and this section list few of them. For a full list of available parameters, please refer to the [documentation](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.Analysis).
|
|
|
|
|
|
The `path` argument corresponds to the folder in which the results will be saved. This parameter is overridden by `--output-folder` command line argument in scripts. If none is specified, an available empty folder in current directory will be used.
|
|
|
|
|
|
The `name` argument is only used to display purpose and does not impact the analysis itself. However, it can be useful if you run multiple analysis inside one script.
|
|
|
|
|
|
The `flags` argument holds the [AnalysisFlag](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.AnalysisFlag) determining which type of analysis should be applied. Utility function such as [`exec`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html#lazart.util.exec.exec) or [`report`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.results.report.html) modules uses those flags to determines which operation and analysis will be applied. Use `AttackAnalysis` for standard attack paths research and `EqRedAnalysis` to enable [equivalence and redundancy](Analysis/Redundancy-and-Equivalence) analysis.
|
|
|
The `flags` argument holds the [AnalysisFlag](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.AnalysisFlag) determining which type of analysis should be applied. Utility function such as [`exec`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html#lazart.util.exec.exec) or [`report`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.results.report.html) modules uses those flags to determines which operation and analysis will be applied. Use `AttackAnalysis` for standard attack paths research and `EqRedAnalysis` to enable [equivalence and redundancy](Analysis/Redundancy-and-Equivalence) analysis.
|
|
|
|
|
|
By default, **Lazart** uses `clang` as compiler. You can change this with the corresponding analysis parameters: `compiler`, `disassembler` and `linker`. Additional option can be pass through the corresponding `compiler_args`, `dis_args` and `linker_args` parameters.
|
|
|
|
... | ... | @@ -32,11 +32,11 @@ By default, **Lazart** uses `clang` as compiler. You can change this with the co |
|
|
|
|
|
Analysis are executed using a sequence of steps (see [Lazart's workflow](Core#lazarts-workflow) section):
|
|
|
|
|
|
1. _compilation and preprocessing_: [`lazart.core.compile.compile_results`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.compile.html#lazart.core.compile.compile_results)
|
|
|
2. _mutation_: [`lazart.core.run.run_results`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.run.html#lazart.core.run.run_results)
|
|
|
3. _concolic execution_: [`lazart.core.run.run_results`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.run.html#lazart.core.run.run_results)
|
|
|
4. _traces parsing_: [`lazart.core.traces.traces_results`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.run.html#lazart.core.traces.traces_results)
|
|
|
5. _analysis steps_: [`lazart.analysis`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.analysis.html)
|
|
|
1. _compilation and preprocessing_: [`lazart.core.compile.compile_results`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.compile.html#lazart.core.compile.compile_results)
|
|
|
2. _mutation_: [`lazart.core.run.run_results`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.run.html#lazart.core.run.run_results)
|
|
|
3. _concolic execution_: [`lazart.core.run.run_results`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.run.html#lazart.core.run.run_results)
|
|
|
4. _traces parsing_: [`lazart.core.traces.traces_results`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.run.html#lazart.core.traces.traces_results)
|
|
|
5. _analysis steps_: [`lazart.analysis`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.analysis.html)
|
|
|
|
|
|
Each step can have specific parameters that can be specified when calling the corresponding function or with the call of `execute` function (see next section)
|
|
|
|
... | ... | @@ -50,7 +50,7 @@ The following analysis are provided by Lazart: |
|
|
|
|
|
# Execute module
|
|
|
|
|
|
The [lazart.util.exec](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html) provides the [`execute`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html#lazart.util.exec.execute) that executes each step depending on the specified [`AnalysisFlag`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.AnalysisFlag). For instance, using [`AnalysisFlag.EqRedAnalysis`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.AnalysisFlag.EqRedAnalysisOnly), the call to [`execute`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html#lazart.util.exec.execute) corresponds to :
|
|
|
The [lazart.util.exec](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html) provides the [`execute`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html#lazart.util.exec.execute) that executes each step depending on the specified [`AnalysisFlag`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.AnalysisFlag). For instance, using [`AnalysisFlag.EqRedAnalysis`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.core.analysis.html#lazart.core.analysis.AnalysisFlag.EqRedAnalysisOnly), the call to [`execute`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html#lazart.util.exec.execute) corresponds to :
|
|
|
|
|
|
```py
|
|
|
compile_results(a) # Compilation.
|
... | ... | @@ -63,7 +63,7 @@ generate_reports(a) # Generate analysis reports files. |
|
|
save(a) # Save analysis
|
|
|
```
|
|
|
|
|
|
The steps's keyword arguments are forwarded by the function [`execute`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html#lazart.util.exec.execute).
|
|
|
The steps's keyword arguments are forwarded by the function [`execute`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.util.exec.html#lazart.util.exec.execute).
|
|
|
|
|
|
# Analysis folder structure
|
|
|
|
... | ... | @@ -84,7 +84,7 @@ An analysis folder is structured as follows: |
|
|
- `am.yaml`: YAML attack model for Wolverine (copied from user's specified one or generated by Python API).
|
|
|
- _results_:
|
|
|
- `report.md`: analysis report.
|
|
|
- `results`: binary containing the [`Metric`](https://lazart.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.results.results.html#lazart.results.Metric) object of the analysis.
|
|
|
- `results`: binary containing the [`Metric`](https://securitytools.gricad-pages.univ-grenoble-alpes.fr/lazart/python-api/lazart.results.results.html#lazart.results.Metric) object of the analysis.
|
|
|
- `res.csv`: CSV file of all metrics.
|
|
|
- `aar.csv`: CSV file of [Attack Analysis](Analysis/Attack-Analysis) and [Redundancy and Equivalence](Analysis/Redundancy-and-Equivalence) results.
|
|
|
- `hs.csv`: CSV file of [Hotspots Analysis](Hotspot-Analysis) results.
|
... | ... | |