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

Default secret configuration to avoid secret leak #1320

Open
flohw opened this issue Jun 4, 2024 · 2 comments
Open

Default secret configuration to avoid secret leak #1320

flohw opened this issue Jun 4, 2024 · 2 comments

Comments

@flohw
Copy link

flohw commented Jun 4, 2024

Hi,

First issue/contribution here, let me know if I need to change something. :-)

As described in the documentation the config/secrets/prod/prod.decrypt.private.php file must not be committed to the repository.
The recipe for this works as expected. But assuming we have other environments as staging which shouldn't be exposed either (at least to me) the private keys of these environments are not protected by the current configuration.

Maybe the framework-bundle/*/manifest.json should be updated like so in the gitignore section:

-        "/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
+        "/%CONFIG_DIR%/secrets/*/*.decrypt.private.php",
+        "!/%CONFIG_DIR%/secrets/dev/dev.decrypt.private.php",

What do you think?

As mentioned in the readme, recipes should not be updated for the previous versions so I was not sure how to propose the PR. Maybe in the framework-bundle/7.3/manifest.json? Should I copy the 7.2 structure and update only the proposed part?

Let me know, I can provide the PR if you think the change is appropriate.

@nicolas-grekas
Copy link
Member

the test env is also a candidate for exclusion
on the other hand, doing nothing is also an option: at some point, people need to tweak their config anyway

@flohw
Copy link
Author

flohw commented Jun 4, 2024

We could add a line for the test env.
I intended to prevent the risk of secret leak by default, which should be the default regarding safety for me. The new default would prevent the leak of any private key except dev, then the developer is still able to intentionally commit the files if he really wants to.

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

2 participants