Skip to content

Mariano215/data-driven-cybersecurity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Security Metrics: Practical Examples for Cybersecurity Analysis

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.

Table of Contents

Introduction

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.

Repository Structure

├── notebooks/
│   ├── Chapter_02_Fundamentals.ipynb
│   ├── Chapter_11_Statistical_Analysis.ipynb
│   ├── Chapter_12_Machine_Learning.ipynb
│   ├── Chapter_13_Generative_AI.ipynb
├── README.md
└── LICENSE

Notebooks

  • 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.

Getting Started

Prerequisites

Ensure you have the following installed:

  1. Python 3.8+
  2. Jupyter Notebook
  3. Required Python libraries:
    • pandas
    • matplotlib
    • seaborn
    • scikit-learn
    • openai
    • statsmodels
    • keras (or tensorflow.keras)

Installation

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

Running the Notebooks

  1. Navigate to the notebooks directory:
cd notebooks
  1. Launch Jupyter Notebook:
jupyter notebook
  1. Open the desired notebook (e.g., Chapter_11_Statistical_Analysis.ipynb) and run the cells.

Code Overview

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.

Contributing

Contributions are welcome! If you have suggestions for improvement or additional examples, feel free to:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

License

This repository is licensed under the MIT License. See the LICENSE file for details.

Questions or Feedback?

If you have any questions or feedback, feel free to reach out or open an issue in this repository.

About

Security_Metrics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published