4.9.4 Ensure default path does not include current working directory

Information

This change removes any "." or "::" entries from /etc/environment If a "." or "::" is present the current working directory is included in the default search path.

Any "." and "::" will be removed from /etc/environment This means that any harmful programs placed in common PATH locations, would never be automatically executed. All directories must be explicitly defined within the PATH variable.

Solution

Examine PATH in /etc/environment to see if it contains any "." or "::" entries:

grep "^PATH=" /etc/environment |awk '/((:[ t]*:)|(:[ t]*$)|(^[t]*:)|(^.:)|(:.$)|(:.:))/'

If the command above yields output, remove the "." and "::" entries from:

vi /etc/environment

See Also

https://workbench.cisecurity.org/benchmarks/10385

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6b.

Plugin: Unix

Control ID: f6630d3ddf54bd246230db5f176e38aebd0c670231014b13a6e5a1a7de57de23