Coder Social home page Coder Social logo

yannrichet / rapparmor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeroen/rapparmor

1.0 2.0 0.0 2.58 MB

R interfaces to Linux and AppArmor security methods

Home Page: cran.r-project.org/package=RAppArmor

Shell 1.73% R 50.59% TeX 31.91% C 15.77%

rapparmor's Introduction

RAppArmor

A Modern and Flexible Web Client for R

Build Status Coverage Status CRAN_Status_Badge CRAN RStudio mirror downloads Research software impact Github Stars

The R package RAppArmor interfaces to a number of security related methods in the Linux kernel. It supports the following functionality:

  • loading and changing AppArmor profiles and hats to enforce advanced security policies
  • setting RLIMIT values to restrict usage of memory, cpu, disk, etc
  • setting the process priority
  • switching uid/gid of the current process
  • setting the affinity mask of the current process
  • calling an R command with a 'timeout' to kill if it does not return with in n seconds
  • doing all of the above dynamically for a single R call using the eval.secure function

This can be useful for example if to host a public service for users to run R code, or if you are paranoid about running contributed code on your machine.

Documentation

About the R package:

Hello World

Use the eval.secure function to dynamically evaluate a call with a certain AppArmor profile or hardware limits:

list.files("/")
eval.secure(list.files("/"), profile="r-user")

To set hardware limits, use the RLIMIT_XXX arguments:

A <- matrix(rnorm(1e7), 1e4);
B <- eval.secure(matrix(rnorm(1e7), 1e4), RLIMIT_AS = 100*1024*1024);

Installation

The AppArmor linux module is available on the following distributions:

Installing the R package requires libapparmor-dev. The apparmor-utils package is also recommended.

sudo apt-get install -y libapparmor-dev apparmor-utils

One this is installed we can install the R package:

install.packages("RAppArmor")

The R package comes with some handly AppArmor profiles that you need to install manually:

#Install the profiles
cd /usr/local/lib/R/site-library/RAppArmor/
sudo cp -Rf profiles/debian/* /etc/apparmor.d/

#Load the profiles into the kernel
sudo service apparmor restart

#To disable enforcing the global R profile
sudo aa-disable usr.bin.r

To start enforcing the standard R policy:

sudo aa-enforce usr.bin.r

To stop enforcing of the standard policy:

sudo aa-disable usr.bin.r

Please have a look at the JSS paper to understand how to use the software.

Citing

To cite RAppArmor in publications use:

Jeroen Ooms (2013). The RAppArmor Package: Enforcing Security Policies in R Using Dynamic Sandboxing
on Linux. Journal of Statistical Software, 55(7), 1-34. URL http://www.jstatsoft.org/v55/i07/.

A BibTeX entry for LaTeX users is

@Article{RAppArmor,
  title = {The {RAppArmor} Package: Enforcing Security Policies in {R} Using Dynamic Sandboxing on Linux},
  author = {Jeroen Ooms},
  journal = {Journal of Statistical Software},
  year = {2013},
  volume = {55},
  number = {7},
  pages = {1--34},
  url = {http://www.jstatsoft.org/v55/i07/},
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.