|
70 | 70 | "ObjectName": "auditTest",
|
71 | 71 | "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp/testfile' } == TRUE"
|
72 | 72 | },
|
73 |
| - |
| 73 | + { |
| 74 | + "RunCommand": "stat /tmp/testfile | grep 'Access: (0777\/-rwxrwxrwx)'" |
| 75 | + }, |
74 | 76 |
|
75 | 77 |
|
| 78 | + { |
| 79 | + "RunCommand": "touch /tmp/testfile && chmod 777 /tmp/testfile && chown root:root /tmp/testfile" |
| 80 | + }, |
76 | 81 | {
|
77 | 82 | "ObjectType": "Desired",
|
78 | 83 | "ComponentName": "Compliance",
|
|
83 | 88 | "ObjectType": "Reported",
|
84 | 89 | "ComponentName": "Compliance",
|
85 | 90 | "ObjectName": "auditTest",
|
86 |
| - "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' } == TRUE" |
| 91 | + "Payload": "{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' Invalid permissions - are 0777 should be 0644 with mask 7777 } == FALSE" |
87 | 92 | },
|
88 | 93 | {
|
89 | 94 | "ObjectType": "Desired",
|
|
100 | 105 |
|
101 | 106 |
|
102 | 107 |
|
| 108 | + { |
| 109 | + "RunCommand": "touch /tmp/testfile && chmod 777 /tmp/testfile && chown root:root /tmp/testfile" |
| 110 | + }, |
103 | 111 | {
|
104 | 112 | "ObjectType": "Desired",
|
105 | 113 | "ComponentName": "Compliance",
|
|
112 | 120 | "ObjectName": "auditTest",
|
113 | 121 | "Payload": "{ ensureFilePermissions: ensureFilePermissions for '\/tmp/testfile' Invalid user - is 'root' should be 'foo' } == FALSE"
|
114 | 122 | },
|
115 |
| - |
116 |
| - |
117 |
| - |
118 | 123 | {
|
119 | 124 | "ObjectType": "Desired",
|
120 | 125 | "ComponentName": "Compliance",
|
|
170 | 175 | "ObjectName": "auditTest",
|
171 | 176 | "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp/testfile' } == TRUE"
|
172 | 177 | },
|
173 |
| - |
174 |
| - |
175 |
| - |
176 | 178 | {
|
177 | 179 | "ObjectType": "Desired",
|
178 | 180 | "ComponentName": "Compliance",
|
|
183 | 185 | "ObjectType": "Reported",
|
184 | 186 | "ComponentName": "Compliance",
|
185 | 187 | "ObjectName": "auditTest",
|
186 |
| - "Payload": "{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' Invalid permissions - are 777 should be 600 with mask 177 } == FALSE" |
| 188 | + "Payload": "{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' Invalid permissions - are 0777 should be 0600 with mask 0177 } == FALSE" |
187 | 189 | },
|
188 | 190 |
|
189 | 191 |
|
|
213 | 215 | "ObjectType": "Reported",
|
214 | 216 | "ComponentName": "Compliance",
|
215 | 217 | "ObjectName": "auditTest",
|
216 |
| - "Payload": "{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' Invalid permissions - are 777 should be 600 with mask 177 } == FALSE" |
| 218 | + "Payload": "{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' Invalid permissions - are 0777 should be 0600 with mask 0177 } == FALSE" |
217 | 219 | },
|
218 | 220 | {
|
219 | 221 | "ObjectType": "Desired",
|
|
227 | 229 | "ObjectName": "auditTest",
|
228 | 230 | "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp/testfile' } == TRUE"
|
229 | 231 | },
|
230 |
| - |
| 232 | + { |
| 233 | + "RunCommand": "stat /tmp/testfile | grep 'Access: (0600\/-rw-------)'" |
| 234 | + }, |
231 | 235 |
|
232 | 236 |
|
233 | 237 | {
|
|
267 | 271 | "ObjectType": "Desired",
|
268 | 272 | "ComponentName": "Compliance",
|
269 | 273 | "ObjectName": "remediateTest",
|
270 |
| - "Payload": "MASK=177 USER=root GROUP=bar" |
| 274 | + "Payload": "MASK=133 USER=root GROUP=bar" |
271 | 275 | },
|
272 | 276 | {
|
273 | 277 | "ObjectType": "Reported",
|
274 | 278 | "ComponentName": "Compliance",
|
275 | 279 | "ObjectName": "auditTest",
|
276 | 280 | "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' } == TRUE"
|
277 | 281 | },
|
| 282 | + { |
| 283 | + "RunCommand": "stat /tmp/testfile | grep 'Access: (0644\/-rw-r--r--) Uid: ( 0\/ root) Gid: ( 1001\/ bar)'" |
| 284 | + }, |
278 | 285 |
|
279 | 286 |
|
280 | 287 |
|
|
302 | 309 | "ObjectName": "auditTest",
|
303 | 310 | "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' } == TRUE"
|
304 | 311 | },
|
| 312 | + { |
| 313 | + "RunCommand": "stat /tmp/testfile | grep 'Access: (0600\/-rw-------) Uid: ( 1001\/ foo) Gid: ( 1001\/ bar)'" |
| 314 | + }, |
| 315 | + |
| 316 | + |
| 317 | + { |
| 318 | + "ObjectType": "Desired", |
| 319 | + "ComponentName": "Compliance", |
| 320 | + "ObjectName": "procedureTest", |
| 321 | + "Payload": { |
| 322 | + "audit": { |
| 323 | + "ensureFilePermissions": { |
| 324 | + "filename": "/tmp/testfile", |
| 325 | + "user": "$USER", |
| 326 | + "permissions": "$PERMISSIONS", |
| 327 | + "group": "$GROUP", |
| 328 | + "mask": "$MASK" |
| 329 | + } |
| 330 | + }, |
| 331 | + "remediate": { |
| 332 | + "ensureFilePermissions": { |
| 333 | + "filename": "/tmp/testfile", |
| 334 | + "user": "$USER", |
| 335 | + "permissions": "$PERMISSIONS", |
| 336 | + "group": "$GROUP", |
| 337 | + "mask": "$MASK" |
| 338 | + } |
| 339 | + }, |
| 340 | + "parameters": { |
| 341 | + "USER": "root", |
| 342 | + "GROUP": "root", |
| 343 | + "PERMISSIONS": "000", |
| 344 | + "MASK": "777" |
| 345 | + } |
| 346 | + } |
| 347 | + }, |
| 348 | + { |
| 349 | + "RunCommand": "touch /tmp/testfile && chmod 777 /tmp/testfile && chown root:root /tmp/testfile" |
| 350 | + }, |
| 351 | + { |
| 352 | + "ObjectType": "Reported", |
| 353 | + "ComponentName": "Compliance", |
| 354 | + "ObjectName": "auditTest", |
| 355 | + "Payload": "{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' Invalid permissions - are 0777 should be 0000 with mask 0777 } == FALSE" |
| 356 | + }, |
| 357 | + |
| 358 | + |
| 359 | + |
| 360 | + { |
| 361 | + "ObjectType": "Desired", |
| 362 | + "ComponentName": "Compliance", |
| 363 | + "ObjectName": "initTest", |
| 364 | + "Payload": "PERMISSIONS=777" |
| 365 | + }, |
| 366 | + { |
| 367 | + "ObjectType": "Reported", |
| 368 | + "ComponentName": "Compliance", |
| 369 | + "ObjectName": "auditTest", |
| 370 | + "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' } == TRUE" |
| 371 | + }, |
| 372 | + |
| 373 | + |
| 374 | + |
| 375 | + { |
| 376 | + "ObjectType": "Desired", |
| 377 | + "ComponentName": "Compliance", |
| 378 | + "ObjectName": "initTest", |
| 379 | + "Payload": "PERMISSIONS=100 MASK=100" |
| 380 | + }, |
| 381 | + { |
| 382 | + "ObjectType": "Reported", |
| 383 | + "ComponentName": "Compliance", |
| 384 | + "ObjectName": "auditTest", |
| 385 | + "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' } == TRUE" |
| 386 | + }, |
| 387 | + |
| 388 | + |
| 389 | + |
| 390 | + { |
| 391 | + "ObjectType": "Desired", |
| 392 | + "ComponentName": "Compliance", |
| 393 | + "ObjectName": "initTest", |
| 394 | + "Payload": "PERMISSIONS=333 MASK=777" |
| 395 | + }, |
| 396 | + { |
| 397 | + "ObjectType": "Reported", |
| 398 | + "ComponentName": "Compliance", |
| 399 | + "ObjectName": "auditTest", |
| 400 | + "Payload": "{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' Invalid permissions - are 0777 should be 0333 with mask 0777 } == FALSE" |
| 401 | + }, |
| 402 | + |
| 403 | + |
| 404 | + |
| 405 | + { |
| 406 | + "ObjectType": "Desired", |
| 407 | + "ComponentName": "Compliance", |
| 408 | + "ObjectName": "remediateTest", |
| 409 | + "Payload": "PERMISSIONS=333 MASK=777" |
| 410 | + }, |
| 411 | + { |
| 412 | + "ObjectType": "Reported", |
| 413 | + "ComponentName": "Compliance", |
| 414 | + "ObjectName": "auditTest", |
| 415 | + "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' } == TRUE" |
| 416 | + }, |
| 417 | + { |
| 418 | + "RunCommand": "stat /tmp/testfile | grep 'Access: (0333\/--wx-wx-wx)'" |
| 419 | + }, |
| 420 | + |
| 421 | + |
| 422 | + |
| 423 | + { |
| 424 | + "ObjectType": "Desired", |
| 425 | + "ComponentName": "Compliance", |
| 426 | + "ObjectName": "remediateTest", |
| 427 | + "Payload": "PERMISSIONS=1000 MASK=1000" |
| 428 | + }, |
| 429 | + { |
| 430 | + "ObjectType": "Reported", |
| 431 | + "ComponentName": "Compliance", |
| 432 | + "ObjectName": "auditTest", |
| 433 | + "Payload": "PASS{ ensureFilePermissions: ensureFilePermissions for '\/tmp\/testfile' } == TRUE" |
| 434 | + }, |
| 435 | + { |
| 436 | + "RunCommand": "stat /tmp/testfile | grep 'Access: (1333\/--wx-wx-wt)'" |
| 437 | + }, |
| 438 | + |
305 | 439 |
|
306 | 440 |
|
307 | 441 | {
|
|
0 commit comments