diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2019-04-10 11:55:53 -0400 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-05-14 11:25:01 +0100 |
commit | 762765cfabb1ac62864f6a0552f7eda46112f9e1 (patch) | |
tree | 9dfb76f8e8165e1c9f5b01c3012ea799e796abc0 /docs/policies.rst | |
parent | 877014bbfd85c02083a716212a5cbbe715f4b96a (diff) | |
download | sos-762765cfabb1ac62864f6a0552f7eda46112f9e1.tar.gz |
[Plugin] Allow plugins to capture environment variables
Adds a new 'add_env_var()' method to the Plugin class, which allows
plugins to specify which environment variables should be recorded in the
sos archive. This functions as a whitelist, as only environment
variables requested by plugins will be captured. The new method accepts
either a single string, or a list of strings.
Collection of environment variables is done _after_ we have run
collect() for each plugin, and will be written to the 'environment' file
in the archive root. Only environment variables that exist will be
written, so if a plugin requests an environment variable be captured and
it does not appear in the file the chances are good that the variable is
not set on the system.
Each environment variable will only be captured once - so multiple
plugins may specify the same environment variable without an issue.
Additionally, when a plugin uses add_env_var(), the value passed as well
as an upper- and lower- cased variant of the value will be added to the
list of variables to be collected as well. This is because it is a
frequent support issue where end users set an incorrectly-cased
variable, and support representatives will want to know when this is the
case.
Because this functionality works off of a whitelist, environment
variable values are not sanitized. Note also that due to the variable
name casing functionality mentioned above, this means there is a small
chance where sensitive data stored in differently-cased variables of the
same name as common variables could be unintentionally captured.
Use the --no-env-vars option to prevent capturing any environment
variables wholesale.
Fixes: #1396
Resolves: #1643
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Diffstat (limited to 'docs/policies.rst')
0 files changed, 0 insertions, 0 deletions