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

feat: Import secretes from secrets.yml #735

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

flooxo
Copy link
Contributor

@flooxo flooxo commented Jan 12, 2024

Description

I have implemented a new function so that it is now possible to import secrets from a secrets.yml file using the keyword !secret.

When loading the config, the corresponding key is loaded with the token from the secrets.yml file and replaced everywhere in the config.yml file

Fixes #609

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I've read & comply with the contributing guidelines
  • I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • I have made corresponding changes to the documentation (README.md).
  • I've checked my modifications for any breaking changes, especially in the config.yml file

Signed-off-by: Florian Grabmeier <[email protected]>
Signed-off-by: Florian Grabmeier <[email protected]>
Copy link

netlify bot commented Jan 12, 2024

Deploy Preview for homer-demo-content ready!

Name Link
🔨 Latest commit d6ffdd8
🔍 Latest deploy log https://app.netlify.com/sites/homer-demo-content/deploys/65a551f3d55edf000836caf2
😎 Deploy Preview https://deploy-preview-735--homer-demo-content.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: Florian Grabmeier <[email protected]>
Signed-off-by: Florian Grabmeier <[email protected]>
@kgromer
Copy link

kgromer commented Aug 4, 2024

This is awesome! Please pull this into the main branch.

Copy link
Owner

@bastienwirtz bastienwirtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Indeed, secret in homer config file can be problematic. If you use secrets, Homer should not be exposed publicly (or behind some kind of auth proxy).
However, this approach can be misleading, users could think their secrets are secure in the separate file and expose it to the internet without any auth. It also add an additional request for no real value.

The only way to hide credentials would be to proxy the request on the server side.


## Importing Secrets

You can import sensitive information such as API keys or passwords into your `config.yml` file securely using the `!secret` keyword. The corresponding tokens are stored in the `secrets.yml` file. This approach allows you to keep confidential information separate, eliminating the need to expose sensitive information directly in your configuration.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This secret file is as public as the main config file. Having it separated can help manage the secrets, but it does not add any security.

@flooxo
Copy link
Contributor Author

flooxo commented Oct 21, 2024

Thank you for the feedback. I certainly agree, it does not make the secrets more secure. Perhaps the wording in the documentation should be revised.

The advantage of this feature is that you can publish your config without worrying, as discussed in #609.
And I would say that most homer users also run other services and therefore know how to deal with secrets. This feature gives them a more structured way to manage secrets without enforcing specific security implementations :)

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

Successfully merging this pull request may close these issues.

Passing secrets or env vars to the config.yaml
3 participants