owasp-pipeline 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +23 -0
- data/FEATURES +19 -0
- data/README.md +101 -0
- data/bin/pipeline +67 -0
- data/lib/pipeline.rb +301 -0
- data/lib/pipeline/event.rb +14 -0
- data/lib/pipeline/filters.rb +41 -0
- data/lib/pipeline/filters/base_filter.rb +19 -0
- data/lib/pipeline/filters/jira_one_time_filter.rb +57 -0
- data/lib/pipeline/filters/remove_all_filter.rb +16 -0
- data/lib/pipeline/finding.rb +52 -0
- data/lib/pipeline/mounters.rb +55 -0
- data/lib/pipeline/mounters/base_mounter.rb +31 -0
- data/lib/pipeline/mounters/docker_mounter.rb +44 -0
- data/lib/pipeline/mounters/filesystem_mounter.rb +25 -0
- data/lib/pipeline/mounters/git_mounter.rb +52 -0
- data/lib/pipeline/mounters/iso_mounter.rb +42 -0
- data/lib/pipeline/mounters/url_mounter.rb +28 -0
- data/lib/pipeline/options.rb +240 -0
- data/lib/pipeline/reporters.rb +50 -0
- data/lib/pipeline/reporters/base_reporter.rb +21 -0
- data/lib/pipeline/reporters/csv_reporter.rb +19 -0
- data/lib/pipeline/reporters/jira_reporter.rb +61 -0
- data/lib/pipeline/reporters/json_reporter.rb +20 -0
- data/lib/pipeline/reporters/text_reporter.rb +19 -0
- data/lib/pipeline/scanner.rb +28 -0
- data/lib/pipeline/tasks.rb +124 -0
- data/lib/pipeline/tasks/av.rb +43 -0
- data/lib/pipeline/tasks/base_task.rb +64 -0
- data/lib/pipeline/tasks/brakeman.rb +60 -0
- data/lib/pipeline/tasks/bundle-audit.rb +93 -0
- data/lib/pipeline/tasks/checkmarx.rb +62 -0
- data/lib/pipeline/tasks/eslint.rb +71 -0
- data/lib/pipeline/tasks/fim.rb +61 -0
- data/lib/pipeline/tasks/nsp.rb +59 -0
- data/lib/pipeline/tasks/owasp-dep-check.rb +120 -0
- data/lib/pipeline/tasks/patterns.json +394 -0
- data/lib/pipeline/tasks/retirejs.rb +106 -0
- data/lib/pipeline/tasks/scanjs-eslintrc +106 -0
- data/lib/pipeline/tasks/scanjs.rb +32 -0
- data/lib/pipeline/tasks/sfl.rb +67 -0
- data/lib/pipeline/tasks/test.rb +47 -0
- data/lib/pipeline/tasks/zap.rb +84 -0
- data/lib/pipeline/tracker.rb +47 -0
- data/lib/pipeline/util.rb +39 -0
- data/lib/pipeline/version.rb +3 -0
- data/lib/zapjson.json +0 -0
- metadata +205 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
class Pipeline::Tracker
|
4
|
+
attr_reader :options
|
5
|
+
attr_reader :warnings
|
6
|
+
attr_reader :errors
|
7
|
+
attr_reader :findings
|
8
|
+
|
9
|
+
# Pass in the options.
|
10
|
+
# Let the Tracker be the one thing that gets passed around
|
11
|
+
# with options and collecting output.
|
12
|
+
def initialize options
|
13
|
+
@options = options
|
14
|
+
@warnings = []
|
15
|
+
@errors = []
|
16
|
+
@findings = []
|
17
|
+
end
|
18
|
+
|
19
|
+
#Process events that
|
20
|
+
def process event
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
def error error
|
25
|
+
@errors << error
|
26
|
+
end
|
27
|
+
|
28
|
+
def warn warning
|
29
|
+
@warnings << warning
|
30
|
+
end
|
31
|
+
|
32
|
+
def report finding
|
33
|
+
@findings << finding
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_json
|
37
|
+
s = "{ \"findings\": [ "
|
38
|
+
@findings.each do |finding|
|
39
|
+
s << finding.to_json
|
40
|
+
s << ","
|
41
|
+
end
|
42
|
+
s = s.slice(0,s.length-1) # One easy way to remove the last ,
|
43
|
+
s << "] }"
|
44
|
+
s
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'open3'
|
2
|
+
require 'pathname'
|
3
|
+
require 'digest'
|
4
|
+
|
5
|
+
module Pipeline::Util
|
6
|
+
|
7
|
+
def runsystem(report,*splat)
|
8
|
+
Open3.popen3(*splat) do |stdin, stdout, stderr, wait_thr|
|
9
|
+
#puts *splat
|
10
|
+
pid = wait_thr.pid
|
11
|
+
res = stdout.read
|
12
|
+
error = stderr.read
|
13
|
+
exit = wait_thr.value
|
14
|
+
|
15
|
+
if wait_thr.value != 0 && report
|
16
|
+
# Weird. wait_thr value is non-0 for bundler-audit
|
17
|
+
# but not brakeman. Comment to keep output cleaner...
|
18
|
+
# puts res
|
19
|
+
puts error
|
20
|
+
#puts *splat
|
21
|
+
end
|
22
|
+
return res
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def fingerprint text
|
27
|
+
Digest::SHA2.new(256).update(text).to_s
|
28
|
+
end
|
29
|
+
|
30
|
+
def strip_archive_path path, delimeter
|
31
|
+
path.split(delimeter).last.split('/')[1..-1].join('/')
|
32
|
+
end
|
33
|
+
|
34
|
+
def relative_path path, pwd
|
35
|
+
pathname = Pathname.new(path)
|
36
|
+
return path if pathname.relative?
|
37
|
+
pathname.relative_path_from(Pathname.new pwd)
|
38
|
+
end
|
39
|
+
end
|
data/lib/zapjson.json
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,205 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: owasp-pipeline
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matt Konda
|
8
|
+
- Alex Lock
|
9
|
+
- Rafa Perez
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: terminal-table
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ">="
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.4'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '1.4'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: fastercsv
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '1.5'
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '1.5'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: highline
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.6.20
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 1.6.20
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: multi_json
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '1.2'
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '1.2'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: bundler-audit
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.3.1
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 0.3.1
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: brakeman
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 3.0.5
|
92
|
+
type: :runtime
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 3.0.5
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: curb
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 0.8.8
|
106
|
+
type: :runtime
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 0.8.8
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: jsonpath
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 0.5.7
|
120
|
+
type: :runtime
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: 0.5.7
|
127
|
+
description: Pipeline detects security vulnerabilities in code.
|
128
|
+
email: matt.konda@owasp.org
|
129
|
+
executables:
|
130
|
+
- pipeline
|
131
|
+
extensions: []
|
132
|
+
extra_rdoc_files: []
|
133
|
+
files:
|
134
|
+
- CHANGES
|
135
|
+
- FEATURES
|
136
|
+
- README.md
|
137
|
+
- bin/pipeline
|
138
|
+
- lib/pipeline.rb
|
139
|
+
- lib/pipeline/event.rb
|
140
|
+
- lib/pipeline/filters.rb
|
141
|
+
- lib/pipeline/filters/base_filter.rb
|
142
|
+
- lib/pipeline/filters/jira_one_time_filter.rb
|
143
|
+
- lib/pipeline/filters/remove_all_filter.rb
|
144
|
+
- lib/pipeline/finding.rb
|
145
|
+
- lib/pipeline/mounters.rb
|
146
|
+
- lib/pipeline/mounters/base_mounter.rb
|
147
|
+
- lib/pipeline/mounters/docker_mounter.rb
|
148
|
+
- lib/pipeline/mounters/filesystem_mounter.rb
|
149
|
+
- lib/pipeline/mounters/git_mounter.rb
|
150
|
+
- lib/pipeline/mounters/iso_mounter.rb
|
151
|
+
- lib/pipeline/mounters/url_mounter.rb
|
152
|
+
- lib/pipeline/options.rb
|
153
|
+
- lib/pipeline/reporters.rb
|
154
|
+
- lib/pipeline/reporters/base_reporter.rb
|
155
|
+
- lib/pipeline/reporters/csv_reporter.rb
|
156
|
+
- lib/pipeline/reporters/jira_reporter.rb
|
157
|
+
- lib/pipeline/reporters/json_reporter.rb
|
158
|
+
- lib/pipeline/reporters/text_reporter.rb
|
159
|
+
- lib/pipeline/scanner.rb
|
160
|
+
- lib/pipeline/tasks.rb
|
161
|
+
- lib/pipeline/tasks/av.rb
|
162
|
+
- lib/pipeline/tasks/base_task.rb
|
163
|
+
- lib/pipeline/tasks/brakeman.rb
|
164
|
+
- lib/pipeline/tasks/bundle-audit.rb
|
165
|
+
- lib/pipeline/tasks/checkmarx.rb
|
166
|
+
- lib/pipeline/tasks/eslint.rb
|
167
|
+
- lib/pipeline/tasks/fim.rb
|
168
|
+
- lib/pipeline/tasks/nsp.rb
|
169
|
+
- lib/pipeline/tasks/owasp-dep-check.rb
|
170
|
+
- lib/pipeline/tasks/patterns.json
|
171
|
+
- lib/pipeline/tasks/retirejs.rb
|
172
|
+
- lib/pipeline/tasks/scanjs-eslintrc
|
173
|
+
- lib/pipeline/tasks/scanjs.rb
|
174
|
+
- lib/pipeline/tasks/sfl.rb
|
175
|
+
- lib/pipeline/tasks/test.rb
|
176
|
+
- lib/pipeline/tasks/zap.rb
|
177
|
+
- lib/pipeline/tracker.rb
|
178
|
+
- lib/pipeline/util.rb
|
179
|
+
- lib/pipeline/version.rb
|
180
|
+
- lib/zapjson.json
|
181
|
+
homepage: http://github.com/OWASP/pipeline
|
182
|
+
licenses:
|
183
|
+
- Apache 2
|
184
|
+
metadata: {}
|
185
|
+
post_install_message:
|
186
|
+
rdoc_options: []
|
187
|
+
require_paths:
|
188
|
+
- lib
|
189
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '0'
|
194
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
requirements: []
|
200
|
+
rubyforge_project:
|
201
|
+
rubygems_version: 2.4.7
|
202
|
+
signing_key:
|
203
|
+
specification_version: 4
|
204
|
+
summary: Security toolchain for software build automation.
|
205
|
+
test_files: []
|