限制部署到AWS ElasticBeanStalk的FLASK应用程序的访问权限

时间:2020-12-05 16:04:58

I want to restrict access to view my Flask Webpage to only specified AWS users. Say I am doing a project for school, I follow the Aws Tutorial for deploying flask app, however once the app is published. Anyone can consume and post to the flask restful service.

我想限制访问以仅向指定的AWS用户查看我的Flask网页。假设我正在为学校做一个项目,我按照Aws教程来部署烧瓶应用程序,但是一旦应用程序发布。任何人都可以消费并贴上烧瓶,享受宁静的服务。

I want to do the following

我想做以下事情

  • Lock it down so only logged specific IAM users can view and run the rest service.
  • 将其锁定,以便只记录特定的IAM用户可以查看和运行其余服务。

I am aware and tried using SSH to lockdown the in/out bound traffic to a specific IP. however I want to only lock it down to specific IAM groups for now. so say when someone tries to go to my application, amazon redirects for them login.

我知道并尝试使用SSH来锁定到特定IP的输入/输出绑定流量。但是我现在只想将其锁定到特定的IAM组。所以当有人试图去我的应用程序时,亚马逊重定向他们登录。

the site is the following, I want to restrict access to only specific roles or groups http://XXXX-XXXX.us-east-1.elasticbeanstalk.com/

该网站是以下,我想限制只访问特定的角色或组http://XXXX-XXXX.us-east-1.elasticbeanstalk.com/

Thanks.

谢谢。

1 个解决方案

#1


1  

You could for example use AWS API Gateway in front of your app using IAM Authorization: https://aws.amazon.com/premiumsupport/knowledge-center/iam-authentication-api-gateway/

例如,您可以使用IAM授权在应用程序前使用AWS API Gateway:https://aws.amazon.com/premiumsupport/knowledge-center/iam-authentication-api-gateway/

To configure the API Gateway to use IAM authorization from the console, go to the resources and click on your method. Then click on the Method Request and choose AWS_IAM in the Authorization dropdown: 限制部署到AWS ElasticBeanStalk的FLASK应用程序的访问权限

要配置API网关以从控制台使用IAM授权,请转到资源并单击您的方法。然后单击Method Request并在Authorization下拉列表中选择AWS_IAM:

#1


1  

You could for example use AWS API Gateway in front of your app using IAM Authorization: https://aws.amazon.com/premiumsupport/knowledge-center/iam-authentication-api-gateway/

例如,您可以使用IAM授权在应用程序前使用AWS API Gateway:https://aws.amazon.com/premiumsupport/knowledge-center/iam-authentication-api-gateway/

To configure the API Gateway to use IAM authorization from the console, go to the resources and click on your method. Then click on the Method Request and choose AWS_IAM in the Authorization dropdown: 限制部署到AWS ElasticBeanStalk的FLASK应用程序的访问权限

要配置API网关以从控制台使用IAM授权,请转到资源并单击您的方法。然后单击Method Request并在Authorization下拉列表中选择AWS_IAM: