ruby-zoom 4.5.0 → 4.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zoom/profile.rb +17 -1
- data/lib/zoom/profile/ack.rb +3 -1
- data/lib/zoom/profile/ag.rb +3 -1
- data/lib/zoom/profile/find.rb +3 -1
- data/lib/zoom/profile/grep.rb +3 -1
- data/lib/zoom/profile/passwords.rb +6 -7
- data/lib/zoom/profile/pt.rb +3 -1
- data/lib/zoom/profile/unsafe_c.rb +6 -7
- data/lib/zoom/profile/unsafe_java.rb +6 -7
- data/lib/zoom/profile/unsafe_js.rb +6 -7
- data/lib/zoom/profile/unsafe_php.rb +6 -7
- data/lib/zoom/profile/unsafe_python.rb +6 -7
- data/lib/zoom/profile/unsafe_ruby.rb +6 -7
- data/lib/zoom/profile_manager.rb +1 -6
- data/lib/zoom/security_profile.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10788664e72eaeaad581c1097eecd0e7114fc31a
|
4
|
+
data.tar.gz: b7bff318e1386bb839520de8ebe62315434b9ec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f5b567886b3ee100cf19c2065bf4bc3fd98b42c1a7eb42c12c129f1be21379e80a20b93adec218d64ed70456ee273a0cce5592cf917053f9fbdda8dfd301223
|
7
|
+
data.tar.gz: abcbb6123f6e5bbbcef0132515d50321200f070c5cd6d11273b92b002061bf02853b86b2a40c8fca0eddeb7d9777fec1b8909cbd8e426004ab5b33dc01f22c80
|
data/lib/zoom/profile.rb
CHANGED
@@ -19,6 +19,16 @@ class Zoom::Profile < Hash
|
|
19
19
|
return self["before"]
|
20
20
|
end
|
21
21
|
|
22
|
+
def camel_case_to_underscore(clas)
|
23
|
+
# Convert camelcase class to unscore separated string
|
24
|
+
name = clas.to_s.split("::")[-1]
|
25
|
+
name.gsub!(/([A-Z]+)([A-Z][a-z])/, "\\1_\\2")
|
26
|
+
name.gsub!(/([a-z0-9])([A-Z])/, "\\1_\\2")
|
27
|
+
name.tr!("-", "_")
|
28
|
+
return name.downcase
|
29
|
+
end
|
30
|
+
private :camel_case_to_underscore
|
31
|
+
|
22
32
|
def class_name
|
23
33
|
return self["class"]
|
24
34
|
end
|
@@ -119,7 +129,13 @@ class Zoom::Profile < Hash
|
|
119
129
|
end
|
120
130
|
private :hilight_pattern
|
121
131
|
|
122
|
-
def initialize(n, o =
|
132
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
133
|
+
a ||= ""
|
134
|
+
b ||= ""
|
135
|
+
f ||= ""
|
136
|
+
n ||= camel_case_to_underscore(self.class.to_s)
|
137
|
+
o ||= "echo"
|
138
|
+
|
123
139
|
self["class"] = self.class.to_s
|
124
140
|
after(a)
|
125
141
|
before(b)
|
data/lib/zoom/profile/ack.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
class Zoom::Profile::Ack < Zoom::Profile
|
2
|
-
def initialize(n, o =
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
3
3
|
# Special case because of debian
|
4
|
+
o ||= "ack"
|
4
5
|
if ((o == "ack") && ScoobyDoo.where_are_you("ack-grep"))
|
5
6
|
o = "ack-grep"
|
6
7
|
end
|
7
8
|
|
9
|
+
f ||= "--smart-case"
|
8
10
|
super(n, o, f, b, a)
|
9
11
|
@format_flags = [
|
10
12
|
"--follow",
|
data/lib/zoom/profile/ag.rb
CHANGED
data/lib/zoom/profile/find.rb
CHANGED
data/lib/zoom/profile/grep.rb
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
class Zoom::SecurityProfile::Passwords < Zoom::SecurityProfile
|
2
|
-
def initialize(n, o = nil, f =
|
3
|
-
flags = ""
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
4
3
|
case Zoom::ProfileManager.default_profile
|
5
4
|
when /^ack(-grep)?$/
|
6
|
-
|
5
|
+
f ||= "--smart-case"
|
7
6
|
when "ag"
|
8
|
-
|
7
|
+
f ||= "-Su"
|
9
8
|
when "grep"
|
10
|
-
|
9
|
+
f ||= "-ai"
|
11
10
|
when "pt"
|
12
|
-
|
11
|
+
f ||= "-SU --hidden"
|
13
12
|
end
|
14
13
|
|
15
|
-
super(n, nil,
|
14
|
+
super(n, nil, f, b, a)
|
16
15
|
@pattern = "(key|pass(wd|word)?)[^:=,>]? *[:=,>]"
|
17
16
|
@taggable = true
|
18
17
|
end
|
data/lib/zoom/profile/pt.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
class Zoom::Profile::Pt < Zoom::Profile
|
2
|
-
def initialize(n, o =
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
3
|
+
f ||= "-S"
|
4
|
+
o ||= "pt"
|
3
5
|
super(n, o, f, b, a)
|
4
6
|
@format_flags = "-e -f --nocolor --nogroup"
|
5
7
|
@taggable = true
|
@@ -1,18 +1,17 @@
|
|
1
1
|
class Zoom::SecurityProfile::UnsafeC < Zoom::SecurityProfile
|
2
|
-
def initialize(n, o = nil, f =
|
3
|
-
flags = ""
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
4
3
|
case Zoom::ProfileManager.default_profile
|
5
4
|
when /^ack(-grep)?$/
|
6
|
-
|
5
|
+
f ||= "--smart-case --cc --cpp"
|
7
6
|
when "ag"
|
8
|
-
|
7
|
+
f ||= "-S -G \"\\.(c|h)(pp)?$\""
|
9
8
|
when "grep"
|
10
|
-
|
9
|
+
f ||= "-i --include=\"*.[ch]\" --include=\"*.[ch]pp\""
|
11
10
|
when "pt"
|
12
|
-
|
11
|
+
f ||= "-S -G \"\\.(c|h)(pp)?$\""
|
13
12
|
end
|
14
13
|
|
15
|
-
super(n, nil,
|
14
|
+
super(n, nil, f, b, a)
|
16
15
|
@pattern = [
|
17
16
|
"(",
|
18
17
|
[
|
@@ -1,22 +1,21 @@
|
|
1
1
|
class Zoom::SecurityProfile::UnsafeJava < Zoom::SecurityProfile
|
2
|
-
def initialize(n, o = nil, f =
|
3
|
-
flags = ""
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
4
3
|
case Zoom::ProfileManager.default_profile
|
5
4
|
when /^ack(-grep)?$/
|
6
|
-
|
5
|
+
f ||= "--smart-case --java"
|
7
6
|
when "ag"
|
8
|
-
|
7
|
+
f ||= "-S -G \"\\.(java|properties)$\""
|
9
8
|
when "grep"
|
10
|
-
|
9
|
+
f ||= [
|
11
10
|
"-i",
|
12
11
|
"--include=\"*.java\"",
|
13
12
|
"--include=\"*.properties\""
|
14
13
|
].join(" ")
|
15
14
|
when "pt"
|
16
|
-
|
15
|
+
f ||= "-S -G \"\\.(java|properties)$\""
|
17
16
|
end
|
18
17
|
|
19
|
-
super(n, nil,
|
18
|
+
super(n, nil, f, b, a)
|
20
19
|
@pattern = [
|
21
20
|
"(sun\\.misc\\.)?Unsafe",
|
22
21
|
"(\\.getRuntime|readObject|Runtime)\\("
|
@@ -1,18 +1,17 @@
|
|
1
1
|
class Zoom::SecurityProfile::UnsafeJs < Zoom::SecurityProfile
|
2
|
-
def initialize(n, o = nil, f =
|
3
|
-
flags = ""
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
4
3
|
case Zoom::ProfileManager.default_profile
|
5
4
|
when /^ack(-grep)?$/
|
6
|
-
|
5
|
+
f ||= "--smart-case --js"
|
7
6
|
when "ag"
|
8
|
-
|
7
|
+
f ||= "-S -G \"\\.js$\""
|
9
8
|
when "grep"
|
10
|
-
|
9
|
+
f ||= "-i --include=\"*.js\""
|
11
10
|
when "pt"
|
12
|
-
|
11
|
+
f ||= "-S -G \"\\.js$\""
|
13
12
|
end
|
14
13
|
|
15
|
-
super(n, nil,
|
14
|
+
super(n, nil, f, b, a)
|
16
15
|
@pattern = "\\.((append|eval|html)\\(|innerHTML)"
|
17
16
|
@taggable = true
|
18
17
|
end
|
@@ -1,23 +1,22 @@
|
|
1
1
|
class Zoom::SecurityProfile::UnsafePhp < Zoom::SecurityProfile
|
2
|
-
def initialize(n, o = nil, f =
|
3
|
-
flags = ""
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
4
3
|
case Zoom::ProfileManager.default_profile
|
5
4
|
when /^ack(-grep)?$/
|
6
|
-
|
5
|
+
f ||= "--smart-case --php"
|
7
6
|
when "ag"
|
8
|
-
|
7
|
+
f ||= "-S -G \"\\.ph(p[345t]?|tml)$\""
|
9
8
|
when "grep"
|
10
|
-
|
9
|
+
f ||= [
|
11
10
|
"-i",
|
12
11
|
"--include=\"*.php\"",
|
13
12
|
"--include=\"*.php[345t]\"",
|
14
13
|
"--include=\"*.phtml\""
|
15
14
|
].join(" ")
|
16
15
|
when "pt"
|
17
|
-
|
16
|
+
f ||= "-S -G \"\\.ph(p[345t]?|tml)$\""
|
18
17
|
end
|
19
18
|
|
20
|
-
super(n, nil,
|
19
|
+
super(n, nil, f, b, a)
|
21
20
|
# From here: https://www.eukhost.com/blog/webhosting/dangerous-php-functions-must-be-disabled/
|
22
21
|
# OMG is anything safe?!
|
23
22
|
@pattern = [
|
@@ -1,18 +1,17 @@
|
|
1
1
|
class Zoom::SecurityProfile::UnsafePython < Zoom::SecurityProfile
|
2
|
-
def initialize(n, o = nil, f =
|
3
|
-
flags = ""
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
4
3
|
case Zoom::ProfileManager.default_profile
|
5
4
|
when /^ack(-grep)?$/
|
6
|
-
|
5
|
+
f ||= "--smart-case --python"
|
7
6
|
when "ag"
|
8
|
-
|
7
|
+
f ||= "-S -G \"\\.py$\""
|
9
8
|
when "grep"
|
10
|
-
|
9
|
+
f ||= "-i --include=\"*.py\""
|
11
10
|
when "pt"
|
12
|
-
|
11
|
+
f ||= "-S -G \"\\.py$\""
|
13
12
|
end
|
14
13
|
|
15
|
-
super(n, nil,
|
14
|
+
super(n, nil, f, b, a)
|
16
15
|
@pattern = [
|
17
16
|
"(",
|
18
17
|
[
|
@@ -1,16 +1,15 @@
|
|
1
1
|
class Zoom::SecurityProfile::UnsafeRuby < Zoom::SecurityProfile
|
2
|
-
def initialize(n, o = nil, f =
|
3
|
-
flags = ""
|
2
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
4
3
|
case Zoom::ProfileManager.default_profile
|
5
4
|
when /^ack(-grep)?$/
|
6
|
-
|
5
|
+
f ||= "--smart-case --ruby"
|
7
6
|
when "ag"
|
8
|
-
|
7
|
+
f ||= [
|
9
8
|
"-S",
|
10
9
|
"-G \"\\.(erb|r(ake|b|html|js|xml)|spec)$|Rakefile\""
|
11
10
|
].join(" ")
|
12
11
|
when "grep"
|
13
|
-
|
12
|
+
f ||= [
|
14
13
|
"-i",
|
15
14
|
"--include=\"*.erb\"",
|
16
15
|
"--include=\"*.rake\"",
|
@@ -22,13 +21,13 @@ class Zoom::SecurityProfile::UnsafeRuby < Zoom::SecurityProfile
|
|
22
21
|
"--include=\"Rakefile\""
|
23
22
|
].join(" ")
|
24
23
|
when "pt"
|
25
|
-
|
24
|
+
f ||= [
|
26
25
|
"-S",
|
27
26
|
"-G \"\\.(erb|r(ake|b|html|js|xml)|spec)$|Rakefile\""
|
28
27
|
].join(" ")
|
29
28
|
end
|
30
29
|
|
31
|
-
super(n, nil,
|
30
|
+
super(n, nil, f, b, a)
|
32
31
|
@pattern = [
|
33
32
|
"%x\\(",
|
34
33
|
"\\.constantize",
|
data/lib/zoom/profile_manager.rb
CHANGED
@@ -39,12 +39,7 @@ class Zoom::ProfileManager
|
|
39
39
|
def self.security_profiles
|
40
40
|
profs = Array.new
|
41
41
|
Zoom::SecurityProfile.subclasses.each do |clas|
|
42
|
-
|
43
|
-
name = clas.to_s.split("::")[-1]
|
44
|
-
name.gsub!(/([A-Z]+)([A-Z][a-z])/, "\\1_\\2")
|
45
|
-
name.gsub!(/([a-z0-9])([A-Z])/, "\\1_\\2")
|
46
|
-
name.tr!("-", "_")
|
47
|
-
profs.push(clas.new(name.downcase))
|
42
|
+
profs.push(clas.new)
|
48
43
|
end
|
49
44
|
return profs
|
50
45
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
clas = Zoom::ProfileManager.default_profile.capitalize
|
2
2
|
superclass = Zoom::Profile.profile_by_name("Zoom::Profile::#{clas}")
|
3
3
|
class Zoom::SecurityProfile < superclass
|
4
|
-
def initialize(n, o = nil, f =
|
4
|
+
def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
|
5
5
|
super(n, Zoom::ProfileManager.default_profile, f, b, a)
|
6
6
|
end
|
7
7
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-zoom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
version: '2.0'
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 2.0.
|
62
|
+
version: 2.0.2
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,7 +69,7 @@ dependencies:
|
|
69
69
|
version: '2.0'
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 2.0.
|
72
|
+
version: 2.0.2
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: fagin
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|