Skip to content

Add ingress settings support #808

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

Closed
marcelgoya opened this issue Oct 30, 2020 · 11 comments · Fixed by #815
Closed

Add ingress settings support #808

marcelgoya opened this issue Oct 30, 2020 · 11 comments · Fixed by #815

Comments

@marcelgoya
Copy link
Contributor

marcelgoya commented Oct 30, 2020

The runWidth function is missing the possibility to set the network ingress flag as compared to the official google cloud sdk:

https://cloud.google.com/functions/docs/networking/network-settings#gcloud

INGRESS_SETTINGS is one of the supported values for ingress settings. The possible values are:

  • all
  • internal-only
  • internal-and-gclb: allows internal traffic as well as traffic sent to a public IP exposed by Google Cloud Load Balancer (GCLB). Blocks traffic sent to cloudfunctions.net or any custom domain set up through Cloud Functions. Prevents users from circumventing any access controls (Cloud Armor, IAP) they set up through GCLB.
@google-oss-bot
Copy link
Collaborator

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@joehan
Copy link
Contributor

joehan commented Nov 12, 2020

Hey @marcelgoya, this sounds like it would be a great feature to add. If you are willing to make a PR to add this, I can bring it through our internal API review process.

@marcelgoya
Copy link
Contributor Author

Hi @joehan, I thought of it more as keeping both product libraries in sync in regards to feature parity as the firebase lib uses the google lib under the hood. I didn't know that this lib is community maintained :)

@marcelgoya
Copy link
Contributor Author

Alright, that's done

@joehan
Copy link
Contributor

joehan commented Nov 18, 2020

Thanks a ton @marcelgoya - and to clarify, we do maintain this library but we always appreciate community contributions :). Since this is an API change, I do need to get it reviewed before it is released, but I don't foresee anyone being against this. If all goes well, this should be released in 1 to 2 weeks.

@marcelgoya
Copy link
Contributor Author

@joehan My pleasure, it was only a 5 minute change anyway :) Awesome, thanks for your help.

@joehan
Copy link
Contributor

joehan commented Nov 24, 2020

This was approved! I'll merge your PR and get a new version released later today. Thanks again for the contribution!

@joehan joehan closed this as completed Nov 24, 2020
@takaaa220
Copy link
Contributor

takaaa220 commented Dec 12, 2020

Is this feature already available?
I have deployed this function so that it cannot be accessed from the outside.
(no compilation error)

// index.ts
export const helloWorld = functions
 .region("asia-northeast1")
 .runWith({
   ingressSettings: "ALLOW_INTERNAL_AND_GCLB",
 })
 .https.onRequest((_, res) => {
   res.send("Hello from Firebase!");
 });

But, I can access this function as follows:

$ curl -X POST https://asia-northeast1-myproject-xxxxx.cloudfunctions.net/helloWorld
> Hello from Firebase!

My version info

firebase-functions: 3.13.0
firebase-tools: 8.19.0
node: 10.22.1

@CarltonK
Copy link

@joehan Was the PR merged? Are the ingress settings live?

@richtu4n
Copy link

It seems this has been merged but not yet released. Is there any timeline on when the next release will be?

@trevorhreed
Copy link

It looks like this was released in v3.12.0.

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

Successfully merging a pull request may close this issue.

7 participants