Dataset Feature Engineering
Relevant dataset features are selected and transformed into a consistent representation for model training.
- Prepare suitable model inputs and maintain compatibility with configuration-analysis features.
GitLab CI/CD is used to automate software building, testing, and deployment through pipeline configurations. The .gitlab-ci.yml file defines pipeline stages, jobs, commands, execution conditions, and security checks that control the software delivery workflow.
The pipeline configuration must be protected because unauthorized modifications can change job commands, remove security checks, alter execution conditions, or introduce unexpected operations into the software development process.
If an attacker gains unauthorized access to a GitLab repository or an account with excessive permissions, the attacker may modify pipeline configurations and introduce changes that weaken security controls or affect software build integrity.
In this use case, GitLab Community Edition is deployed in an isolated Ubuntu virtual machine using VirtualBox. A controlled Git repository maintains the approved .gitlab-ci.yml configuration, while Kali Linux is used as the security-testing environment.
A public cybersecurity dataset is collected and used to train and evaluate a LightGBM machine-learning model. The dataset is preprocessed, relevant features are selected, and the data is divided into training and testing sets. Dataset features and labels are verified to ensure they support the intended classification task.
Python and PyYAML are used to analyse pipeline configuration files and extract structured features from configuration changes. Git is used to compare approved and modified configurations, while SHA-256 integrity verification identifies differences between the trusted baseline and the current configuration.
LightGBM classifies compatible configuration-change features to identify suspicious modification patterns. Controlled unauthorized configuration changes are introduced in the laboratory to assess the detection workflow. Security rules and supplementary scanning tools provide additional evidence for validating suspicious findings.
GitLab project controls, including protected branches and merge-request approvals where supported, are configured to restrict unapproved changes. The configuration is then corrected or restored, and the assessment is repeated to verify that the intended security controls operate correctly.
Application/Service: GitLab CI/CD Pipeline
GitLab CI/CD is the target software delivery service in this use case.
It manages repositories, pipeline configurations, automated jobs, and software build and deployment workflows.
The .gitlab-ci.yml file controls how pipeline jobs execute and which commands, stages, and conditions are applied during software delivery.
If an unauthorized user modifies this configuration, the changes may introduce unexpected commands, remove security-check stages, alter job execution conditions, or weaken the intended pipeline controls.
Basic YAML validation can determine whether a configuration file is syntactically valid, but it cannot independently determine whether every change is authorized or secure.
File-integrity checks can identify differences from a trusted baseline, but a hash mismatch alone cannot establish whether the change is malicious. Similarly, static-analysis tools identify supported security weaknesses but may not detect every unauthorized configuration modification.
The proposed solution introduces public dataset-based LightGBM model training, pipeline configuration-change analysis, YAML feature extraction, SHA-256 integrity verification, security finding validation, risk prioritization, pipeline access restrictions, and post-remediation validation.
Specific Attack: Unauthorized GitLab CI/CD Pipeline Configuration Modification Attack
The controlled attack scenario evaluates whether suspicious or unauthorized modifications to the GitLab .gitlab-ci.yml configuration can be identified before the affected pipeline proceeds.
The approved configuration is maintained in Git as the trusted baseline. Controlled changes are introduced in the isolated laboratory to represent unexpected job-command modifications, removal of configured security checks, or changes to pipeline execution conditions.
The public cybersecurity dataset is used to train and evaluate the LightGBM model. The controlled GitLab configuration changes are then used to assess the target application's detection workflow. The extracted configuration features must be compatible with the model's training features for its predictions to be meaningful.
Git change analysis identifies the modified configuration elements. PyYAML parses the configuration, and LightGBM classifies the extracted features. SHA-256 integrity verification identifies differences from the trusted baseline, while security rules provide additional evidence for reviewing the findings.
The objective is to determine whether suspicious configuration changes can be detected, investigated, and prevented from proceeding through the protected pipeline workflow.
The assessment is performed only in the authorized laboratory using controlled changes. No production pipeline or external system is targeted.
Machine Learning-Based Pipeline Configuration Analysis and Integrity Verification
The primary security concept combines LightGBM-based classification with pipeline configuration-change analysis and file-integrity verification.
A suitable public cybersecurity dataset is collected, inspected, and preprocessed to prepare labelled records for model training and evaluation. Relevant features are selected, and the dataset is divided into training and testing sets.
LightGBM learns patterns from the training data and classifies feature records according to the labels available in that dataset. Python and PyYAML analyse the GitLab pipeline configuration and extract compatible features from its changes. The dataset's suitability and the relationship between training features and GitLab configuration features must be verified before the model is applied to the target application.
SHA-256 integrity verification identifies differences between the current .gitlab-ci.yml file and its trusted baseline. Git provides change history, while security rules and supplementary scanners help validate the findings. A model prediction or hash mismatch alone is not treated as proof of malicious activity.
Public Dataset Collection
↓
Dataset Preprocessing
↓
Feature Engineering
↓
Training and Testing Data Split
↓
LightGBM Model Training and Evaluation
↓
GitLab Configuration Collection
↓
Git Change and YAML Analysis
↓
Configuration Feature Extraction
↓
LightGBM Change Classification
↓
SHA-256 Integrity Verification
↓
Security Finding Validation
↓
Risk Assessment
↓
Pipeline Access Restriction
↓
Configuration Remediation
↓
Post-Remediation Validation
The security concept defines the overall security strategy.
The following are the specific defensive mechanisms implemented.
A suitable public cybersecurity dataset is collected, preprocessed, and used to train and evaluate the LightGBM model.
Relevant dataset features are selected and transformed into a consistent representation for model training.
Approved and modified .gitlab-ci.yml configurations are compared to identify unexpected changes to jobs, commands, stages, and execution rules.
PyYAML parses the pipeline configuration and extracts structured features for security analysis.
The trained model classifies compatible configuration-change features according to the patterns learned from the dataset.
The current pipeline configuration hash is compared with the hash of the trusted baseline.
Git history and diff information are reviewed to identify the exact configuration elements that have changed.
Relevant security rules and supplementary scanning tools are used to investigate suspicious changes and supported security weaknesses.
Protected branches, merge-request approvals, and appropriate pipeline restrictions are configured where supported.
The corrected configuration is analysed again, and integrity checks and relevant security tests are repeated.
LightGBM is the primary machine-learning algorithm used to classify structured feature records from the prepared training dataset and configuration-analysis workflow.
Pandas and NumPy are used to load, inspect, clean, and transform the public cybersecurity dataset.
scikit-learn supports dataset splitting and model evaluation.
PyYAML parses the GitLab .gitlab-ci.yml configuration into structured Python data for analysis.
Git maintains the pipeline configuration history and identifies changes between approved and modified versions.
Python hashlib generates SHA-256 hashes for the approved and current pipeline configurations.
Semgrep CE performs supported static-analysis checks on relevant source files and configurations.
Trivy scans supported container images and configuration files for known vulnerabilities and supported security issues.
GitLab Community Edition provides the repository, CI/CD pipeline, merge-request workflow, and project controls being assessed.
Streamlit provides a Python-based dashboard for displaying model predictions and configuration-security assessment results.
Docker Engine provides container execution where required for the GitLab laboratory deployment and related test components.
Ubuntu provides the primary environment for GitLab, Python, dataset processing, model training, and security analysis.
Kali Linux provides the controlled security-testing environment for the authorized laboratory.
VirtualBox provides the isolated virtual-machine infrastructure for the project.
A GitLab CI/CD environment is deployed in an isolated Ubuntu laboratory to assess unauthorized pipeline configuration modifications.
A trusted .gitlab-ci.yml configuration is established in Git, and its SHA-256 hash is recorded as the baseline for integrity verification.
A suitable public cybersecurity dataset is collected and preprocessed to prepare the labelled records required for LightGBM model training and evaluation. Dataset suitability, feature relevance, and label availability are reviewed before model training.
The LightGBM model is trained using the prepared training data and evaluated using a separate testing set. Appropriate evaluation metrics are recorded to assess classification performance and identify potential false positives and false negatives.
Python and PyYAML are used to analyse GitLab pipeline configuration files and extract relevant features from configuration changes. The feature representation is aligned with the model's training inputs so that predictions are based on compatible data.
Controlled pipeline configuration modifications are introduced in the isolated laboratory. Git change analysis identifies the modified configuration elements, while LightGBM classifies compatible extracted features to identify suspicious patterns requiring investigation.
SHA-256 integrity verification identifies differences between the current pipeline configuration and the trusted baseline. Git history and security-rule validation provide additional evidence for determining whether the changes are expected or require further investigation.
GitLab project controls are configured to restrict unapproved changes where supported. Suspicious modifications are reviewed, corrected or reverted, and tested again to verify that the intended pipeline configuration and security checks are restored.
A Streamlit dashboard presents model predictions, configuration-change information, integrity status, and security assessment findings. The final results document model performance, controlled test outcomes, remediation evidence, and remaining limitations.
The completed use case demonstrates a combined approach to dataset-based LightGBM classification, GitLab CI/CD configuration analysis, SHA-256 integrity verification, and controlled pipeline protection. The model's effectiveness against GitLab configuration attacks is established through controlled testing rather than assumed from dataset evaluation alone.