
# Playbook Ansible per verificare e mitigare CVE-2026-31431 su host Linux, con script per ambienti locali, remoti e containerizzati, inclusa l'integrazione CI/CD.
Verifica se un host Linux è vulnerabile a CVE-2026-31431 e applica la mitigazione.
check_cve_2026_31431.yml - Playbook Ansible per verificare e correggererevert_cve_2026_31431.yml - Playbook Ansible per annullare la mitigazionerun_check.sh - Script per eseguire la verifica localmente o da remotorun_revert.sh - Script per annullare le modifiche localmente o da remoto./run_check.sh
# Selezionare 'l' per locale
Oppure direttamente:
ansible-playbook -i "localhost," -c local --ask-become-pass check_cve_2026_31431.yml -v
Annulla la mitigazione applicata da run_check.sh:
./run_revert.sh
# Selezionare 'l' per locale
Oppure direttamente:
ansible-playbook -i "localhost," -c local --ask-become-pass revert_cve_2026_31431.yml -v
Il revert elimina /etc/modprobe.d/disable-algif.conf e tenta di ricaricare il modulo algif_aead.
ansible-playbook -i "192.168.1.100," -u ubuntu --ask-become-pass check_cve_2026_31431.yml -v
Con più host (creare hosts.ini):
[servers]
192.168.1.100
192.168.1.101
ansible-playbook -i hosts.ini --ask-become-pass check_cve_2026_31431.yml -v
./run_revert.sh
# Selezionare 'l' per locale
docker run -it --privileged ubuntu:22.04 /bin/bash
# All'interno del container:
apt update && apt install -y ansible python3
# Copiare il playbook nel container oppure usare curl/wget
ansible-playbook -i "localhost," -c local check_cve_2026_31431.yml -v
Oppure montando il playbook dall'host:
docker run -it --privileged -v $(pwd)/check_cve_2026_31431.yml:/check.yml ubuntu:22.04
# All'interno: ansible-playbook -i "localhost," -c local /check.yml -v
GitHub Actions (.github/workflows/check-cve.yml):
name: Check CVE-2026-31431
on:
push:
branches: [ main ]
pull_request:
jobs:
check-vulnerability:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build test image
run: docker build -t test-image .
- name: Check for CVE-2026-31431 in container
run: |
docker run --rm \
-v ${{ github.workspace }}/check_cve_2026_31431.yml:/check.yml \
test-image \
/bin/bash -c "apt update && apt install -y ansible python3 && \
echo 'no' | ansible-playbook -i 'localhost,' -c local /check.yml -v"
- name: Fail if vulnerable
run: |
# Il playbook deve restituire != 0 se è vulnerabile
# Oppure analizzare l'output cercando "VULNERABLE"
GitLab CI (.gitlab-ci.yml):
stages:
- build
- security
build_image:
stage: build
script:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
check_cve:
stage: security
script:
- docker run --rm -v $(pwd)/check_cve_2026_31431.yml:/check.yml $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
/bin/bash -c "apt-get update && apt-get install -y ansible python3 &&
ansible-playbook -i 'localhost,' -c local /check.yml -v | grep -q 'SAFE' || exit 1"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
Dockerfile con verifica durante la build:
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y ansible python3 wget
# Copiare ed eseguire il check durante la build
COPY check_cve_2026_31431.yml /tmp/
RUN echo "no" | ansible-playbook -i "localhost," -c local /tmp/check_cve_2026_31431.yml -v | \
grep -q "SAFE" || (echo "VULNERABLE - Fix before building" && exit 1)
# Resto della tua immagine...
authencesn è accessibile tramite AF_ALGalgif_aead (crea /etc/modprobe.d/disable-algif.conf)/etc/modprobe.d/disable-algif.confalgif_aeadauthencesn è accessibile tramite AF_ALGalgif_aeadStatus: SAFE - System is protected
© 2026 EximiaIT
Security Assessment Tool – CVE-2026-31431 (Copy Fail)
This project is intended for authorized security testing, auditing, and educational purposes only. Any use of this software without proper authorization is strictly prohibited.
EximiaIT assumes no liability for misuse or damages resulting from this tool.