atomshields package

Submodules

atomshields.helpers module

class atomshields.helpers.CommandHelper(command=None)[source]

Bases: object

Class used to execute commands in shell, an d get the output and the errors.

OS_UBUNTU = 'Ubuntu'
OS_DEBIAN = 'Debian'
OS_CENTOS = 'CentOS'
OS_REDHAT = 'Redhat'
OS_KALI = 'Kali'
OS_LINUX = 'Linux'
OS_MAC = 'Darwin'
OS_WINDOWS = 'Windows'
command

Getter for ‘command’ property

Returns:Command to execute
Return type:str
output

Getter for ‘output’ property

Returns:Stdout content
Return type:str
errors

Getter for ‘errors’ property

Returns:Stderr content
Return type:str
getOSName()[source]

Get the OS name. If OS is linux, returns the Linux distribution name

Returns:OS name
Return type:str
install(software, uninstall=False)[source]
execute(shell=True)[source]

Executes the command setted into class

Parameters:shell (boolean) – Set True if command is a shell command. Default: True

atomshields.scanner module

class atomshields.scanner.AtomShieldsScanner(path, verbose=False)[source]

Bases: object

Class in charge of orchestrating the execution of the cherckers and the results.

HOME = '/usr/local/share/atomshields'
HOME_2 = '/home/docs/.atomshields'
CHECKERS_DIR = '/home/docs/.atomshields/checkers'
REPORTS_DIR = '/home/docs/.atomshields/reports'
CONFIG_PATH = '/home/docs/.atomshields/config'
debug(message, color=None, attrs=None)[source]
path

Getter for ‘path’ property

Returns:Absolute path to target directory
Return type:string
project

Getter for ‘project’ property

Returns:Projects’s name
Return type:string
configFile

Getter for ‘configFile’ property

Returns:Path to config file
Return type:str
config

Getter for ‘config’ property

Returns:Path to config file
Return type:str
issues

Getter for ‘issues’ property

Returns:List of Issue instances
Return type:list
static setup()[source]

Creates required directories and copy checkers and reports.

static installPlugin(destination)[source]
static installChecker()[source]
static installReport()[source]
static uninstallPlugin(name=None, classArgs=None)[source]
static uninstallChecker()[source]
static uninstallReport()[source]
static generateConfig()[source]
showScanProperties()[source]
checkProperties()[source]
getConfig(section=None)[source]

Returns a dictionary which contains the current config. If a section is setted, only will returns the section config

Parameters:section (str) – (Optional) Section name.
Returns:Representation of current config
Return type:dict
loadConfig()[source]
executeCheckers()[source]
executeReports()[source]
saveIssue(issue)[source]
showSummary()[source]
run()[source]

Run a scan in the path setted.

Module contents

class atomshields.AtomShieldsScanner(path, verbose=False)[source]

Bases: object

Class in charge of orchestrating the execution of the cherckers and the results.

HOME = '/usr/local/share/atomshields'
HOME_2 = '/home/docs/.atomshields'
CHECKERS_DIR = '/home/docs/.atomshields/checkers'
REPORTS_DIR = '/home/docs/.atomshields/reports'
CONFIG_PATH = '/home/docs/.atomshields/config'
debug(message, color=None, attrs=None)[source]
path

Getter for ‘path’ property

Returns:Absolute path to target directory
Return type:string
project

Getter for ‘project’ property

Returns:Projects’s name
Return type:string
configFile

Getter for ‘configFile’ property

Returns:Path to config file
Return type:str
config

Getter for ‘config’ property

Returns:Path to config file
Return type:str
issues

Getter for ‘issues’ property

Returns:List of Issue instances
Return type:list
static setup()[source]

Creates required directories and copy checkers and reports.

static installPlugin(destination)[source]
static installChecker()[source]
static installReport()[source]
static uninstallPlugin(name=None, classArgs=None)[source]
static uninstallChecker()[source]
static uninstallReport()[source]
static generateConfig()[source]
showScanProperties()[source]
checkProperties()[source]
getConfig(section=None)[source]

Returns a dictionary which contains the current config. If a section is setted, only will returns the section config

Parameters:section (str) – (Optional) Section name.
Returns:Representation of current config
Return type:dict
loadConfig()[source]
executeCheckers()[source]
executeReports()[source]
saveIssue(issue)[source]
showSummary()[source]
run()[source]

Run a scan in the path setted.

class atomshields.CommandHelper(command=None)[source]

Bases: object

Class used to execute commands in shell, an d get the output and the errors.

OS_UBUNTU = 'Ubuntu'
OS_DEBIAN = 'Debian'
OS_CENTOS = 'CentOS'
OS_REDHAT = 'Redhat'
OS_KALI = 'Kali'
OS_LINUX = 'Linux'
OS_MAC = 'Darwin'
OS_WINDOWS = 'Windows'
command

Getter for ‘command’ property

Returns:Command to execute
Return type:str
output

Getter for ‘output’ property

Returns:Stdout content
Return type:str
errors

Getter for ‘errors’ property

Returns:Stderr content
Return type:str
getOSName()[source]

Get the OS name. If OS is linux, returns the Linux distribution name

Returns:OS name
Return type:str
install(software, uninstall=False)[source]
execute(shell=True)[source]

Executes the command setted into class

Parameters:shell (boolean) – Set True if command is a shell command. Default: True