Skip to content

fix(engine): keep expanding env vars after a plain dollar - #4072

Open
anandhx wants to merge 1 commit into
falcosecurity:masterfrom
anandhx:fix/env-var-after-plain-dollar
Open

anandhx wants to merge 1 commit into
falcosecurity:masterfrom
anandhx:fix/env-var-after-plain-dollar

Conversation

@anandhx

@anandhx anandhx commented Nov 7, 2026

Copy link
Copy Markdown

Summary

yaml_helper::pre_process_env_vars() treats and `{...}` as tokens. A plain `$` (as in `C:\Users\HP` or) used to skip the rest of the value, so a later `` was left unexpanded.

The scan now moves one character forward for a plain $ and keeps expanding the rest of the value. {VAR} still becomes the literal ``.

Test plan

  • Compared the scanner against the existing cases: {ENV_VAR}, ENV_VAR, side-by-side escaped and expanded variables, and an unset variable
  • C:\Users\HP/ keeps C:\Users\HP and expands the variable
  • cost and ENV_VAR/ expand only the `` token
  • unit_tests/falco/test_configuration_env_vars.cpp covers those three values. This machine has no C++ compiler, so that gtest binary was not built here

Fixes #4064

Made with Cursor

A $ that is not ${...} or $ skipped the rest of the value, so a later ${VAR} stayed literal.

Signed-off-by: anandhx <anandhuashok6959@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@poiana

poiana commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@poiana

poiana commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anandhx
Once this PR has been reviewed and has the lgtm label, please assign lucaguerra for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
poiana requested review from Kaizhe and irozzo-1A November 7, 2026 13:09
@poiana

poiana commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

There is not a label identifying the kind of this issue or PR.
Please specify it either using /kind <group> or manually from the side menu.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Environment variables in falco.yaml are not expanded after a plain $ in the same value

2 participants