Test for macOS requiring password after sleep or screen saver kicks in fails erroneously
- Dominant language
- Shell
- Stars
- 25
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
The test for `macOS requiring password after sleep or screen saver kicks in` fails yet it is actually enabled on my system.
**To Reproduce**
When running `ropsec::summarize_system_checks()`, the test for macOS requiring password after sleep or screen saver kicks in fails:
``` r
ropsec::summarize_system_checks()
#> Registered S3 method overwritten by 'openssl':
#> method from
#> print.bytes Rcpp
#> ✔ | OK F W S | Context
#>
⠏ | 0 | SSH Configuration - existence
✔ | 1 | SSH Configuration - existence
#>
⠏ | 0 | SSH Configuration - keys
✔ | 2 | SSH Configuration - keys
#>
⠏ | 0 | SSH Configuration - key size
✔ | 1 | SSH Configuration - key size
#>
⠏ | 0 | GPG Existence
✔ | 1 | GPG Existence
#>
⠏ | 0 | macOS requires password after sleep or screen saver kicks in
✖ | 0 1 1 | macOS requires password after sleep or screen saver kicks in
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> macos-simple-test.R:32: warning: macOS requires password after sleep or screen saver kicks in
#> running command 'defaults read com.apple.screensaver askForPassword' had status 1
#>
#> macos-simple-test.R:33: failure: macOS requires password after sleep or screen saver kicks in
#> x == 1 isn't true.
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#>
⠏ | 0 | Firewall is enabled
✔ | 1 | Firewall is enabled
#>
⠏ | 0 | Gatekeeper is enabled
✔ | 1 | Gatekeeper is enabled
#>
⠏ | 0 | ~/.Rprofile permissions are sane (if ~/.Rprofile exists)
✖ | 0 1 | ~/.Rprofile permissions are sane (if ~/.Rprofile exists)
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> macos-simple-test.R:52: failure: ~/.Rprofile permissions are sane
#> ==... isn't true.
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#>
⠏ | 0 | ~/.Renviron permissions are sane (if ~/.Renviron exists)
✖ | 0 1 | ~/.Renviron permissions are sane (if ~/.Renviron exists)
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> macos-simple-test.R:59: failure: ~/.Renviron permissions are sane
#> ==... isn't true.
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#>
#> ══ Results ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#> Duration: 0.3 s
#>
#> OK: 7
#> Failed: 3
#> Warnings: 1
#> Skipped: 0
```
Created on 2019-05-08 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)
yet it is actually enabled on my system:

**Expected behavior**
I expect the test to pass
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
``` r
sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Mojave 10.14.3
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] compiler_3.6.0 magrittr_1.5 tools_3.6.0 htmltools_0.3.6
#> [5] yaml_2.2.0 Rcpp_1.0.1 stringi_1.4.3 rmarkdown_1.12
#> [9] highr_0.8 knitr_1.22 stringr_1.4.0 xfun_0.6
#> [13] digest_0.6.18 evaluate_0.13
```
Created on 2019-05-08 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)
Contributor guide
Research direction
Start with macos-simple-test.R lines 32-33 and run ropsec::summarize_system_checks() on the reported macOS setup. Compare the test's defaults read com.apple.screensaver askForPassword result with the enabled setting shown in the report. Done means the check passes when the password-after-sleep or screen-saver setting is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, shell
- Domain
- security, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100