Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

amazon web services - setting up a http basic authorization password for aws ec2 load balancer

I have an ECS cluster with a private IP address that corresponds to the target IP address of EC2 Load Balancing Target Group that corresponds to a specific Load Balancer. When an HTTP request is made to this load balancer I'd like it to present a prompt for HTTP Basic Authorization credentials. How might I do this? Is it even possible?

I'd also like to put some restrictions on the path as well.

<If "req('Host') =~ /mywebsite.com$/ && %{REQUEST_URI} !~ /agreement/">
        Include /etc/apache2/conf-available/htpasswd.conf
</If>

Is this possible?

In the Load Balancer management page I can add and edit listeners. If the listener is using HTTPS I can add a rule that has an "Authenticate..." action but the two options available to me are Amazon Cognito and OIDC, neither of which seem to do HTTP Basic Authorization. I guess AWS Lambda lets you create Lambda based authorizers instead of having to use Amazon Cognito per https://www.cloudmailin.com/blog/basic_auth_with_aws_lambda but it doesn't look like you can use Lambda's with Load Balancers on AWS?

question from:https://stackoverflow.com/questions/65901615/setting-up-a-http-basic-authorization-password-for-aws-ec2-load-balancer

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Yes, you can set up Lambda to receive requests from an Application Load Balancers. See here for more info on that.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...