Appearance
Appearance
Target Audience
This page is primarily intended for users of the Self Hosting (Private Cloud) tier package. If you are using any of the Metaplay SaaS plans, information from this page may not be directly relevant to your needs.
Game server administrators need to secure not only the game server itself but also the infrastructure that it runs on. Our default infrastructure modules attempt to follow reasonable practices in securing the different components, but it is worthwhile to understand the main vectors of attack and ensure that the environments are secured accordingly.
On a high level, we can roughly identify the following main components from the stack, which should be addressed when considering security:
We advocate applying good infrastructure-as-code practices to managing infrastructure, and the tool we suggest for that is HashiCorp Terraform. Adhering to the IaC practices allows you to more easily track how your infrastructure evolves over time as well as to ensure that at every infrastructure deployment you bring your infrastructure to a known, idempotent state.
Along with the benefits of IaC, you should also be mindful of the security related to the provisioning:
In this section, we give pointers and guidance on how to approach securing each level of the infrastructure stack.
Your AWS account is arguably one of the most important items to secure. A malicious party who gains control over your account can cause immense damage to not only your game but also potentially to any backups and other items that may be stored in the account.
If you are deploying your infrastructure via the environments/aws-region
module from our infra-modules
GitHub repository, you deploy a two-tiered network setup by default, where the VPC network is split into public and private subnets. By design, the infra-modules
place all possible infrastructure resources into the private subnets, and only uses the public subnets for hosting public-facing load balancers for the game servers and related tooling.
If you provision additional infrastructure into the VPC network, or if you adjust e.g. the Kubernetes cluster nodes to have public IPs, you should consider the following things.
Most services, as well as the game servers, that are run are run as containers on Kubernetes. Kubernetes is a fairly complex and extremely configurable and extensible system for container orchestration. The flip side of this is that the complexity makes it important for you to secure it properly.
Another attack vector on Kubernetes are the actual underlying compute nodes on which containers are executed. In our base design we run Kubernetes nodes as EC2 instances. We do this to allow for more control over the execution environment (as opposed to e.g. running Kubernetes pods on AWS Fargate). The flip side is that the usual EC2 security precautions should be taken.
/var/log/messages
). These logs can be accessed by default via Grafana.The databases are critical to the functioning of your game and as such are critical pieces of infrastructure to protect.
terraform taint -target='module.infra.module.deployments.random_string.db_password["deployment-name"]'
and re-running Terraform. This creates a new random password for the deployment and updates the game server database user with it.infra-modules
environments/aws-region
module allows you to enable AWS Backups of game server infrastructure resources. It is also possible to pass in a separate AWS Backup vault this way and have backups taken there.Game servers, due to their role, have to be externally accessible for them to be useful. This does, however, mean that the publicly accessible endpoints become possible targets for attacks. As always, one of the safest things to do is to make sure that you periodically update your game server and the underlying software with the latest versions of software and libraries to maintain an up-to-date posture with security patches. That said, there are additional steps that can be taken to increase security.
All Metaplay game servers have an admin dashboard component shipped along with them. The dashboard is a dynamic web application and interacts with backend server APIs to allow administrators and LiveOps managers to control the game. This is also one of the bigger possible attack vectors and a malicious user can wreak significant havoc.
metaplay-gameserver
Helm chart, you can pass annotations to nginx via the admin.annotations
map in Helm values. The ingress-nginx user guide on annotations gives a good starting point for what you can easily tackle with annotations to the Ingress resource.