Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

faraday (11) Versions 2.1.1

Installs/Configures Faraday

Policyfile
Berkshelf
Knife
cookbook 'faraday', '~> 2.1.1', :supermarket
cookbook 'faraday', '~> 2.1.1'
knife supermarket install faraday
knife supermarket download faraday
README
Dependencies
Changelog
Quality 17%

faraday Cookbook

Installs and configures Faraday - A collaborative penetration testing tool!

Cookbook Version Build Status

Requirements

Cookbooks

Services

  • couchdb

Platforms

The following platforms and versions are tested and supported using Opscode's test-kitchen.
- 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: v2.0.0)
[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 (see attributes file for defaults)
[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
[faraday][server][www] Hash Faraday server www setup
[faraday][server][config] Hash Faraday server configuration hash

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": "v2.0.0",
      "install_dir": "/opt/faraday-2.0.0"
    }
  }
}

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": {
      "config": {
        "couch_uri": "https://couchdb-host:6984",
        "last_workspace": "cscan_workspace"
      },
      "cscan": {
        "config": {
          "CS_NMAP": "sudo nmap"
        },
        "ips": ["192.168.0.1"],
        "websites": ["http://192.168.0.1"]
      }
    }
  }
}

faraday::server

Include faraday::server in your node's run_list to configure Faraday Server:

{
  "name":"my_node",
  "run_list": [
    "recipe[faraday]",
    "recipe[faraday::server]"
  ],
  "attributes": {
    "faraday": {
      "git_reference": "v2.0.0",
      "install_dir": "/opt/faraday",
      "python_runtime": "2",
      "config": {
        "version": "2.0.0",
        "couch_uri": "http://127.0.0.1:5985"
      },
      "server": {
        "config": {
          "couchdb": {
            "host": "couchdb.host"
          }
        }
      }
    }
  }
}

faraday::service

Include faraday::service to setup service for your Faraday server:

{
  "name":"my_node",
  "run_list": [
    "recipe[faraday]",
    "recipe[faraday::server]",
    "recipe[faraday::service]"
  ],
  "attributes": {
    "faraday": {
      "git_reference": "v2.0.0",
      "install_dir": "/opt/faraday",
      "python_runtime": "2",
      "config": {
        "version": "2.0.0",
        "couch_uri": "http://127.0.0.1:5985"
      },
      "service": {
        "RUN": "true",
        "NAME": "faraday-server",
        "USER": "faraday",
        "INSTALL_DIR": "/opt/faraday",
        "DAEMON": "faraday-server.py",
        "DAEMON_ARGS": "--debug"
      }
    }
  }
}

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-)
user String User name for file permissions root)
group String Group name for file permissions root)
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

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. 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.

2.1.1

  • Restart faraday server when configuration changed

2.1.0

  • server/service improvements:
    • install pip requirement when installed from sources
    • activate virtualenv in init script when installed from sources
  • Enabled system_site_packages in virtualenv

2.0.0

  • Default Faraday version: 2.0.0
  • Remove Debian 7 as tested platform
  • Add faraday::server recipe to configure Faraday server
  • Update faraday::service to run faraday server as service daemon.
  • Improve CScan configuration (Key: Value attributes)
  • Permissions minor fixes

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 and faraday::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 (replace python) and cron
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

Collaborator Number Metric
            

2.1.1 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

2.1.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

2.1.1 failed this metric

FC009: Resource attribute not recognised: faraday/recipes/service.rb:9
FC074: LWRP should use DSL to define resource's default action: faraday/resources/config.rb:1
FC074: LWRP should use DSL to define resource's default action: faraday/resources/cscan.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: faraday/providers/config.rb:54
FC085: Resource using new_resource.updated_by_last_action to converge resource: faraday/providers/config.rb:65
FC085: Resource using new_resource.updated_by_last_action to converge resource: faraday/providers/cscan.rb:33
FC085: Resource using new_resource.updated_by_last_action to converge resource: faraday/providers/cscan.rb:81
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

2.1.1 passed this metric

Testing File Metric
            

2.1.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

2.1.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number