cloud66_agent 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/cloud66_agent +3 -2
- data/cloud66_agent.gemspec +1 -1
- data/lib/cloud66_agent/commands/fail2ban.rb +4 -3
- data/lib/cloud66_agent/utils/version.rb +1 -1
- data/lib/cloud66_agent.rb +3 -3
- metadata +2 -2
data/bin/cloud66_agent
CHANGED
@@ -68,8 +68,9 @@ elsif command == 'fail2ban'
|
|
68
68
|
OptionParser.new do |opts|
|
69
69
|
opts.on('--is-banned IS_BANNED', 'Is this a ban action') { |v| @is_banned = v }
|
70
70
|
opts.on('--ip-address IP_ADDRESS', 'IP address to act on') { |v| @ip_address = v }
|
71
|
+
opts.on('--attack ATTACK', 'Attack type') { |v| @attack = v }
|
71
72
|
end.order!
|
72
|
-
Cloud66Agent.fail2ban(@is_banned, @ip_address)
|
73
|
+
Cloud66Agent.fail2ban(@is_banned, @ip_address, @attack)
|
73
74
|
else
|
74
75
|
begin
|
75
76
|
Cloud66Agent.send command
|
@@ -77,4 +78,4 @@ else
|
|
77
78
|
$logger.error "Invalid command: #{command}"
|
78
79
|
exit -1
|
79
80
|
end
|
80
|
-
end
|
81
|
+
end
|
data/cloud66_agent.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.name = "cloud66_agent"
|
8
8
|
gem.version = Cloud66::Utils::Version.current
|
9
9
|
gem.platform = Gem::Platform::RUBY
|
10
|
-
gem.date = '2013-04-
|
10
|
+
gem.date = '2013-04-09'
|
11
11
|
gem.authors = ["Cloud 66"]
|
12
12
|
gem.email = ['hello@cloud66.com']
|
13
13
|
gem.description = "See https://www.cloud66.com for more info"
|
@@ -3,10 +3,11 @@ require 'cloud66_agent/utils/server'
|
|
3
3
|
module Cloud66
|
4
4
|
module Commands
|
5
5
|
class Fail2ban
|
6
|
-
def self.perform(is_banned, ip_address)
|
6
|
+
def self.perform(is_banned, ip_address, attack)
|
7
7
|
data = {
|
8
8
|
is_banned: is_banned,
|
9
|
-
ip_address: ip_address
|
9
|
+
ip_address: ip_address,
|
10
|
+
attack: attack
|
10
11
|
}
|
11
12
|
Utils::Server.send_fail2ban(data)
|
12
13
|
rescue => exc
|
@@ -15,4 +16,4 @@ module Cloud66
|
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
18
|
-
end
|
19
|
+
end
|
data/lib/cloud66_agent.rb
CHANGED
@@ -29,8 +29,8 @@ class Cloud66Agent
|
|
29
29
|
Cloud66::Commands::JobEnd.perform(job_uid, run_uid, run_status, run_time, results_file)
|
30
30
|
end
|
31
31
|
|
32
|
-
def self.fail2ban(is_banned, ip_address)
|
33
|
-
raise ArgumentError.new if is_banned.nil? || ip_address.nil?
|
34
|
-
Cloud66::Commands::Fail2ban.perform(is_banned, ip_address)
|
32
|
+
def self.fail2ban(is_banned, ip_address, attack)
|
33
|
+
raise ArgumentError.new if is_banned.nil? || ip_address.nil? || attack.nil?
|
34
|
+
Cloud66::Commands::Fail2ban.perform(is_banned, ip_address, attack)
|
35
35
|
end
|
36
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud66_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|