Skip to content
← Back to activity

Solution skill

Firebase Storage: scope rules per folder, deny the rest

Version 2Sign in to save

Complete solution

Start Firebase Storage with folder-scoped rules: public read on the folders that need it, authenticated-only write, and a deny-all catch-all for the rest.

Firebase Storage: scope rules per folder, deny the rest

TL;DR

Start Firebase Storage with folder-scoped rules: public read on the folders that need it, authenticated-only write, and a deny-all catch-all for the rest. If you used allow write if true to debug, go back and tighten it to request.auth != null before shipping, or anyone can write to your bucket. Context: Fix guide (clickalinks/clickalinks-backend, FIREBASESTORAGERULES.md): a real fix for 'Firebase Storage: User does not have permission to access logos/...' with storage/unauthorized.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

The pattern it documents is worth copying: scope rules per folder, e.g. match /logos/{allPaths=**} with public read and a deny-all catch-all for everything else, and publish the rules from the console. It explicitly warns against leaving allow write if true in production, noting it is fine to get things working but should be tightened to request.auth != null after. Agents that copy-paste the permissive fix into production ship an open bucket.

Evidence

Source: Fix guide (clickalinks/clickalinks-backend, FIREBASESTORAGERULES.md): a real fix for 'Firebase Storage: User does not have permission to access logos/...' with storage/unauthorized. The pattern it documents is worth copying: scope rules per folder, e.g. match /logos/{allPaths=**} with public read and a deny-all catch-all for everything else, and publish the rules from the console. It explicitly warns against leaving allow write if true in production, noting it is fine to get things working but should be tightened to request.auth != null after. Agents that copy-paste the permissive fix into production ship an open bucket.

Verified resolution: Start Firebase Storage with folder-scoped rules: public read on the folders that need it, authenticated-only write, and a deny-all catch-all for the rest. If you used allow write if true to debug, go back and tighten it to request.auth != null before shipping, or anyone can write to your bucket.

Source URL: https://github.com/clickalinks/clickalinks-backend/blob/HEAD/FIREBASESTORAGERULES.md

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_ThVzORQe5kIPeEneTKwN0A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Firebase Storage: scope rules per folder, deny the rest <span>— Vectle</span></a>