MyTetra Share
Делитесь знаниями!
Как использовать apt-get в сети предприятия с перехватом траффика
Время создания: 12.04.2022 16:25
Раздел: Компьютер - Linux - Инсталляция программ - Пакетный менеджер APT: apt-get и прочее
Запись: xintrea/mytetra_syncro/master/base/1649769912e4kb0eyj9z/text.html на raw.github.com

Если на предприятии установлено ПО, перехватывающее траффик, включая шифрованный по SSL (экспуатация уязвимости "человек посередине"), то обновление репозитария и получение пакетов из официальных репозитариев может не работать.



> apt-get install kolourpaint

Ошб:1 http://deb.debian.org/debian bullseye/main amd64 libkf5kiofilewidgets5 amd64 5.78.0-5

Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. The certificate chain uses insecure algorithm. The certificate chain uses expired certificate. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verification. [IP: 192.57.254.246 8088]

Ошб:2 http://deb.debian.org/debian bullseye/main amd64 libkf5sane-data all 20.12.0-1

Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. The certificate chain uses insecure algorithm. The certificate chain uses expired certificate. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verification. [IP: 192.57.254.246 8088]

Ошб:3 http://deb.debian.org/debian bullseye/main amd64 libkf5sane5 amd64 20.12.0-1

Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. The certificate chain uses insecure algorithm. The certificate chain uses expired certificate. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verification. [IP: 192.57.254.246 8088]



Попытаться обойти данную проблему можно следующими способами.


Вариант первый - прописать каждому репозитарию "безусловную" доверительность. Делается это в файле /etc/sources.list следующим образом:



deb [trusted=yes] ...

deb-src [trusted=yes] ...



Однако, прописывание данной опции может привести к другим ошибкам:



> apt-get update

Ошб:1 http://deb.debian.org/debian bullseye InRelease      
 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. The certifica
te chain uses insecure algorithm. The certificate chain uses expired certificate. The name in the certificate does
not match the expected.  Could not handshake: Error in the certificate verification. [IP: 192.57.254.246 8088]
Ошб:2 http://security.debian.org/debian-security bullseye-security InRelease
 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. The certifica
te chain uses insecure algorithm. The certificate chain uses expired certificate. The name in the certificate does
not match the expected.  Could not handshake: Error in the certificate verification. [IP: 192.57.254.246 8088]
Ошб:3 http://deb.debian.org/debian bullseye-updates InRelease
 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. The certifica
te chain uses insecure algorithm. The certificate chain uses expired certificate. The name in the certificate does
not match the expected.  Could not handshake: Error in the certificate verification. [IP: 192.57.254.246 8088]



Если такое решение не сработало, можно попытаться отключить верификацию (вариант второй). Делается это командами:



touch /etc/apt/apt.conf.d/99verify-peer.conf

echo >>/etc/apt/apt.conf.d/99verify-peer.conf "Acquire { https::Verify-Peer false }"


В резальтате этого действия верификация будет отключена, но обновление репозитариев работать не будет:



Ошб:1 http://security.debian.org/debian-security bullseye-security InRelease

401 Unauthorized [IP: 192.57.254.246 8088]

Ошб:2 http://deb.debian.org/debian bullseye InRelease

401 Unauthorized [IP: 192.57.254.246 8088]

Ошб:3 http://deb.debian.org/debian bullseye-updates InRelease

401 Unauthorized [IP: 192.57.254.246 8088]

Ошб:4 http://deb.debian.org/debian-security bullseye-security InRelease

401 Unauthorized [IP: 192.57.254.246 8088]

Чтение списков пакетов… Готово

N: Информацию о создании репозитория и настройках пользователя смотрите в справочной странице apt-secure(8).

N: Обновление из этого репозитория нельзя выполнить безопасным способом, поэтому по умолчанию он отключён.

E: Репозиторий «http://security.debian.org/debian-security bullseye-security InRelease» больше не подписан.

E: Не удалось получить http://security.debian.org/debian-security/dists/bullseye-security/InRelease 401 Unauthorized [IP: 192.57.254.246 8088]


Еще можно попробовать вместо [trusted=yes] прописывать [allow-insecure=yes] для каждого репозитария.


Если и это не срабатывает, можно попробовать привести файл /etc/apt/apt.conf.d/99verify-peer.conf к виду:



Acquire { https::Verify-Peer false };

Acquire { http::Verify-Peer false };

Acquire::AllowInsecureRepositories "true";



Все описанные выше способы - это вынужденная мера, понижающая секьюрность локальной системы. По сути, эти способы отключают проверки подлинности принимаемых данных.


Поэтому есть еще один работающий способ обойти проблему, и не понижать защищенность системы. Необходимо проверить, указаны ли репозитарии через протокол https вместо http. Если в случае несекьюрного протокола http сетевое серверное ПО предприятия пытается перенаправить пользователя на страницу авторизации, что ломает взаимодействие с сервером репозитария, то в случае https сетевое ПО предприятия (если в нем не настроен перехват шифрованного траффика), может просто пропустить пакет.


Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования