

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 프록시 서버와 AWS CodeBuild 함께 사용
<a name="use-proxy-server"></a>

 프록시 서버와 AWS CodeBuild 함께를 사용하여 인터넷과 주고받는 HTTP 및 HTTPS 트래픽을 규제할 수 있습니다. 프록시 서버에서 CodeBuild를 실행하려면 VPC에서 퍼블릭 서브넷에 프록시 서버를 설치하고 가상 서브넷에 CodeBuild를 설치합니다.

프록시 서버에서 CodeBuild를 실행하는 주요 사용 사례는 두 가지입니다.
+  VPC에서 NAT 게이트웨이 또는 NAT 인스턴스를 사용할 필요가 없어집니다.
+  프록시 서버 내 인스턴스가 액세스할 수 있는 URL을 지정하고 프록시 서버가 액세스를 거부하는 URL을 지정할 수 있습니다.

 CodeBuild를 두 가지 유형의 프록시 서버에 사용할 수 있습니다. 두 유형 모두, 프록시 서버는 퍼블릭 서브넷에서 실행되고 CodeBuild는 프라이빗 서브넷에서 실행됩니다.
+  **명시적 프록시**: 명시적 프록시 서버를 사용하는 경우 프로젝트 수준에서 CodeBuild에 `NO_PROXY`, `HTTP_PROXY` 및 `HTTPS_PROXY` 환경 변수를 구성해야 합니다. 자세한 내용은 [에서 빌드 프로젝트 설정 변경 AWS CodeBuild](change-project.md) 및 [에서 빌드 프로젝트 생성AWS CodeBuild](create-project.md) 섹션을 참조하세요.
+  **투명 프록시**: 투명 프록시 서버를 사용하는 경우 특별한 구성이 필요하지 않습니다.

**Topics**
+ [프록시 서버에서 CodeBuild를 실행하기 위해 필요한 구성 요소 설정](use-proxy-server-transparent-components.md)
+ [명시적 프록시 서버에서 CodeBuild 실행](run-codebuild-in-explicit-proxy-server.md)
+ [투명 프록시 서버에서 CodeBuild 실행](run-codebuild-in-transparent-proxy-server.md)
+ [프록시 서버에서 패키지 관리자 및 기타 도구 실행](use-proxy-server-tools.md)

# 프록시 서버에서 CodeBuild를 실행하기 위해 필요한 구성 요소 설정
<a name="use-proxy-server-transparent-components"></a>

 투명 또는 명시적 프록시 서버에서 실행하려면 다음 구성 요소가 필요합니다 AWS CodeBuild .
+  VPC 
+  프록시 서버용 VPC에 퍼블릭 서브넷 1개.
+  CodeBuild용 VPC에 프라이빗 서브넷 1개.
+  VPC와 인터넷 간 통신을 허용하는 인터넷 게이트웨이.

 다음 다이어그램은 구성 요소가 상호 작용하는 방식을 보여 줍니다.

![\[다이어그램에서 구성 요소가 상호 작용하는 방식을 보여 줍니다.\]](http://docs.aws.amazon.com/ko_kr/codebuild/latest/userguide/images/codebuild-proxy-transparent.png)


## VPC, 서브넷 및 네트워크 게이트웨이 설정
<a name="use-proxy-server-transparent-setup"></a>

 투명 또는 명시적 프록시 서버에서 AWS CodeBuild 를 실행하려면 다음 단계가 필요합니다.

1. VPC를 생성합니다. 자세한 내용은 Amazon VPC 사용 설명서의 [VPC 생성](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-vpcs.html#Create-VPC)을 참조하세요.**

1. VPC에서 서브넷 2개를 만듭니다. 하나는 프록시 서버가 실행되는 `Public Subnet`이라는 퍼블릭 서브넷입니다. 다른 하나는 CodeBuild가 실행되는 `Private Subnet`이라는 프라이빗 서브넷입니다.

   자세한 내용은 [VPC에서 서브넷 만들기](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-vpcs.html#AddaSubnet) 단원을 참조하십시오.

1.  인터넷 게이트웨이를 생성하여 VPC에 연결합니다. 자세한 내용은 [인터넷 게이트웨이 생성 및 연결](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html#Add_IGW_Attach_Gateway)을 참조하세요.

1.  기본 라우팅 테이블에 VPC(0.0.0.0/0)에서 인터넷 게이트웨이로 가는 트래픽을 라우팅하는 규칙을 추가합니다. 자세한 내용은 [라우팅 테이블에 경로 추가 및 라우팅 테이블에서 경로 제거](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html#AddRemoveRoutes) 단원을 참조하십시오.

1.  VPC의 기본 보안 그룹에 VPC(0.0.0.0/0)로부터 들어오는 SSH 트래픽(TCP 22)을 허용하는 규칙을 추가합니다.

1.  Amazon EC2 인스턴스를 시작하려면 Amazon EC2 사용 설명서에서 [인스턴스 시작 마법사를 사용하여 인스턴스 시작](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/launching-instance.html)의 지침을 따르세요.** 마법사를 실행할 때 다음 옵션을 선택합니다.
   +  **인스턴스 유형 선택**에서 Amazon Linux Amazon Machine Image(AMI)를 선택합니다.
   +  **서브넷**에서 이 주제의 앞부분에서 만든 퍼블릭 서브넷을 선택합니다. 제안된 이름을 사용했다면 **퍼블릭 서브넷**입니다.
   +  [**Auto-assign Public IP**]에서 [**Enable**]을 선택합니다.
   +  **보안 그룹 구성** 페이지의 **보안 그룹 할당**에서 **Select an existing security group(기존 보안 그룹 선택)**을 선택합니다. 그런 다음 기본 보안 그룹을 선택합니다.
   +  **시작**을 선택한 후 기존 키 페어를 하나 선택하거나 생성합니다.

    다른 옵션은 모두 기본 설정을 선택합니다.

1.  EC2 인스턴스가 실행되면 원본/대상 확인을 비활성화합니다. 자세한 내용은 Amazon VPC 사용 설명서의 [소스/대상 확인 비활성화](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html#EIP_Disable_SrcDestCheck)를 참조하세요.**

1.  VPC에서 라우팅 테이블을 만듭니다. 라우팅 테이블에 인터넷으로 향하는 트래픽을 프록시 서버로 라우팅하는 규칙을 추가합니다. 이 라우팅 테이블을 프라이빗 서브넷과 연결합니다. 이 단계는 CodeBuild가 실행되는 프라이빗 서브넷 내 인스턴스의 아웃바운드 요청이 항상 프록시 서버를 통해 라우팅되도록 하는 데 필요합니다.

## 프록시 서버 설치 및 구성
<a name="use-proxy-server-squid-install"></a>

 선택할 수 있는 프록시 서버는 많습니다. 오픈 소스 프록시 서버인 Squid는가 프록시 서버에서 어떻게 AWS CodeBuild 실행되는지 보여주는 데 사용됩니다. 동일한 개념을 다른 프록시 서버에도 적용할 수 있습니다.

 Squid를 설치하려면 다음 명령을 실행하여 yum repo를 사용합니다.

```
sudo yum update -y
sudo yum install -y squid
```

 Squid를 설치한 후 이 주제의 뒷부분에 나오는 지침에 따라 `squid.conf` 파일을 편집합니다.

## HTTPS 트래픽에 대해 Squid 구성
<a name="use-proxy-server-squid-configure-https"></a>

 HTTPS의 경우, TLS(전송 계층 보안) 연결에서 HTTP 트래픽이 캡슐화된 것입니다. Squid는 [SslPeekAndSplice](https://wiki.squid-cache.org/Features/SslPeekAndSplice)라는 기능을 사용하여 TLS 초기화에서 요청된 인터넷 호스트를 포함하는 SNI(서버 이름 표시)를 검색합니다. 이는 Squid가 HTTPS 트래픽을 해독할 필요가 없도록 하기 위해 필요합니다. SslPeekAndSplice를 활성화하려면 Squid가 인증서를 요구합니다. OpenSSL을 사용하여 이 인증서를 만듭니다.

```
sudo mkdir /etc/squid/ssl
cd /etc/squid/ssl
sudo openssl genrsa -out squid.key 2048
sudo openssl req -new -key squid.key -out squid.csr -subj "/C=XX/ST=XX/L=squid/O=squid/CN=squid"
sudo openssl x509 -req -days 3650 -in squid.csr -signkey squid.key -out squid.crt
sudo cat squid.key squid.crt | sudo tee squid.pem
```

**참고**  
 HTTP의 경우, Squid를 구성할 필요가 없습니다. 모든 HTTP/1.1 요청 메시지에서 요청되는 인터넷 호스를 지정하는 호스트 헤더 필드를 검색할 수 있습니다.

# 명시적 프록시 서버에서 CodeBuild 실행
<a name="run-codebuild-in-explicit-proxy-server"></a>

 명시적 프록시 서버에서 AWS CodeBuild 를 실행하려면 외부 사이트와의 트래픽을 허용하거나 거부하도록 프록시 서버를 구성한 다음 `HTTP_PROXY` 및 `HTTPS_PROXY` 환경 변수를 구성해야 합니다.

**Topics**
+ [Squid를 명시적 프록시 서버로 구성](#use-proxy-server-explicit-squid-configure)
+ [CodeBuild 프로젝트 생성](#use-proxy-server-explicit-create-acb-project)
+ [명시적 프록시 서버 샘플 `squid.conf` 파일](#use-proxy-server-explicit-sample-squid-conf)

## Squid를 명시적 프록시 서버로 구성
<a name="use-proxy-server-explicit-squid-configure"></a>

 Squid를 명시적 프록시 서버로 구성하려면 다음과 같이 `/etc/squid/squid.conf` 파일을 수정해야 합니다.
+  다음 기본 ACL(액세스 제어 목록) 규칙을 제거합니다.

  ```
  acl localnet src 10.0.0.0/8     
  acl localnet src 172.16.0.0/12  
  acl localnet src 192.168.0.0/16 
  acl localnet src fc00::/7       
  acl localnet src fe80::/10
  ```

   제거한 기본 ACL 규칙 대신 다음 규칙을 추가합니다. 첫 번째 줄은 VPC의 요청을 허용합니다. 다음 두 줄은 프록시 서버에 AWS CodeBuild가 사용할 수 있는 대상 URL에 대한 액세스 권한을 부여합니다. 마지막 줄에서 정규식을 편집하여 AWS 리전에서 S3 버킷 또는 CodeCommit 리포지토리를 지정합니다. 예제:
  + 소스가 Amazon S3일 경우 **acl download\$1src dstdom\$1regex .\$1s3\$1.us-west-1\$1.amazonaws\$1.com** 명령을 사용하여 `us-west-1` 리전 내 S3 버킷에 대한 액세스 권한을 부여합니다.
  +  소스가 인 경우 AWS CodeCommit`git-codecommit.<your-region>.amazonaws.com`를 사용하여 허용 목록에 AWS 리전을 추가합니다.

  ```
  acl localnet src 10.1.0.0/16 #Only allow requests from within the VPC
  acl allowed_sites dstdomain .github.com #Allows to download source from GitHub
  acl allowed_sites dstdomain .bitbucket.com #Allows to download source from Bitbucket
  acl download_src dstdom_regex .*\.amazonaws\.com #Allows to download source from Amazon S3 or CodeCommit
  ```
+  `http_access allow localnet`을 다음으로 바꿉니다.

  ```
  http_access allow localnet allowed_sites
  http_access allow localnet download_src
  ```
+ 빌드가 로그 및 아티팩트를 업로드하도록 하려면 다음 중 하나를 수행하십시오.

  1. `http_access deny all` 문 앞에 다음 문을 삽입합니다. 이를 통해 CodeBuild는 CloudWatch와 Amazon S3에 액세스할 수 있습니다. CodeBuild에서 CloudWatch Logs를 생성하려면 CloudWatch에 대한 액세스 권한이 필요합니다. Amazon S3에 대한 액세스는 아티팩트 및 Amazon S3 캐싱을 업로드하기 위해 필요합니다.
     + 

       ```
       https_port 3130 cert=/etc/squid/ssl/squid.pem ssl-bump intercept
       acl SSL_port port 443
       http_access allow SSL_port
       acl allowed_https_sites ssl::server_name .amazonaws.com
       acl step1 at_step SslBump1
       acl step2 at_step SslBump2
       acl step3 at_step SslBump3
       ssl_bump peek step1 all
       ssl_bump peek step2 allowed_https_sites
       ssl_bump splice step3 allowed_https_sites
       ssl_bump terminate step2 all
       ```
     + `squid.conf`를 저장한 후 다음 명령을 실행합니다.

       ```
       sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 3130
       sudo service squid restart
       ```

  1.  buildspec 파일에 `proxy`를 추가합니다. 자세한 내용은 [buildspec 구문](build-spec-ref.md#build-spec-ref-syntax) 단원을 참조하십시오.

     ```
     version: 0.2
     proxy:
       upload-artifacts: yes
       logs: yes
     phases:
       build:
         commands:
           - command
     ```

**참고**  
RequestError 시간 초과 오류가 발생할 경우 [프록시 서버에서 CodeBuild를 실행할 때 RequestError 시간 초과 오류](troubleshooting.md#code-request-timeout-error) 단원을 참조하십시오.

자세한 내용은 본 주제의 후반부에서 [명시적 프록시 서버 샘플 `squid.conf` 파일](#use-proxy-server-explicit-sample-squid-conf)을 참조하세요.

## CodeBuild 프로젝트 생성
<a name="use-proxy-server-explicit-create-acb-project"></a>

 명시적 프록시 서버 AWS CodeBuild 로를 실행하려면 프로젝트 수준에서 프록시 서버 및 포트 3128에 대해 생성한 EC2 인스턴스의 프라이빗 IP 주소로 `HTTP_PROXY` 및 `HTTPS_PROXY` 환경 변수를 설정합니다. 프라이빗 IP 주소는 `http://your-ec2-private-ip-address:3128`과 비슷합니다. 자세한 내용은 [에서 빌드 프로젝트 생성AWS CodeBuild](create-project.md) 및 [에서 빌드 프로젝트 설정 변경 AWS CodeBuild](change-project.md) 섹션을 참조하세요.

 다음 명령을 사용하여 Squid 프록시 액세스 로그를 확인합니다.

```
sudo tail -f /var/log/squid/access.log
```

## 명시적 프록시 서버 샘플 `squid.conf` 파일
<a name="use-proxy-server-explicit-sample-squid-conf"></a>

 다음은 명시적 프록시 서버용으로 구성된 `squid.conf` 파일의 예입니다.

```
  acl localnet src 10.0.0.0/16 #Only allow requests from within the VPC
  # add all URLS to be whitelisted for download source and commands to be run in build environment
  acl allowed_sites dstdomain .github.com    #Allows to download source from github
  acl allowed_sites dstdomain .bitbucket.com #Allows to download source from bitbucket
  acl allowed_sites dstdomain ppa.launchpad.net #Allows to run apt-get in build environment
  acl download_src dstdom_regex .*\.amazonaws\.com #Allows to download source from S3 or CodeCommit
  acl SSL_ports port 443
  acl Safe_ports port 80		# http
  acl Safe_ports port 21		# ftp
  acl Safe_ports port 443		# https
  acl Safe_ports port 70		# gopher
  acl Safe_ports port 210		# wais
  acl Safe_ports port 1025-65535	# unregistered ports
  acl Safe_ports port 280		# http-mgmt
  acl Safe_ports port 488		# gss-http
  acl Safe_ports port 591		# filemaker
  acl Safe_ports port 777		# multiling http
  acl CONNECT method CONNECT
  #
  # Recommended minimum Access Permission configuration:
  #
  # Deny requests to certain unsafe ports
  http_access deny !Safe_ports
  # Deny CONNECT to other than secure SSL ports
  http_access deny CONNECT !SSL_ports
  # Only allow cachemgr access from localhost
  http_access allow localhost manager
  http_access deny manager
  # We strongly recommend the following be uncommented to protect innocent
  # web applications running on the proxy server who think the only
  # one who can access services on "localhost" is a local user
  #http_access deny to_localhost
  #
  # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
  #
  # Example rule allowing access from your local networks.
  # Adapt localnet in the ACL section to list your (internal) IP networks
  # from where browsing should be allowed
  http_access allow localnet allowed_sites
  http_access allow localnet download_src
  http_access allow localhost
  # Add this for CodeBuild to access CWL end point, caching and upload artifacts S3 bucket end point
  https_port 3130 cert=/etc/squid/ssl/squid.pem ssl-bump intercept
  acl SSL_port port 443
  http_access allow SSL_port
  acl allowed_https_sites ssl::server_name .amazonaws.com
  acl step1 at_step SslBump1
  acl step2 at_step SslBump2
  acl step3 at_step SslBump3
  ssl_bump peek step1 all
  ssl_bump peek step2 allowed_https_sites
  ssl_bump splice step3 allowed_https_sites
  ssl_bump terminate step2 all
  # And finally deny all other access to this proxy
  http_access deny all
  # Squid normally listens to port 3128
  http_port 3128
  # Uncomment and adjust the following to add a disk cache directory.
  #cache_dir ufs /var/spool/squid 100 16 256
  # Leave coredumps in the first cache dir
  coredump_dir /var/spool/squid
  #
  # Add any of your own refresh_pattern entries above these.
  #
  refresh_pattern ^ftp:		1440	20%	10080
  refresh_pattern ^gopher:	1440	0%	1440
  refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
  refresh_pattern .		0	20%	4320
```

# 투명 프록시 서버에서 CodeBuild 실행
<a name="run-codebuild-in-transparent-proxy-server"></a>

 투명한 프록시 서버에서 AWS CodeBuild 를 실행하려면 상호 작용하는 웹 사이트 및 도메인에 액세스할 수 있도록 프록시 서버를 구성해야 합니다.

**Topics**
+ [Squid를 투명 프록시 서버로 구성](#use-proxy-server-transparent-squid-configure)
+ [CodeBuild 프로젝트 생성](#use-proxy-server-transparent-create-acb-project)

## Squid를 투명 프록시 서버로 구성
<a name="use-proxy-server-transparent-squid-configure"></a>

 프록시 서버를 투명으로 구성하려면 액세스하려는 도메인 및 웹 사이트에 대한 액세스 권한을 부여해야 합니다. 투명한 프록시 서버 AWS CodeBuild 로를 실행하려면에 대한 액세스 권한을 부여해야 합니다`amazonaws.com`. 또한 CodeBuild가 사용하는 다른 웹 사이트에 대해서도 액세스 권한을 부여해야 합니다. 이러한 웹 사이트는 CodeBuild 프로젝트를 생성하는 방식에 따라 달라집니다. 예를 들어 GitHub, Bitbucket, Yum, Maven 같은 리포지토리용 웹 사이트입니다. Squid에 특정 도메인 및 웹 사이트에 대한 액세스 권한을 부여하려면 다음과 같은 명령을 사용하여 `squid.conf` 파일을 업데이트합니다. 이 샘플 명령은 `amazonaws.com`, `github.com` 및 `bitbucket.com`에 대한 액세스 권한을 부여합니다. 이 샘플을 편집하여 다른 웹 사이트에 대한 액세스 권한을 부여할 수 있습니다.

```
cat | sudo tee /etc/squid/squid.conf ≪EOF
visible_hostname squid
#Handling HTTP requests
http_port 3129 intercept
acl allowed_http_sites dstdomain .amazonaws.com
#acl allowed_http_sites dstdomain domain_name [uncomment this line to add another domain]
http_access allow allowed_http_sites
#Handling HTTPS requests
https_port 3130 cert=/etc/squid/ssl/squid.pem ssl-bump intercept
acl SSL_port port 443
http_access allow SSL_port
acl allowed_https_sites ssl::server_name .amazonaws.com
acl allowed_https_sites ssl::server_name .github.com
acl allowed_https_sites ssl::server_name .bitbucket.com
#acl allowed_https_sites ssl::server_name [uncomment this line to add another website]
acl step1 at_step SslBump1
acl step2 at_step SslBump2
acl step3 at_step SslBump3
ssl_bump peek step1 all
ssl_bump peek step2 allowed_https_sites
ssl_bump splice step3 allowed_https_sites
ssl_bump terminate step2 all
http_access deny all
EOF
```

 프라이빗 서브넷에 있는 인스턴스에서 오는 수신 요청은 Squid 포트로 리디렉션해야 합니다. Squid는 HTTP 트래픽의 경우 포트 3129(80이 아님)에서 수신 대기하고, HTTPS 트래픽의 경우 포트 3130(443이 아님)에서 수신 대기합니다. **iptables** 명령을 사용하여 트래픽을 라우팅합니다.

```
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3129
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 3130
sudo service iptables save
sudo service squid start
```

## CodeBuild 프로젝트 생성
<a name="use-proxy-server-transparent-create-acb-project"></a>

 프록시 서버를 구성한 후에는 추가 구성 없이 프라이빗 서브넷 AWS CodeBuild 에서와 함께 사용할 수 있습니다. 모든 HTTP 및 HTTPS 요청이 퍼블릭 프록시 서버를 통과합니다. 다음 명령을 사용하여 Squid 프록시 액세스 로그를 확인합니다.

```
sudo tail -f /var/log/squid/access.log
```

# 프록시 서버에서 패키지 관리자 및 기타 도구 실행
<a name="use-proxy-server-tools"></a>

다음 절차에 따라 프록시 서버에서 패키지 관리자 및 기타 도구를 실행합니다.

**프록시 서버에서 패키지 관리자와 같은 도구를 실행하려면**

1.  `squid.conf` 파일에 문을 추가하여 프록시 서버의 허용 목록에 도구를 추가합니다.

1.  프록시 서버의 프라이빗 엔드포인트를 가리키는 줄을 buildspec 파일에 추가합니다.

 다음 예제는 `apt-get`, `curl` 및 `maven`에서 이렇게 하는 방법을 보여줍니다. 다른 도구를 사용하는 경우에도 동일한 원칙이 적용됩니다. CodeBuild가 프록시 서버의 엔드포인트를 인식하도록 `squid.conf` 파일의 허용 목록에 추가하고 buildspec 파일에 명령을 추가합니다.

**프록시 서버에서 `apt-get`을 실행하려면**

1. `squid.conf` 파일에 다음 문을 추가하여 프록시 서버의 허용 목록에 `apt-get`을 추가합니다. 처음 세 줄은 빌드 환경에서 `apt-get`을 실행하도록 허용합니다.

   ```
   acl allowed_sites dstdomain ppa.launchpad.net # Required for apt-get to run in the build environment
   acl apt_get dstdom_regex .*\.launchpad.net # Required for CodeBuild to run apt-get in the build environment
   acl apt_get dstdom_regex .*\.ubuntu.com    # Required for CodeBuild to run apt-get in the build environment
   http_access allow localnet allowed_sites
   http_access allow localnet apt_get
   ```

1. `apt-get` 명령이 `/etc/apt/apt.conf.d/00proxy`에서 프록시 구성을 검색하도록 buildspec 파일에 다음 문을 추가합니다.

   ```
   echo 'Acquire::http::Proxy "http://<private-ip-of-proxy-server>:3128"; Acquire::https::Proxy "http://<private-ip-of-proxy-server>:3128"; Acquire::ftp::Proxy "http://<private-ip-of-proxy-server>:3128";' > /etc/apt/apt.conf.d/00proxy
   ```

**프록시 서버에서 `curl`을 실행하려면**

1.  `squid.conf` 파일에 다음을 추가하여 빌드 환경의 허용 목록에 `curl`을 추가합니다.

   ```
   acl allowed_sites dstdomain ppa.launchpad.net # Required to run apt-get in the build environment
   acl allowed_sites dstdomain google.com # Required for access to a webiste. This example uses www.google.com.
   http_access allow localnet allowed_sites
   http_access allow localnet apt_get
   ```

1.  `curl`이 프라이빗 프록시 서버를 사용하여 `squid.conf`에 추가한 웹 사이트에 액세스하도록 buildspec 파일에 다음 문을 추가합니다. 이 예제에서 웹 사이트는 `google.com`입니다.

   ```
   curl -x <private-ip-of-proxy-server>:3128 https://www.google.com
   ```

**프록시 서버에서 `maven`을 실행하려면**

1.  `squid.conf` 파일에 다음을 추가하여 빌드 환경의 허용 목록에 `maven`을 추가합니다.

   ```
   acl allowed_sites dstdomain ppa.launchpad.net # Required to run apt-get in the build environment
   acl maven dstdom_regex .*\.maven.org # Allows access to the maven repository in the build environment
   http_access allow localnet allowed_sites
   http_access allow localnet maven
   ```

1. buildspec 파일에 다음 문을 추가합니다.

   ```
   maven clean install -DproxySet=true -DproxyHost=<private-ip-of-proxy-server> -DproxyPort=3128
   ```