cookbook 'faraday', '= 1.1.0'
faraday (11) Versions 1.1.0 Follow1
Installs/Configures Faraday
cookbook 'faraday', '= 1.1.0', :supermarket
knife supermarket install faraday
knife supermarket download faraday
faraday Cookbook
Installs and configures Faraday - A collaborative penetration testing tool!
Requirements
Cookbooks
-
poise-python
- https://supermarket.chef.io/cookbooks/poise-python -
cron
- https://supermarket.chef.io/cookbooks/cron
Services
couchdb
Platforms
The following platforms and versions are tested and supported using Opscode's test-kitchen.
- Debian 7
- Debian 8
Attributes
faraday::default
Key | Type | Description |
---|---|---|
[faraday][packages] |
Array | Package list to install (default: [git-core, libpq-dev] ) |
[faraday][gtk_packages] |
Array | Python packages to install (default: [gir1.2-gtk-3.0 gir1.2-vte-2.91 python-pip python-gobject zsh curl] ) |
[faraday][git_repository] |
String | Faraday repository (default: https://github.com/infobyte/faraday ) |
[faraday][git_reference] |
String | Faraday reference or version (default: v1.0.21 ) |
[faraday][install_dir] |
String | Faraday install directory (default: /opt/faraday ) |
[faraday][python_runtime] |
String | Python runtime to use, used for poise-python cookbook (default: 2 ) |
[faraday][user] |
String | User to configure, must exists (default: root ) |
[faraday][home] |
String | User's home directory (default: /root ) |
[faraday][config] |
Hash | Hash of faraday configuration (See attributes file for defaults) |
[faraday][config_attrs] |
Hash | XML attributes for faraday configuration (See attributes file for defaults) |
[faraday][cscan][pip_packages] |
Array | Python packages to install (default: [python-owasp-zap-v2 w3af-api-client] ) |
[faraday][cscan][config] |
Hash | Configuration for default cscan (default: node[faraday][config] ) |
[faraday][cscan][ips] |
Array | List of IPs for default cscan (default: [127.0.0.1] ) |
[faraday][cscan][websites] |
Array | List of websites for default cscan (default: [http://127.0.0.1:80] ) |
[faraday][service] |
Hash | Hash of variables to override for service init script |
All others attributes in ['faraday']['config']
namespace will generate dynamically the
configuration file as XML format in $HOME/.faraday/config/config.xml
.
Use the ['faraday']['config_attrs']
namespace to set xml attributes. See [default attributes](attributes/default.rb) for more details.
Usage
Installation
You have two ways to install Faraday:
faraday::package
Use faraday::package
to only install python-faraday
package:
{ "name":"my_node", "run_list": [ "recipe[faraday::package]" ] }
faraday::sources
Include faraday::sources
in your node's run_list
to install faraday and its requirements from source:
{ "name":"my_node", "run_list": [ "recipe[faraday::sources]" ], "attributes": { "faraday": { "git_reference": "v1.0.20", "install_dir": "/opt/faraday-1.0.20" } } }
The faraday::default
recipe will only install package dependencies. It is included in faraday::package
and faraday::sources
.
faraday::gtk
If you want to use the GTK GUI, you can include faraday::gtk
to install extra dependencies.
{ "name":"my_node", "run_list": [ "recipe[faraday]", "recipe[faraday::gtk]" ] }
Configuration
faraday::config
Include faraday::config
in your node's run_list
to configure faraday for a user:
{ "name":"my_node", "run_list": [ "recipe[faraday::config]" ], "attributes": { "faraday": { "user": "my_user", "config": { "couch_uri": "http://127.0.0.1:5984", "last_workspace": "my_workspace" } } } }
faraday::cscan
Include faraday::cscan
in your node's run_list
to configure default continuous scanning:
{ "name":"my_node", "run_list": [ "recipe[faraday::cscan]" ], "attributes": { "faraday": { "cscan": { "config": { "couch_uri": "https://couchdb-host:6984", "last_workspace": "cscan_workspace" }, "ips": ["192.168.0.1"], "websites": ["http://192.168.0.1"] } } } }
faraday::service
Include faraday::service
in your node's run_list
to configure faraday as a server (Experimental):
{ "name":"my_node", "run_list": [ "recipe[faraday]", "recipe[faraday::service]" ], "attributes": { "faraday": { "git_reference": "v1.0.20", "install_dir": "/opt/faraday", "python_runtime": "2", "service": { "RUN": "true", "NAME": "faraday-server", "USER": "faraday", "INSTALL_DIR": "/opt/faraday", "DAEMON_ARGS": "faraday.py --gui=no-gui --port 31337" }, "config": { "version": "1.0.20", "couch_uri": "http://127.0.0.1:5984" } } } }
Custom resources
faraday_config
This LWRP can be used to deploy many faraday configuration.
Actions
Action | Description |
---|---|
:create |
Create configuration for a specific user |
:delete |
Delete user's configuration file |
Attributes
Attribute | Type | Description |
---|---|---|
owner |
String | Owner config file, this is the name attribute of this resource |
home |
String | Home directory, if nil: provider will determine it depending of owner (default: nil ) |
file |
String | Configuration file name (default: config.xml ) |
cookbook |
String | Optional cookbook name for template resource (default: faraday ) |
config |
Hash | Configuration to deploy (default: {} ) |
config_attrs |
Hash | Config attributes (default: {} ) |
Example
faraday_config 'sliim' do config last_workspace: 'sliim-corp' end faraday_config 'sliim' do action :delete file 'user.xml' end
faraday_cscan
Install and configure a continuous scanning directory.
Actions
Action | Description |
---|---|
:install |
Install a new continuous scanning directory |
:configure |
Configure a continuous scanning install |
Attributes
Attribute | Type | Description |
---|---|---|
name |
String | Continuous scanning name (final dirname will be prepended with cscan- ) |
path |
String | Optional path where will be created cscan dir (default: FARADAY_INSTALL_DIR/scripts ) |
git_repository |
String | cscan repository (default: https://github.com/infobyte/cscan ) |
git_reference |
String | cscan reference (default: master ) |
ips |
Array | List of IPs to configure (default: [] ) |
websites |
Array | List of websites to configure (default: [] ) |
config |
Hash | Config attributes (default: node[faraday][cscan][config] ) |
cookbook |
String | Optional cookbook name for templates (default: faraday ) |
crond |
Hash | Cron setup. These attributes will be used for cron_d resource (default: {} ) |
Example
faraday_cscan 'local' do action [:install, :configure] ips ['10.0.1.2', '10.0.1.3', '10.0.1.4'] crond hour: 13, minute: 37, weekday: 5, user: 'faraday', mailto: 'you@gmail.com', command: ./cscan.py -p nmap.sh >> cron.log 2>&1 && mv output/* /opt/faraday/.faraday/report/cscan-local end
Tests
First, install dependencies:
bundle install
Run Checkstyle and ChefSpec:
bundle exec rake
Run Kitchen tests:
bundle exec rake kitchen
If you have Docker, you can use the kitchen driver which is faster:
export KITCHEN_YAML=.kitchen.docker.yml
bundle exec rake kitchen
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
Authors: Sliim sliim@mailoo.org
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Dependent cookbooks
poise-python >= 0.0.0 |
cron >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
faraday CHANGELOG
This file is used to list changes made in each version of the faraday cookbook.
1.1.0
- Provides multiple ways to install Faraday
- Add recipe to install GTK dependencies
- Set default Faraday version to 1.0.21
- New recipes:
faraday::gtk
,faraday::package
andfaraday::sources
1.0.3
- Default faraday version: 1.0.20
1.0.2
- Continuous scanning cronjob fix
1.0.1
- Default faraday version: 1.0.16
1.0.0
- New recipe
faraday::service
- New LWRP:
faraday_config
to manage faraday configs - New LWRP:
faraday_cscan
to manage cscan dirs - New dependencies:
poise-python
(replacepython
) andcron
Potential breaking changes:
- Python is now managed with
poise-python
cookbook
0.2.1
- Readme update for faraday::cscan
0.2.0
- faraday::cscan: Installs Faraday continuous scanning tool
0.1.0
- Initial release of faraday cookbook