raru

package module
v0.0.0-...-2a09d48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2016 License: MIT Imports: 11 Imported by: 4

README

raru: run as random user

Simple and portable cli tool and golang package for run program as random user. Source code ported from C implementation raru.

Installation

To install raru, please use go get.

Command line tool
Exec
$ go get github.com/ArtemKulyabin/raru/cmd/raru
Spawn - fork and exec
$ go get github.com/ArtemKulyabin/raru/cmd/raru-spawn
Jail - run program as random user and changes the apparent root directory for the running process using a chroot(2) system call. If the program linked with dynamic libraries, they are copied into the root directory of the process.
$ go get github.com/ArtemKulyabin/raru/cmd/raru-jail
Package
$ go get github.com/ArtemKulyabin/raru

Usage

Command line tool
$ raru ./fishy-app-youve-never-ran-before
...
$ raru bash # Whole shell as a random user.
...
$ raru curl https://fishysite
...
$ raru-jail run --chroot /dir /bin/ls
...
Package
package main

import (
  "log"
  "github.com/ArtemKulyabin/raru"
)

func main() {
  log.Println(raru.Exec(os.Args[1], os.Args[2:]...))
}

Cross compilation

For cross compilation you may use the Gox. Example:

$ gox github.com/ArtemKulyabin/raru/cmd/raru

Operating system support

  • Linux, FreeBSD, OpenBSD, NetBSD, Darwin(OS X)
Tested on
  • Ubuntu 14.04, FreeBSD 10.1, OpenBSD 5.6, NetBSD 6.1.5, OS X Yosemite 10.10.3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MkJail

func MkJail(name string, paths []string) (err error)

func RandomID

func RandomID() (int, error)

Types

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor() (exer *Executor, err error)

func (*Executor) Exec

func (exer *Executor) Exec(name string, arg ...string) (err error)

func (*Executor) MkJail

func (exer *Executor) MkJail() (err error)

func (*Executor) Prepare

func (exer *Executor) Prepare(cmd *exec.Cmd) (err error)

func (*Executor) SetChrootDir

func (exer *Executor) SetChrootDir(path string)

func (*Executor) Spawn

func (exer *Executor) Spawn(cmd *exec.Cmd) (err error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL