Welcome to the Security Metrics repository! This repository contains all the Python code and Jupyter Notebook examples referenced in the book. These examples are designed to help you understand and apply key concepts in cybersecurity analytics, from statistical analysis to advanced machine learning and generative AI.
- Introduction
- Repository Structure
- Getting Started
- Code Overview
- Contributing
- License
- Questions or Feedback?
This repository is a companion to the book "Security Metrics", providing hands-on examples to illustrate the concepts covered in the following chapters:
- Chapter 2: Fundamental Metrics
- Chapter 11: Advanced Statistical Analysis
- Chapter 12: Advanced Machine Learning Analysis
- Chapter 13: Generative AI for Cybersecurity Metrics
The code is presented in a Jupyter Notebook format to allow readers to execute, explore, and modify the examples directly.
├── notebooks/
│ ├── Chapter_02_Fundamentals.ipynb
│ ├── Chapter_11_Statistical_Analysis.ipynb
│ ├── Chapter_12_Machine_Learning.ipynb
│ ├── Chapter_13_Generative_AI.ipynb
├── README.md
└── LICENSE
- Chapter_02_Fundamentals.ipynb: Examples of key security metrics and their practical applications.
- Chapter_11_Statistical_Analysis.ipynb: Core statistical methods and their implementation in Python.
- Chapter_12_Machine_Learning.ipynb: Hands-on examples of machine learning techniques for cybersecurity analysis.
- Chapter_13_Generative_AI.ipynb: Use of generative AI to enhance cybersecurity analysis and reporting.
Ensure you have the following installed:
- Python 3.8+
- Jupyter Notebook
- Required Python libraries:
- pandas
- matplotlib
- seaborn
- scikit-learn
- openai
- statsmodels
- keras (or tensorflow.keras)
Clone this repository to your local machine:
git clone https://github.com/Mariano215/Security_Metrics.git
Install the necessary Python packages using pip
:
pip install -r requirements.txt
- Navigate to the
notebooks
directory:
cd notebooks
- Launch Jupyter Notebook:
jupyter notebook
- Open the desired notebook (e.g.,
Chapter_11_Statistical_Analysis.ipynb
) and run the cells.
Each notebook provides:
- Step-by-step explanations of the code
- Generated datasets (where applicable) to eliminate the need for external data
- Visualizations and summaries of results
Note: The Chapter_13_Generative_AI.ipynb
notebook demonstrates how to use open-source tools like LM Studio and Ollama, as well as the OpenAI API, for analyzing cybersecurity metrics.
Contributions are welcome! If you have suggestions for improvement or additional examples, feel free to:
- Fork the repository
- Create a feature branch
- Submit a pull request
This repository is licensed under the MIT License. See the LICENSE file for details.
If you have any questions or feedback, feel free to reach out or open an issue in this repository.