Securing GAE/Cloud Run app with IAP but excluding static content
What is correct way how to secure (with IAP) application which consists of execution logic (servlets) and static content (css, js, ...) which are differentiated by url prefixes (logic=/admin/, static=/css/, /js/, ...). Is it IAP turned on for whole app and url prefixes managed by global IAM conditions like request.path.startsWith("/admin") ? Is there even a performance/networking issue when having IAP turned on even for static resources without conditions?
Or do I have to separate app to two services and have IAP turned on for "logic" part and IAP turned off for "static" part?
One possible method is
Upload your static content directly to Cloud Storage
Make the uploaded contents publicly accessible
Use the urls of the items from Cloud Storage in your GAE/Cloud Run App and then secure your GAE/Cloud Run App with IAP as you intended
The net effect should be that
a) Anyone with a link to any of your static content will see that content
b) Access to your GAE/Cloud Run App is however controlled by IAP
See documentation here