|
50 | 50 | end |
51 | 51 | end |
52 | 52 |
|
53 | | - step "Check if the 'last_run_summary.yaml' report file created has '0644' permissions" do |
| 53 | + step "Check if the 'last_run_summary.yaml' report file created has '0640' permissions" do |
54 | 54 | if agent['platform'] =~ /windows/ |
55 | 55 | on(agent, "icacls #{File.join(publicdir, 'last_run_summary.yaml')}") do |result| |
56 | 56 | # Linux 'Owner' premissions class equivalent |
57 | 57 | assert_match('Administrator:(R,W', result.stdout) |
58 | 58 | # Linux 'Group' permissions class equivalent |
59 | 59 | assert_match('None:(R)', result.stdout) |
60 | 60 | # Linux 'Public' permissions class equivalent |
61 | | - assert_match('Everyone:(R)', result.stdout) |
| 61 | + assert_match('Everyone:(Rc,S,RA)', result.stdout) |
| 62 | + # According to icacls docs: |
| 63 | + # Rc = Read control |
| 64 | + # S = Synchronize |
| 65 | + # RA = Read attributes |
| 66 | + # More at https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/icacls |
62 | 67 | end |
63 | 68 | else |
64 | 69 | on(agent, "ls -al #{publicdir}") do |result| |
65 | | - assert_match(/rw-r--r--.+last_run_summary\.yaml$/, result.stdout) |
| 70 | + assert_match(/rw-r-----.+last_run_summary\.yaml$/, result.stdout) |
66 | 71 | end |
67 | 72 | end |
68 | 73 | end |
|
86 | 91 | end |
87 | 92 | end |
88 | 93 |
|
89 | | - step "Check if the 'last_run_summary.yaml' report file was created in the new location and still has '0644' permissions" do |
| 94 | + step "Check if the 'last_run_summary.yaml' report file was created in the new location and still has '0640' permissions" do |
90 | 95 | if agent['platform'] =~ /windows/ |
91 | 96 | on(agent, "icacls #{File.join(custom_publicdir, 'last_run_summary.yaml')}") do |result| |
92 | 97 | # Linux 'Owner' premissions class equivalent |
93 | 98 | assert_match('Administrator:(R,W', result.stdout) |
94 | 99 | # Linux 'Group' permissions class equivalent |
95 | 100 | assert_match('None:(R)', result.stdout) |
96 | 101 | # Linux 'Public' permissions class equivalent |
97 | | - assert_match('Everyone:(R)', result.stdout) |
| 102 | + assert_match('Everyone:(Rc,S,RA)', result.stdout) |
| 103 | + # According to icacls docs: |
| 104 | + # Rc = Read control |
| 105 | + # S = Synchronize |
| 106 | + # RA = Read attributes |
| 107 | + # More at https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/icacls |
98 | 108 | end |
99 | 109 | else |
100 | 110 | on(agent, "ls -al #{custom_publicdir}") do |result| |
101 | | - assert_match(/rw-r--r--.+last_run_summary\.yaml$/, result.stdout) |
| 111 | + assert_match(/rw-r-----.+last_run_summary\.yaml$/, result.stdout) |
102 | 112 | end |
103 | 113 | end |
104 | 114 | end |
|
0 commit comments