Skip to content

Ability to match "entry"/ "root" process name dynamically when using ENHANCER_CONFIG_FILE #4

@adamscybot

Description

@adamscybot

At the moment, the rule system needs static process name matching.

However, the need to specify the process name is overly burdensome if you have a simple binary that you want to run ad-hoc with the ENHANCER_CONFIG_FILE env var inline (and LD_PRELOAD, in my case), because you don't really care about the process name, as it's implied by the call itself.

I would suggest there could be something like an %root% token that can be used in place of the process name:

program %root%
{
  ...
}

This would also be powerful in that you could have generic conf files that you can use with multiple binaries like this.

I realise if you then used this in a mode where LD_PRELOAD hooked everything, this would cause an extremity of hooks on every process, and that's not the use case for this (though, I guess it would do what they asked for if someone tried). Could be limited to only when passed via ENHANCER_CONFIG_FILE or something.

I guess this touches on a wider, less scoped use case about allowing interpolation from env vars as an alternative, though I realise allowing substitution, anywhere in the rule would probably open a bigger scary security minefield when we're already standing in one by using LD_PRELOAD in the first place. But perhaps that's just opening an unnecessarily large can of worms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions