Skip to content

Conversation

graphcareful
Copy link
Contributor

@graphcareful graphcareful commented Aug 26, 2025

Summary

The exec backend within the secrets framework works to fetch secrets by execing a provided path to a binary and communicating with it over a simple (but established) protocol. This protocol is versioned and currently Vector only supports 1 version.

This PR introduces support for v1.1. An example of a program that is compliant with these new changes is the datadog-secrets-backend specifically the changes in the v1 branch which will eventually become part of the new standard.

The main changes to Vector were to include the backend configuration with each request to this binary. This means opening up new configuration options to the secrets global option.

Vector configuration

secret:
  exec_backend:
    type: "exec"
    command: [/usr/bin/datadog-secret-backend]
    protocol:
      version: v1_1
      backend_type: file.json
      backend_config:
        file_path: ~/secrets.json

sources:
  agent:
    type: "datadog_agent"
    address: 0.0.0.0:8282
    log_namespace: true

sinks:
  out:
    inputs:
      - "agent"
    type: "datadog_logs"
    default_api_key: SECRET[exec_backend.dd_logs_api_key]

How did you test this PR?

Using the config about and building the datadog-secrets-backend from source.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • cargo fmt --all
      • cargo clippy --workspace --all-targets -- -D warnings
      • cargo nextest run --workspace (alternatively, you can run cargo test --all)
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run cargo vdev build licenses to regenerate the license inventory and commit the changes (if any). More details here.

@graphcareful graphcareful requested a review from a team as a code owner August 26, 2025 17:20
@github-actions github-actions bot added the domain: ci Anything related to Vector's CI environment label Aug 26, 2025
@graphcareful graphcareful requested a review from bruceg August 26, 2025 17:22
@graphcareful graphcareful force-pushed the rob/secrets-manager-v1_1 branch from 7d180fb to 43b11bb Compare August 26, 2025 17:52
@graphcareful graphcareful changed the title feat(secrets): Add support for v1.1 protocol of secrets exec backend feat(config): Add support for v1.1 protocol of secrets exec backend Aug 26, 2025
@graphcareful graphcareful added domain: config Anything related to configuring Vector and removed domain: ci Anything related to Vector's CI environment labels Aug 26, 2025
- That way its implementation can change without modifying the
  executables call site in the code.
@github-actions github-actions bot added the domain: ci Anything related to Vector's CI environment label Aug 27, 2025
Copy link

@emilychendd emilychendd left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@pront pront left a comment

Choose a reason for hiding this comment

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

thanks!

@pront pront enabled auto-merge August 28, 2025 18:43
@pront pront added this pull request to the merge queue Aug 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 28, 2025
@graphcareful graphcareful added this pull request to the merge queue Aug 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 29, 2025
@graphcareful graphcareful added this pull request to the merge queue Sep 2, 2025
@graphcareful graphcareful removed this pull request from the merge queue due to a manual request Sep 2, 2025
@graphcareful
Copy link
Contributor Author

graphcareful commented Sep 2, 2025

@pront looks like the unit tests failed on windows, possibly because theres no python installed?

      left: "%1 is not a valid Win32 application. (os error 193)"

@graphcareful graphcareful force-pushed the rob/secrets-manager-v1_1 branch 2 times, most recently from 385b587 to 523e0eb Compare September 2, 2025 22:11
@graphcareful
Copy link
Contributor Author

Change in force-push

  • Undo previous accidental force push

@thomasqueirozb thomasqueirozb added this pull request to the merge queue Sep 3, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 3, 2025
…23655)

* feat(config): Add support for v1.1 of datadog secrets manager

* Update docs generator to generate unconstrained types

- This is necessary as the secrets exec config now contains a member of
type `Value`

* Introduce new unit tests for the exec backend

* Add changelog file

* Stray line to format

* Rename mock exec script and make it executable

- That way its implementation can change without modifying the
  executables call site in the code.

* Update src/secrets/exec.rs

* Install python 3.10 on windows CI runs

---------

Co-authored-by: Pavlos Rontidis <[email protected]>
Co-authored-by: Thomas <[email protected]>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 3, 2025
@thomasqueirozb
Copy link
Contributor

I think the issue is that make_test_backend is trying to run mock_secrets_exec, which in unix is fine since shebangs are recognized. I don't think Windows deals nicely with shebangs - probably need to add something like #[cfg(windows)] and add python3 to the command

@bruceg
Copy link
Member

bruceg commented Sep 3, 2025

probably need to add something like #[cfg(windows)] and add python3 to the command

If it is needed for Windows and works on Linux, I'd suggest to make it unconditional for uniformity.

@pront
Copy link
Member

pront commented Sep 3, 2025

I would revert this change: #23655 (comment)

I don't see any real benefit to it. And explicitly calling it will probably fix the the Windows failure.

- Shebang invocation at top of script not working on windows builds
where python is installed and located at the path
@pront pront enabled auto-merge September 4, 2025 14:04
@pront pront added this pull request to the merge queue Sep 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2025
@graphcareful graphcareful force-pushed the rob/secrets-manager-v1_1 branch from 7c79e25 to d110486 Compare September 4, 2025 21:30
@graphcareful graphcareful added this pull request to the merge queue Sep 4, 2025
Merged via the queue into vectordotdev:master with commit cb08d02 Sep 4, 2025
54 checks passed
@graphcareful graphcareful deleted the rob/secrets-manager-v1_1 branch September 4, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: ci Anything related to Vector's CI environment domain: config Anything related to configuring Vector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants