Title: Powerhsell 7.x Linux not honoring opt-out env variables · Issue #16112 · PowerShell/PowerShell · GitHub
Open Graph Title: Powerhsell 7.x Linux not honoring opt-out env variables · Issue #16112 · PowerShell/PowerShell
X Title: Powerhsell 7.x Linux not honoring opt-out env variables · Issue #16112 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/16112
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Powerhsell 7.x Linux not honoring opt-out env variables","articleBody":"### Prerequisites\n\n- [X] Write a descriptive title.\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [X] Search the existing issues.\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\nI have a Rocky Linux 8 installation with powershell 7.1.4. I use powershell for monitoring and run pwsh to get a set of results. I've added opt-out environment variables as following to the systemd.\r\n\r\n\r\n> systemctl edit zabbix-server\r\n\r\nhttps://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_telemetry?view=powershell-7.1\r\nhttps://docs.microsoft.com/en-us/dotnet/core/tools/telemetry\r\n\r\n[Service]\r\nEnvironment=POWERSHELL_TELEMETRY_OPTOUT=1\r\nEnvironment=DOTNET_TELEMETRY_OPTOUT=1\r\nEnvironment=POWERSHELL_CLI_TELEMETRY_OPTOUT=1\r\nEnvironment=DOTNET_CLI_TELEMETRY_OPTOUT=1\r\n\r\nprintenv gives me the optout parameters as expected when verifying.\r\n\r\n> printenv\r\n LANG=en_US.UTF-8\r\nINVOCATION_ID=69a4bad5f0c14cf4b291504873445d19\r\nPWD=/\r\nJOURNAL_STREAM=9:66980\r\nCONFFILE=/etc/zabbix/zabbix_server.conf\r\nPOWERSHELL_CLI_TELEMETRY_OPTOUT=1\r\nDOTNET_TELEMETRY_OPTOUT=1\r\nDOTNET_CLI_TELEMETRY_OPTOUT=1\r\nSHLVL=1\r\nPOWERSHELL_TELEMETRY_OPTOUT=1\r\nPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin\r\n_=/usr/bin/printenv\r\n\r\nRelated issues would be running ps1 script create temp file in everytime #11599 and PowerShell ignoring telemetry opt-out options, tries to call home regularly #10005\r\n\n\n### Expected behavior\n\n```console\nExpecting powershell to run without telemetry, not trying to gather data that selinux denies for the user.\n```\n\n\n### Actual behavior\n\n```console\nEach run of powershell generates a folder in /tmp/ as following;\r\n\r\n04ad7c7a-7fd1-4465-9b31-38b83f70fcc1/\r\n.cache/powershell/StartupProfileData-NonInteractive\r\n15661dc5-9fdc-42ed-bf20-12d902193070/\r\n30544f3e-6e5b-47d2-be8d-e2518802caa3/\r\n.....\r\n\r\nEach time a powershell script is run with the service user, selinux gives loads of denied events like the following;\r\n#tail -f /var/log/audit/audit.log | grep denied\r\n.......\r\ntype=AVC msg=audit(1631798453.792:11014): avc: denied { getattr } for pid=5141 comm=506970656C696E6520457865637574 path=\"/usr/sbin/lvm\" dev=\"dm-0\" ino=492056 scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:lvm_exec_t:s0 tclass=file permissive=0\r\ntype=AVC msg=audit(1631798453.792:11016): avc: denied { getattr } for pid=5141 comm=506970656C696E6520457865637574 path=\"/usr/bin/rpm\" dev=\"dm-0\" ino=50624503 scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:rpm_exec_t:s0 tclass=file permissive=0\r\ntype=AVC msg=audit(1631798453.792:11017): avc: denied { getattr } for pid=5141 comm=506970656C696E6520457865637574 path=\"/usr/bin/gpg\" dev=\"dm-0\" ino=50706017 scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:gpg_exec_t:s0 tclass=file permissive=0\r\ntype=AVC msg=audit(1631798453.792:11018): avc: denied { getattr } for pid=5141 comm=506970656C696E6520457865637574 path=\"/usr/bin/dnf-3\" dev=\"dm-0\" ino=50725090 scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:rpm_exec_t:s0 tclass=file permissive=0\r\ntype=AVC msg=audit(1631798453.792:11020): avc: denied { getattr } for pid=5141 comm=506970656C696E6520457865637574 path=\"/usr/bin/sudo\" dev=\"dm-0\" ino=50755282 scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:sudo_exec_t:s0 tclass=file permissive=0\r\ntype=AVC msg=audit(1631798453.792:11021): avc: denied { getattr } for pid=5141 comm=506970656C696E6520457865637574 path=\"/usr/bin/hostname\" dev=\"dm-0\" ino=50800802 scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=0\r\n.......\n```\n\n\n### Error details\n\n_No response_\n\n### Environment data\n\n```powershell\n> uname -a\r\nLinux 4.18.0-305.17.1.el8_4.x86_64 #1 SMP Wed Sep 8 16:42:05 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n> dnf list installed | grep powershell\r\npowershell.x86_64 7.1.4-1.rhel.7 @packages-microsoft-com-prod\n```\n\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/Zimeon-","@type":"Person","name":"Zimeon-"},"datePublished":"2021-09-16T13:36:41Z","url":"https://github.com/PowerShell/PowerShell/issues/16112"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a59be25f-e145-cc39-6867-ee798f6cc74d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC40:284724:55EE:737A:6AFDD4E6 |
| html-safe-nonce | 23edd4eea052456e5ebe56d0dfab26e3b0d0173fb44809b617fd578e56539bb7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzQwOjI4NDcyNDo1NUVFOjczN0E6NkFGREQ0RTYiLCJ2aXNpdG9yX2lkIjoiNzQxODMxODE0NDUyMDcwNTI1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 06a3a8b8baef855b852ea99691ee16f45cb53b87104cdb562d8b3ceeb66b59bf |
| hovercard-subject-tag | issue:998224457 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/16112/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b82380221988b52bbad1d6f9ac23a342c47659db456d1403814c9ce422b7d015/PowerShell/PowerShell/issues/16112 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b82380221988b52bbad1d6f9ac23a342c47659db456d1403814c9ce422b7d015/PowerShell/PowerShell/issues/16112 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Zimeon- |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9918bd4004419458bcd838065ac2a76b76ebd11705d73909fff5ab99e996fa23 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a231c174493a6a442c0b0544475c918b30128208 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width