Jira (PUP-9297) Audit and fix locations where set_mode is called with inappropriate permissions on Windows

0 views
Skip to first unread message

Glenn Sarti (JIRA)

unread,
Nov 1, 2018, 3:59:02 AM11/1/18
to puppe...@googlegroups.com
Glenn Sarti created an issue
 
Puppet / Bug PUP-9297
Audit and fix locations where set_mode is called with inappropriate permissions on Windows
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2018/11/01 12:58 AM
Environment:

Windows 10 - 1803
Puppet 5.5.x gem
Ruby 2.4

Priority: Normal Normal
Reporter: Glenn Sarti

PUP-9216 was merged earlier, which sets System ACE entries to full control. This triggers a failure in pxp-agent's tasks.run_puppet.rb test, specifically here based on the stack trace.

Representative job link: https://jenkins-platform.delivery.puppetlabs.net/view/puppet-agent/view/Acceptance%20Suites/view/5.5.x/view/Suite/job/platform_puppet-agent_puppet-agent-integration-suite_daily-5.5.x/232/RMM_COMPONENT_TO_TEST_NAME=pxp_agent,SLAVE_LABEL=beaker,TEST_TARGET=windows10ent-64a/

Representative failure output:

Successful task expected to have no output on stderr. --- expected +++ actual @@ -1 +1,2 @@ -nil +"\e[1;33mWarning: An attempt to set mode 416 on item C:/ProgramData/PuppetLabs/puppet/cache/reports/xln2koezj7avuqx.delivery.puppetlabs.net/201810110803.yaml would result in the group, SYSTEM, to have less than Full Control rights. This attempt has been corrected to Full Control\e[0m +" 

Pull Request https://github.com/puppetlabs/puppet/pull/7167 was raised to fix one place where set_mode was used, however some other testing exposed there are other places where set_mode is used to set inappropriate permissions on Windows platforms; e.g. https://github.com/puppetlabs/puppet/pull/7167#issuecomment-430682091

This issue will track the work to find all of the set_mode call sites and audit them for appropriate-ness on Windows platforms. And then raise fix PRs where needed.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Glenn Sarti (JIRA)

unread,
Nov 1, 2018, 4:05:02 AM11/1/18
to puppe...@googlegroups.com
Glenn Sarti updated an issue
Change By: Glenn Sarti
Story Points: 1
Team: Windows
Sprint: Windows Grooming
Method Found: Needs Assessment Manual Test

Erick Banks (JIRA)

unread,
Feb 7, 2019, 8:24:15 PM2/7/19
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 5, 2020, 2:01:03 AM3/5/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9297
 
Re: Audit and fix locations where set_mode is called with inappropriate permissions on Windows

There are only a few remaining places:

lib/puppet/configurer.rb:    Puppet::Util.replace_file(Puppet[:lastrunfile], mode) do |fh|
lib/puppet/provider/service/rcng.rb:      Puppet::Util.replace_file(rcfile, 0644) do |f|
lib/puppet/provider/service/rcng.rb:      Puppet::Util.replace_file(rcfile, 0644) do |f|
lib/puppet/provider/service/upstart.rb:    Puppet::Util.replace_file(file, 0644) do |f|
lib/puppet/provider/user/user_role_add.rb:      Puppet::Util.replace_file(target_file_path, 0640) do |fh|
lib/puppet/ssl/host.rb:    Puppet::Util.replace_file(file_path, 0644) do |f|
lib/puppet/ssl/host.rb:    Puppet::Util.replace_file(certificate_request_location(name), 0644) do |file|
lib/puppet/ssl/host.rb:      Puppet::Util.replace_file(crl_path, 0644) do |file|
lib/puppet/type/file.rb:      Puppet::Util.replace_file(self[:path], mode_int, staging_location: self[:staging_location], validate_callback: validate_callback) do |file|
lib/puppet/util/reference.rb:    Puppet::Util.replace_file("/tmp/puppetdoc.txt") {|f| f.puts text }

The code in lib/puppet/ssl/host.rb can be ignored, because it will be deleted soon.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 5, 2020, 2:01:03 AM3/5/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 5, 2020, 2:01:04 AM3/5/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Mar 10, 2020, 11:43:05 AM3/10/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 31, 2020, 1:06:03 PM3/31/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Nov 5, 2020, 3:51:04 AM11/5/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Nov 5, 2020, 3:52:04 AM11/5/20
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jun 22, 2021, 4:33:03 AM6/22/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Sprint: ready for triage
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages