Security
When you build systems on AWS infrastructure, security responsibilities are shared between you and AWS. This shared responsibility model
IAM roles
AWS Identity and Access Management (IAM) roles allow customers to assign granular access policies and permissions to services and users on the AWS Cloud. This solution creates IAM roles and policies with minimal permission that grant access to the solution’s resources.
Amazon CloudFront
This solution deploys an Amazon CloudFront distribution and uses the default CloudFront domain name and SSL certificate. The default CloudFront SSL certificate only supports TLSv1. To use a later TLS version (TLS1.2 and above), use your own domain name and custom SSL certificate. For more information, refer to Using alternate domain names and HTTPS in the Amazon CloudFront Developer Guide.
The Amazon CloudFront distribution is the unified network entry point. It helps to reduce latency by delivering data through globally dispersed points of presence (PoPs) with automated network mapping and intelligent routing. The inbound traffic to the CloudFront can be either HTTP or HTTPS for compatibility with various clients. As the Prebid Server hosted by ECS only supports HTTP, HTTPS proxy design is used in this solution to improve security. The CloudFront distribution acts as a TLS proxy, where APIs can be delivered over HTTPS using the latest version Transport Layer Security (TLSv1.3) to encrypt and secure communication between viewer clients and the CloudFront.
Application Load Balancer (ALB)
The solution deploys two Application Load Balancers (ALBs). The internet-facing ALB distributes incoming request traffic for Prebid Server through the cluster of containers. It is the external entry point into the cluster, and it is the primary origin for the CloudFront distribution. An internal ALB in the private subnets serves traffic that originates from the Prebid Server tasks themselves. When you opt out of CloudFront and AWS WAF, Prebid Server uses the internal ALB as its cache host. The internal ALB accepts HTTP traffic on port 80 only from the Fargate service security group. CloudFront and the ALB use a shared secret header to prevent external traffic from bypassing the CloudFront distribution and accessing ALB directly. For more information, see Restricting access to Application Load Balancers in the Amazon CloudFront Developer Guide.
Amazon VPC
Amazon VPC is configured with multiple subnets, routes, security groups, and NAT gateways. Security groups permit traffic to and from the subnets. The VPC contains the network interfaces for the Prebid Server cluster nodes. ALB has an interface in each private subnet of the VPC. Each container instance (or node) has an interface in its private subnet of the VPC. The actual number of interfaces varies based on the number of containers running. The VPC is configured for private IP addresses only, and container networks configured within the VPC use the NAT gateway as a default route to the internet for communication.
AWS Fargate
This solution uses Amazon ECS to containerize the Prebid Server. The container runs the open source Prebid Server. By default, deploy.sh builds the container image from deployment/ecr/prebid-server and the deployment stores it in Amazon Elastic Container Registry (Amazon ECR) in your AWS account. A custom build is applied to the open source project’s default container in configuration settings for areas including file output and bidder adapter. To see how the ECS containers are constructed, refer to the Alpine Dockerfile
Security groups
This solution creates Amazon EC2 security groups within an Amazon VPC to act as virtual firewalls that control incoming and outgoing traffic. The security group associated with the internet-facing ALB has a rule with a prefix list that allows ingress only from the CloudFront distribution. When you opt out of CloudFront and AWS WAF, this security group allows ingress from any address instead. The security group associated with the internal ALB allows ingress on port 80 only from the Fargate service security group.
AWS WAF
This solution deploys AWS WAF and Shield Standard as a protection mechanism from DDoS attacks against the Prebid Server cluster. One or more managed rule groups can be activated in AWS WAF by default after extended testing including rules in the Baseline Rule Group and the IP Reputation Rule Group. AWS WAF allows the securement of web applications’ API from attacks before reaching to the servers. The customer has the option to activate, purchase, or use existing rule subscriptions, or add regular expression or CIDR matching rules as needed.
Customer managed AWS KMS keys
AWS Key Management Service (KMS) lets customers create and manage cryptographic keys to activate server-side encryption. This solution creates six KMS keys and uses them in the S3 buckets storing artifacts, CloudFront access log data, CloudTrail events, DataSync log and metric files, and metadata of AWS AWS Glue Data Catalog to secure data at rest.
Audit trails
CloudTrail is configured in this solution for auditing API calls against resources and used for problem analysis and remediation. CloudWatch alarms are used by compute resources for software failures. All compute resources send logging output to CloudWatch logs. CloudFront standard logs are configured to create log files that contain information about the user requests initiated to the solution’s CloudFront distribution.