Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support http security features in serverless #251

Open
fhirfly opened this issue Mar 25, 2021 · 0 comments
Open

support http security features in serverless #251

fhirfly opened this issue Mar 25, 2021 · 0 comments

Comments

@fhirfly
Copy link

fhirfly commented Mar 25, 2021

https://cloud.google.com/functions/docs/writing/http

Security levels
The security level feature controls whether an HTTP function's URL supports HTTPS only, or both HTTP and HTTPS. Support for both HTTP and HTTPS is the default.

When you configure HTTP functions so that they can only be triggered with HTTPS, users who attempt to use the HTTP protocol will be redirected.

You specify an HTTP function's security level during deployment:

If you are using the gcloud command-line tool to deploy your function, you can set the function's security level using the --security-level flag. Its possible values are secure-always or secure-optional, which is the default. For example:

gcloud functions deploy FUNCTION_NAME --trigger-http --security-level=secure-always...
If you are deploying your function from the Cloud Console, use the Require HTTPS checkbox to make the function require HTTPS.

If the function can be triggered with either HTTP or HTTPS, the function code can examine the value of the request header X-Forwarded-Proto to determine which protocol was used. A secure request will have the value https for that header, while other requests will have the value http.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant