简体   繁体   English

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

[英]Restrict Access for FLASK Application deployed to AWS ElasticBeanStalk

I want to restrict access to view my Flask Webpage to only specified AWS users. 我想将访问权限限制为仅允许指定的AWS用户查看我的Flask网页。 Say I am doing a project for school, I follow the Aws Tutorial for deploying flask app , however once the app is published. 假设我正在为一个学校做一个项目,我遵循Aws教程来部署flask应用程序 ,但是一旦该应用程序发布。 Anyone can consume and post to the flask restful service. 任何人都可以消耗并发布到烧瓶上的静态服务。

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. 我知道并尝试使用SSH锁定到特定IP的入/出绑定流量。 however I want to only lock it down to specific IAM groups for now. 但是,我现在仅将其锁定到特定的IAM组。 so say when someone tries to go to my application, amazon redirects for them login. 所以说当有人尝试进入我的应用程序时,亚马逊会重定向他们的登录名。

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. 谢谢。

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 Gatewayhttps : //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. 要将API网关配置为使用控制台中的IAM授权,请转至资源并单击您的方法。 Then click on the Method Request and choose AWS_IAM in the Authorization dropdown: 然后单击“方法请求”, AWS_IAM在“授权”下拉列表中选择“ AWS_IAM ”: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM