AI Cyber Security BootCamp — Setting up the Environment
In this post, we discuss how to setup a simple environment to get started in AI Cyber Security. The setup outlined here is very basic and anyone starting their AI Security journey should be able to easily implement this setup in their home lab. All you need is a few basic tools and you should be good to go!
Here’s a list of what you will need to get started:
- Linux VM
- Python3
- Tensorflow
- Foolbox
- Some other dependencies that we’ll cover as needed
Linux VM
You can download an image (ISO) for the latest Ubuntu release here: https://ubuntu.com/download/desktop
Use VMware Fusion or similar virtualisation app for your host OS and create a new Ubuntu VM. I’m working under the assumption that you know how to create VMs.
Python
If you went for the basic installation of the VM, install Python3 on it. We wil be using Python3 for setting up our env.
Update and Upgrade
- Open a terminal window.
- Run the following commands to update the package index and upgrade installed packages:
sudo apt update
Install Python and pip
- TensorFlow requires Python and pip. Most Ubuntu systems come with Python preinstalled. However, you can ensure you have the latest version by installing it via:
sudo apt install python3 python3-pip
Verify Python3 version:
Tensorflow
TensorFlow is a free and open-source software library for machine learning and artificial intelligence. It can be used across a range of tasks but has a particular focus on training and inference of deep neural networks. It was developed by the Google Brain team for Google’s internal use in research and production.¹
Install TensorFlow
It’s a good practice to use a virtual environment to manage Python packages for different projects. You can create and activate a virtual environment using:
$python3 -m venv tensorflow
$source tensorflow/bin/activate
Install Tensorflow using pip:
$pip3 install tensorflow
Verify Tensorflow installation:
>>> import tensorflow as tf
>>> print(tf.__version__)
Install Required Libraries:
- numpy
- pandas
- matplotlib
These will be required down the line when you start working on your AI test models. For now, just install them and have them ready to go!
$ pip install numpy pandas matplotlib
Install Foolbox
Foolbox
Fast adversarial attacks to benchmark the robustness of machine learning models in PyTorch, TensorFlow, and JAX
https://github.com/bethgelab/foolbox
We’ll use Foolbox to create adversarial attacks targeting our model
Install Foolbox by running this command:
pip3 install foolbox
At this point, you are ready to start learning more about AI Cyber Security. The basic setup is good to go!
Next, you should start by learning more about AI models, how to train them and how to craft your attacks on your models. We’ll cover more of those in future posts!
References:
1. https://en.wikipedia.org/wiki/TensorFlow