AWS Game Lift Server: Best Solution for Generating and Rotating API Keys for AWS Server Authentication?

0

We are currently setting up some authentication systems for our UE4 game servers so that we are sure they are the only devices/users that are capable of accessing our internal API / LAMDBA functions.

With that in mind, there is a desire to not hard code any COGNITO user ID's or tokens into the actual server-code itself. Instead, we would like to pursue having these tokens be generated and cycled through on AWS's side, to keep it decoupled. We are undecided whether these tokens should be for the life of the Gamelift server or for a set period of time—whichever is most feasible. This way, if we need to adjust access to certain features down the road, it will not require an update to the deployed Unreal Engine server build.

Does AWS API or LAMDBA have any features out of the box to check if an API request is coming from within AWS, ideally from one of the active Gamelift instances?

While we may still need to create a COGNITO identity for the servers, or just check the local IP of the running Gamelift servers, the ideal flow would look like:

  1. UE4 game server on AWS asks for a token on Startup.

  2. LAMDBA Authorization script checks to make sure it is valid and coming from within AWS/Gamelift

  3. Once Validated, LAMDBA function provides a token to enable server to use in backend LAMDBA functions.

  4. Before Gamelift Server shutdown, revoke access or add to a "black-listed" token Database to prevent second use before token expiration.

1개 답변
0

Is the UE4 game server in the same VPC as the lambda authorization script? In that case you can use private API gateway endpoint - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-private-apis.html

If not, then you can take a look at resource policies - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-resource-policies.html

profile pictureAWS
전문가
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠