login_attack_report 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdb2838a0f29019f47a8eb65c39761516e0f0aec
4
- data.tar.gz: 1408354cae0e893dff5b23c2e034b67321fd7bf6
3
+ metadata.gz: 90ec651c4f9966ec8d80b445ec9399e5207df9c1
4
+ data.tar.gz: edfceae3bb150af2a6df7740444e0b0030276c88
5
5
  SHA512:
6
- metadata.gz: 327f415e8a9fd4936018feeea8d970fd395d01d1bd727b594942ce5a378a658d2c6e31f2a4e1ee176f6d5f08377965e5099b30d5a6dc6f48c230747f36165d44
7
- data.tar.gz: 46e6a37606a50c3ae868f84fd737c4ee7b28825dea26486ccd0107acb633cda09babfa055018e57d4cad41774eed62dffc4d4f77f524c6e96df9e6112ed4ba10
6
+ metadata.gz: a57479ad6632a67b8cdd40f69bd39ef9d6149dd838df8bfae447f65760ae289ebe35b863366c7502d1c25606bb9910f61f885d298c8a6d251aa74dfb5722ccee
7
+ data.tar.gz: c169bce692f47a0ed0cb27cfa398138a767746863fb8bf632b175cd46789234b6ad380b0ba676050488d02e2fb6428d83c76b89e72c60391b07f37d9a7eaacd9
data/README.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # LoginAttackReport
2
2
 
3
- TODO: Write a gem description
3
+ 攻撃性のあるログインを判定します。
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
+ 'devise' and 'paper_trail' is required
8
9
 
9
10
  ```ruby
11
+ gem 'devise'
12
+ gem 'paper_trail'
13
+
10
14
  gem 'login_attack_report'
11
15
  ```
12
16
 
@@ -18,9 +22,33 @@ Or install it yourself as:
18
22
 
19
23
  $ gem install login_attack_report
20
24
 
25
+ ## Configuring
26
+
27
+ /config/initializers/login_attack_report.rb
28
+ ```ruby
29
+ LoginAttackReport.setup do |config|
30
+ # ログイン成功回数リミット
31
+ config.login_ok_limit = 200
32
+ # ログイン失敗回数リミット
33
+ config.login_ng_limit = 50
34
+ end
35
+ ```
36
+
21
37
  ## Usage
22
38
 
23
- TODO: Write usage instructions here
39
+ モデル名をシンボルで渡すことで攻撃性のあるログインを判定します。
40
+
41
+ ログイン成功回数のlimitを超えたユーザを抽出します。
42
+ ※ 異常に多い場合、どこかでID/パスワードが漏れている、もしくはIDが共有されている可能性あり
43
+ ```ruby
44
+ LoginAttackReport::LARVersion.login_ok_limit_over(:User)
45
+ ```
46
+
47
+ ログイン失敗回数のlimitを超えたユーザを抽出します。
48
+ ※ 異常に多い場合、リスト型攻撃を受けている可能性あり
49
+ ```ruby
50
+ LoginAttackReport::LARVersion.login_ng_limit_over(:User)
51
+ ```
24
52
 
25
53
  ## Contributing
26
54
 
@@ -0,0 +1,7 @@
1
+ require 'login_attack_report/l_a_r_version_concern'
2
+
3
+ module LoginAttackReport
4
+ class LAReportVersion < ::ActiveRecord::Base
5
+ include LoginAttackReport::LARVersionConcern
6
+ end
7
+ end
@@ -1,4 +1,4 @@
1
1
  #Dir[File.join(File.dirname(__FILE__), 'active_record', 'models', 'login_attack_report', '*.rb')].each do |file|
2
2
  # require "login_attack_report/frameworks/active_record/models/#{File.basename(file, '.rb')}"
3
3
  #end
4
- require "login_attack_report/frameworks/active_record/models/login_attack_report_version.rb"
4
+ require "login_attack_report/frameworks/active_record/models/l_a_r_version.rb"
@@ -1,7 +1,7 @@
1
1
  require 'active_support/concern'
2
2
 
3
3
  module LoginAttackReport
4
- module LoginAttackReportVersionConcern
4
+ module LARVersionConcern
5
5
  extend ::ActiveSupport::Concern
6
6
 
7
7
  module ClassMethods
@@ -1,3 +1,3 @@
1
1
  module LoginAttackReport
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -9,12 +9,16 @@ end
9
9
  require 'login_attack_report/frameworks/active_record'
10
10
 
11
11
  module LoginAttackReport
12
+
13
+ # login ok limit
12
14
  mattr_accessor :login_ok_limit
13
15
  @@login_ok_limit = 200
14
16
 
17
+ # login ng limit
15
18
  mattr_accessor :login_ng_limit
16
19
  @@login_ng_limit = 50
17
20
 
21
+ # config/initializers/login_attack_report.rb
18
22
  def self.setup
19
23
  yield self
20
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: login_attack_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - taru m
@@ -176,8 +176,8 @@ files:
176
176
  - Rakefile
177
177
  - lib/login_attack_report.rb
178
178
  - lib/login_attack_report/frameworks/active_record.rb
179
- - lib/login_attack_report/frameworks/active_record/models/login_attack_report_version.rb
180
- - lib/login_attack_report/login_attack_report_version_concern.rb
179
+ - lib/login_attack_report/frameworks/active_record/models/l_a_r_version.rb
180
+ - lib/login_attack_report/l_a_r_version_concern.rb
181
181
  - lib/login_attack_report/version.rb
182
182
  - login_attack_report.gemspec
183
183
  - spec/login_attack_report_spec.rb
@@ -1,7 +0,0 @@
1
- require 'login_attack_report/login_attack_report_version_concern'
2
-
3
- module LoginAttackReport
4
- class LoginAttackReportVersion < ::ActiveRecord::Base
5
- include LoginAttackReport::LoginAttackReportVersionConcern
6
- end
7
- end