
Ansible playbooks to check and mitigate CVE-2026-31431 on Linux hosts, with scripts for local, remote, and containerized environments, including CI/CD integration.
Verifica si un host Linux es vulnerable a CVE-2026-31431 y aplica mitigación.
check_cve_2026_31431.yml - Playbook de Ansible para verificar y parchearrevert_cve_2026_31431.yml - Playbook de Ansible para deshacer mitigaciónrun_check.sh - Script para ejecutar verificación local o remotamenterun_revert.sh - Script para deshacer cambios local o remotamente./run_check.sh
# Seleccionar 'l' para local
O directamente:
ansible-playbook -i "localhost," -c local --ask-become-pass check_cve_2026_31431.yml -v
Deshace la mitigación aplicada por run_check.sh:
./run_revert.sh
# Seleccionar 'l' para local
O directamente:
ansible-playbook -i "localhost," -c local --ask-become-pass revert_cve_2026_31431.yml -v
El revert elimina /etc/modprobe.d/disable-algif.conf e intenta recargar el módulo algif_aead.
ansible-playbook -i "192.168.1.100," -u ubuntu --ask-become-pass check_cve_2026_31431.yml -v
Con múltiples hosts (crear 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
# Seleccionar 'l' para local
docker run -it --privileged ubuntu:22.04 /bin/bash
# Dentro del container:
apt update && apt install -y ansible python3
# Copiar el playbook al container o usar curl/wget
ansible-playbook -i "localhost," -c local check_cve_2026_31431.yml -v
O montando el playbook desde el host:
docker run -it --privileged -v $(pwd)/check_cve_2026_31431.yml:/check.yml ubuntu:22.04
# Dentro: 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: |
# El playbook debe retornar != 0 si es vulnerable
# O parsear la salida buscando "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 verificación en build:
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y ansible python3 wget
# Copiar y ejecutar check durante 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 de tu imagen...
authencesn es accesible vía AF_ALGalgif_aead (crea /etc/modprobe.d/disable-algif.conf)/etc/modprobe.d/disable-algif.confalgif_aeadauthencesn es accesible vía 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.