capistrano-holepicker 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 95d4b2cb9a5203e1037dfd2e74e8dfc75d047e07
4
+ data.tar.gz: bde157807ef267036970cdc0081da8a0eb4e7c72
5
+ SHA512:
6
+ metadata.gz: ac88c7ec4346903457dcb68673d7c82cb6f437348e39be9d37e42fe30be829f884ba0be829ff8cb97ad4669ed620763fb2742d852f9a5330a9cf3c9a4e4f9339
7
+ data.tar.gz: 7b649cdfe2d63549408ef2988ed2dadc15aeeb7299d2c14f2265b9fbd4ae07bc871befa65c120ecb8a7d25afbdeb5a9c0faedb9f9a7afe8c45c2fe8958e3958f
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-holepicker.gemspec
4
+ gemspec
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2014 The Board of Trustees of the Leland Stanford Junior University
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,29 @@
1
+ # Capistrano::Holepicker
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'capistrano-holepicker'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install capistrano-holepicker
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/capistrano-holepicker/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/holepicker/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-holepicker"
8
+ spec.version = Capistrano::Holepicker::VERSION
9
+ spec.authors = ["Chris Beer"]
10
+ spec.email = ["cabeer@stanford.edu"]
11
+ spec.summary = %q{Capistrano/Holepicker integration for checking dependencies for vulnerabilities}
12
+ spec.homepage = ""
13
+ spec.license = "APACHE2"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency "capistrano", "~> 3.0"
21
+ spec.add_dependency "holepicker"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.5"
24
+ spec.add_development_dependency "rake"
25
+ end
@@ -0,0 +1,11 @@
1
+ require "capistrano/holepicker/version"
2
+ require 'holepicker'
3
+
4
+ module Capistrano
5
+ module Holepicker
6
+ class VulnerableException < Exception
7
+ end
8
+ end
9
+ end
10
+
11
+ load File.expand_path("../tasks/holepicker.rake", __FILE__)
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Holepicker
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,49 @@
1
+ require 'tempfile'
2
+
3
+ namespace :deploy do
4
+ namespace :check do
5
+ task :holepicker do
6
+ on roles(:app) do |host|
7
+ within release_path do
8
+
9
+ options = {
10
+ :ignored_gems => fetch(:holepicker_ignored_gems),
11
+ :offline => fetch(:holepicker_offline)
12
+ }
13
+
14
+ file = Tempfile.new('remote-Gemfile.lock')
15
+ begin
16
+ download! "#{release_path}/Gemfile.lock", file.path
17
+ reporter = HolePicker::ScanReporter.new
18
+ log = StringIO.new
19
+ reporter.logger = HolePicker::Logger.new log
20
+
21
+ scanner = HolePicker::Scanner.new(file.path, options)
22
+ scanner.instance_variable_set :@reporter, reporter
23
+ scanner.send :scan_gemfile, File.read(file.path), "Gemfile.lock"
24
+ success = reporter.success?
25
+
26
+ unless success
27
+ reporter.print_report
28
+ logger.important(log.string)
29
+ raise Capistrano::VulnerableException.new("HolePicker found vulnerabilities")
30
+ end
31
+
32
+ ensure
33
+ file.close
34
+ file.unlink
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ before 'deploy:publishing', 'deploy:check:holepicker'
42
+ end
43
+
44
+ namespace :load do
45
+ task :defaults do
46
+ set :holepicker_offline, false
47
+ set :holepicker_ignored_gems, []
48
+ end
49
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-holepicker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Chris Beer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: holepicker
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description:
70
+ email:
71
+ - cabeer@stanford.edu
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - capistrano-holepicker.gemspec
82
+ - lib/capistrano/holepicker.rb
83
+ - lib/capistrano/holepicker/version.rb
84
+ - lib/capistrano/tasks/holepicker.rake
85
+ homepage: ''
86
+ licenses:
87
+ - APACHE2
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.2.0
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: Capistrano/Holepicker integration for checking dependencies for vulnerabilities
109
+ test_files: []