intelligence 설정으로 google api 및 colab-notebook 사용 하기
Last updated
Last updated
보안 강도가 높은 사이트에서는 egress 정책이 제한 되어 있어, 모든 나가는 트래픽을 막을 시 gcp에서 꼭 필요한 google/gcp api 들이 endpoint까지 도달하지 못하고 차단 될것 이다.
이 경우 해결방법은 두가지가 있다.
방화벽 white list선택(인텔리전스) --> 추천
본 문서는 인텔리전스 방식을 활용 하는 방법에 대해서 작성 하였으며 실제로 이 방법을 추천하는 이유는
설정 방법이 매우 간단 하다.
그럴리는 없겠지만 혹시라도 IP 대역이 변경이 될 경우 저 화이트리스트에 반영이 되기 때문에 정책이 유동적으로 반영 되리라 예상한다.
DNS를 건드릴 일이 없기 때문에 DNS가 깔끔해진다.
설정이 직관적이라 방화벽 정책만 보면 된다.(본인도 실제로 DNS 방식을 처음 봤을때는 이런게 왜 있는거지 의문을 가졌다.)
위 그림을 보면 빨간색 부분은 0.0.0.0/0 egress deny를 건 시점 부터 발생 하였다.
방화벽 로그도 deny로 확인 된다.
allow로 걸리고 있는것을 확인 가능 하다.
404가 나오긴 하지만 상관없다. 연결은 되고 있다는 것만 알면 된다.
kimutae5@kth-private:~$ curl -v a.aiplatform-notebook.cloud.google.com
* Trying 172.217.161.206:80...
* Connected to a.aiplatform-notebook.cloud.google.com (172.217.161.206) port 80 (#0)
> GET / HTTP/1.1
> Host: a.aiplatform-notebook.cloud.google.com
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: text/html; charset=UTF-8
< Referrer-Policy: no-referrer
< Content-Length: 1561
< Date: Tue, 17 Dec 2024 04:04:58 GMT
<
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/</code> was not found on this server. <ins>That’s all we know.</ins>
* Connection #0 to host a.aiplatform-notebook.cloud.google.com left intact
kimutae5@kth-private:~$ curl a.composer.googleusercontent.com
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/</code> was not found on this server. <ins>That’s all we know.</ins>