Skip to content

Barnard-PL-Labs/IaCAnalysis

Repository files navigation

IaC Analysis

https://arxiv.org/html/2402.15632v1

1. Prerequisites

1.1. Install poetry

The project is built with poetry. Please install it first.

After installing poetry, I recommend using the following command to configure poetry to put the python virtual environments in the directory of each project:

poetry config virtualenvs.in-project true

This helps VSCode to identify and start using the virtual environments.

1.2. Install project dependencies

Inside the project directory, you need to install the project's dependencies. You can do this by running the following command:

poetry install

This will create a virtual environment and install all the project's dependencies into it.

2. Usage

The main command, iac-analysis:

poetry run iac-analysis --help

To output a graph of the infrastruture, use poetry run iac-analysis graph [CFN_FILE].

To output resource usage estimates template, use poetry run iac-analysis estimates-template [CFN_FILE].

To show more information about the infrastructure and generated constraints, use poetry run iac-analysis constrain [CFN_FILE].

This check sub-command checks whether the usage estimates satisfy the constraints of the infrastructure.

poetry run iac-analysis check [CFN_FILE] [USAGE_ESTIMATES]

The constrain and check subcommands support -c flag to supply custom constraint generator in the form of a Python module, which should export a function named compute_constraints. You may look at ./example_custom_constraints.py as an example.

3. Benchmark

The project provides a benchmark script to reproduce the statistics in the paper.

First, enter the project shell/virtual environment:

poetry shell

Then you may produce statistics for the full set of benchmarks:

iac-analysis-benchmark all

If you want to, you may aldo produce statistics for any CFN template:

iac-analysis-benchmark single [CFN_TEMPLATE] --custom_smt2 [CUSTOM_SMT2]

About

Static Analysis of Infrastructure as Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages