AWS Lambda와 WAF를 이용한 Rate-Based Blacklisting 기능 구현

2016-05-10 KENNETH 0

AWS Lambda와 WAF를 이용한 Rate-Based Blacklisting 기능 구현 여러분들 대다수는 원하지 않는 요청이나, crawl-delay directive의 기준을 무시하는 봇이나 크롤러 같은 스캐닝 도구로 인해 웹서버의 가용성에 문제가 발생하는 경우를 고민해 보셨을 것입니다. 흔히 HTTP flood 라고 불리는 분산 서비스 거부 공격(DDoS)의 목적은 시스템에 부담을 일으켜서 정상 사용자의 사용을 방해하기 위한(아래 그림 처럼) 것입니다. 이 글에서는 원하지 않는 트래픽을 요청량 기준으로 자동으로 탐지하고 AWS WAF (현재 WAF의 기능은 Amazon CloudFront 의 컨텐츠 배송 서비스 상에서 동작합니다)의 구성을 업데이트하여 악의의 사용자로부터의 요청을 차단하는 방법을 소개합니다. 이와 같은 기능을 AWS Lambda를 사용하여 CloudFront의 엑세스 로그에서 악성 요청을 식별하도록 구현하게 됩니다. 이 기능은 Amazon CloudWatch 상의 메트릭들을 활용하여 얼마나 많은 요청들이 처리되었고, 블락된 오리진의 수가 얼마인지를 모니터합니다. 또한 AWS WAF서비스는 수작업으로 잘 알려진 봇 네트웍 같이 금지하고 싶은 IP 대역을 추가할 수도 있습니다. 위 그림은 모든 요청을 처리하다가 웹서버의 모든 리소스를 소진하는 모양을 나타냅니다. 아래 [ more… ]

No Image

WordPress 4.5.2 Security Release

2016-05-07 KENNETH 0

WordPress 4.5.2 Security Release WordPress 4.5.2 is now available. This is a security release for all previous versions and we strongly encourage you to update your sites immediately. WordPress versions 4.5.1 and earlier are affected by a SOME vulnerability through Plupload, the third-party library WordPress uses for uploading files. WordPress versions 4.2 through 4.5.1 are vulnerable to reflected XSS using specially crafted URIs through MediaElement.js, the third-party library used for media players. MediaElement.js and Plupload have also released updates fixing these issues. Both issues were analyzed and reported by Mario Heiderich, Masato Kinugawa, and Filedescriptor from Cure53. Thanks to the team for practicing responsible disclosure, and to the Plupload and MediaElement.js teams for working closely with us to coördinate and fix these issues. Download WordPress 4.5.2 or venture over to Dashboard → Updates and simply click “Update Now.” Sites that [ more… ]

3BetGaming Serves More Customers and Saves 75% Bandwidth with NGINX Plus

2016-05-06 KENNETH 0

3BetGaming Serves More Customers and Saves 75% Bandwidth with NGINX Plus   Situation 3BetGaming is a software provider for online sports betting companies. Whether before a match or in the middle of the game, 3BetGaming’s backend infrastructure powers the bidding behind thousands of games every day. The company offers the most extensive sports book application on the market, and supports nearly 12,000 active players, 14,000 live monthly events, and 100 million bets so far. 3BetGaming is based in Malta and has clients around the world – from growing startups to massive corporations. 3BetGaming consistently provides flexible and powerful software for its diverse range of clients. As its customer base grew, 3BetGaming faced a problem with its existing virtual load balancing appliances. The growth in traffic was bringing 3BetGaming close to exceeding the bandwidth limit imposed by its existing license. In [ more… ]

Asynchronous Programming and Monad Transformers in Scala

2016-05-04 KENNETH 0

Asynchronous Programming and Monad Transformers in Scala 자바와 스프링으로 웹서버를 개발하고 있다면 아래와 같이 HTTP 프로그래밍을 했을것이라 생각이 됩니다. // ItemApiController.java import … @RestController @RequestMapping(“/api/items”) public class ItemApiController { @Autowired RestTemplate restTemplate; @RequestMapping(value = “/{id}”, produces = MediaType.APPLICATION_JSON_VALUE) public ItemDto getItem(@PathVariable Long id) { // 응답이 올때 까지 thread는 대기하게 된다. return restTemplate.getForObject(“http://remote/fetch/item/” + id, ItemDto.class); } } 익숙한 이상할것이 없는 동기화 프로그래밍 코드입니다. 동기화 방식은 아래와 같은 장점을 가지고 있습니다. 프로그래밍하기 간편하고 순차적으로 실행되기 때문에 상대적으로 개발하기 쉽습니다. Multi thread 환경을 고려하지 않아도 되기 때문에 디버깅하기 편합니다. Request가 thread를 독점하기 때문에 필요한 상태를 thread에 저장할수 있습니다.(stateful) 하지만 동기화 방식으로 개발하고 운영하다 보면 thead pool hell이라 불리는 아래와 같은 현상을 자주 마주하게 됩니다. * 이미지 출처: The play framework at Linkedin 특정 API가 응답이 느릴경우 Request를 처리하는 thread는 blocking되고 응답이 오거나 timeout이 발생할때 까지는 thread는 waiting상태에서 머무르게 됩니다. 많은 수의 [ more… ]

Using DNS for Service Discovery with NGINX and NGINX Plus

2016-04-28 KENNETH 0

Using DNS for Service Discovery with NGINX and NGINX Plus One of the great advantages of a microservices architecture is how quickly and easily you can scale service instances. With multiple service instances you need a load balancer and some way to quickly inform it of changes to the set of available service instances. This is known as service discovery. NGINX Plus provides two options for integrating with service discovery systems: the on-the-fly reconfiguration API and Domain Name System (DNS) re-resolution. This blog post focuses on the latter. When you scale service instances (we’ll call them backends in this blog post) by adding or removing virtual machines (VMs) or containers, the configuration of the load balancer must be changed to reflect every change to the set of backends. Scaling can occur multiple times per day, per hour, or even per minute, depending [ more… ]