knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The goal of defender is to do static code analysis on other R packages to check for potential security risks and best practices. It provides checks on multiple levels:
The checks do not tell you whether something is harmful but rather they flag code that you should double-check before running / loading the package.
You can install defender from github with:
# install.packages("devtools") devtools::install_github("ropenscilabs/defender")
You can check for system calls in any directory locally available:
defender::summarize_system_calls("../testevil")
You can also include additional elements to flag as dangerous:
sc <- defender::system_calls("poll") defender::summarize_system_calls("../testevil", calls_to_flag = sc)
You can check the NAMESPACE file in a package for dangerous imports:
defender::check_namespace("../testevil")
You can also include additional elements to flag as dangerous:
di <- defender::dangerous_imports("processx::poll") defender::check_namespace("../testevil", imports_to_flag = di)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.