Use local
instead of public
disk for exports where available
#14723
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Filament features that interact with storage use the
default_filesystem_disk
config option. This allows the user to easily swap their storage driver to something production-ready likes3
when deploying their app, without having to touch multiple configuration options and potentially forgetting about some.The default disk is set to
public
when you first install Filament, since this allows users to quickly get started developing with a functional disk that allows features such as file upload previews locally without the need to set up an S3 disk with temporary URL support.However, some features of Filament such as exports also rely on storage, and the files that are stored contain data that should often not be public. This is not an issue for the many deployed applications, since many use a secure default disk such as S3 in production. However, CWE-1188 suggests that having the
public
disk as the default disk in Filament is a security vulnerability itself:As such, we have implemented a measure to protect users whereby if the
public
disk is set as the default disk, the exports feature will automatically swap it out for thelocal
disk, if that exists. Users who set the default disk tolocal
ors3
already are not affected. If a user wants to continue to use thepublic
disk for exports, they can by setting the export disk deliberately.