[gitlab] 웹훅 연결시 "Url is blocked: Requests to the local network are not allowed" 오류 해결 방법
IT/DevOps

[gitlab] 웹훅 연결시 "Url is blocked: Requests to the local network are not allowed" 오류 해결 방법

반응형

intro

gitlab에서 프로젝트를 만들고 웹훅을 등록하는 데 아래와 같은 에러메시지가 발생하였다. Url is blocked: Requests to the local network are not allowed

원인

GitLab 서버에서 http://localhost:123/some-resource/delete. 와 같은 이러한 유형의 악용이 발생하는 것을 방지하기 위해 GitLab 10.6부터 현재 GitLab 인스턴스 서버 주소 및/또는 개인 네트워크에 대한 모든 Webhook 요청은 기본적으로 금지 했다고 한다. 그래서 gitlab에서 웹훅을 사용하려면 outbound허용에설정을 해야하는데 해당 설정을 하지 않아서 발생한 이슈이다.

해결 방법

가장 중요한 부분인데 root 계정으로 로그인을 해야한다! admin 권한이 있는 계정으로 로그인하면 아래 Admin Area가 보이지 않는다.

  • Admin Area
  • On the left sidebar, select Settings > Network.
  • Expand the Outbound requests section:
  • Select Allow requests to the local network from web hooks and services.

만약 위 설정이 되어 있다면 아래와 같이 진행

  • Admin Area
  • On the left sidebar, select Settings > Network (/admin/application_settings/network)

그리고 아래와 같이 입력하면 되는데 구분은 세미콜론, 쉼표, 공백, 줄바꿈으로 할 수 있고 와일드카드 ("*.example.com") 는 지원하지 않는다

gitlab.example.com
127.0.0.1,1:0:0:0:0:0:0:1
127.0.0.0/8 1:0:0:0:0:0:0:0/124
[1:0:0:0:0:0:0:1]:8080
127.0.0.1:8080

참고

http://www.bioinfotiget.it/gitlab/help/security/webhooks.md

반응형