ipaccess 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.yardopts +2 -0
- data/ChangeLog +66 -0
- data/Manifest.txt +5 -10
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/docs/HISTORY +11 -0
- data/docs/TODO +1 -1
- data/docs/yard-tpl/default/fulldoc/html/css/common.css +5 -0
- data/examples/open-uri.rb +14 -0
- data/examples/telnet.rb +1 -1
- data/ipaccess.gemspec +62 -0
- data/lib/ipaccess.rb +2 -566
- data/lib/ipaccess/arm_sockets.rb +0 -1
- data/lib/ipaccess/core.rb +523 -0
- data/lib/ipaccess/ghost_doc/ghost_doc.rb +1 -1
- data/lib/ipaccess/ghost_doc/ghost_doc_acl.rdoc +54 -0
- data/lib/ipaccess/ghost_doc/ghost_doc_net_ftp.rb +35 -19
- data/lib/ipaccess/ghost_doc/ghost_doc_net_http.rb +34 -18
- data/lib/ipaccess/ghost_doc/ghost_doc_net_smtp.rb +35 -19
- data/lib/ipaccess/ghost_doc/ghost_doc_net_telnet.rb +35 -19
- data/lib/ipaccess/ghost_doc/ghost_doc_patched_usage.rdoc +65 -0
- data/lib/ipaccess/ghost_doc/ghost_doc_sockets.rb +353 -125
- data/lib/ipaccess/ip_access_check.rb +2 -2
- data/lib/ipaccess/ip_access_errors.rb +2 -2
- data/lib/ipaccess/ip_access_list.rb +3 -3
- data/lib/ipaccess/patches/generic.rb +150 -183
- data/lib/ipaccess/patches/net_ftp.rb +1 -2
- data/lib/ipaccess/patches/net_http.rb +10 -14
- data/lib/ipaccess/patches/net_imap.rb +1 -2
- data/lib/ipaccess/patches/net_pop.rb +2 -4
- data/lib/ipaccess/patches/net_smtp.rb +2 -4
- data/lib/ipaccess/patches/net_telnet.rb +1 -2
- data/lib/ipaccess/patches/sockets.rb +67 -69
- data/lib/ipaccess/socket.rb +0 -17
- metadata +70 -100
- metadata.gz.sig +0 -0
- data/lib/ipaccess/ghost_doc/ghost_doc_acl.rb +0 -54
- data/lib/ipaccess/ghost_doc/ghost_doc_p_blacklist.rb +0 -36
- data/lib/ipaccess/ghost_doc/ghost_doc_p_blacklist_e.rb +0 -7
- data/lib/ipaccess/ghost_doc/ghost_doc_p_unblacklist.rb +0 -36
- data/lib/ipaccess/ghost_doc/ghost_doc_p_unblacklist_e.rb +0 -7
- data/lib/ipaccess/ghost_doc/ghost_doc_p_unwhitelist.rb +0 -36
- data/lib/ipaccess/ghost_doc/ghost_doc_p_unwhitelist_e.rb +0 -7
- data/lib/ipaccess/ghost_doc/ghost_doc_p_whitelist.rb +0 -36
- data/lib/ipaccess/ghost_doc/ghost_doc_p_whitelist_e.rb +0 -7
- data/lib/ipaccess/ghost_doc/ghost_doc_patched_usage.rb +0 -64
@@ -1,36 +0,0 @@
|
|
1
|
-
# :call-seq:
|
2
|
-
# unblacklist(*addresses)<br />
|
3
|
-
# unblacklist(list, *addresses)
|
4
|
-
#
|
5
|
-
# This method removes blacklisted IP address(-es)
|
6
|
-
# from the input or output access list selected
|
7
|
-
# by the *list* argument (+:input+ or +:output+).
|
8
|
-
# If the access list selector is omited it
|
9
|
-
# operates on the default access list that certain
|
10
|
-
# kind of network object uses. The allowed format of address
|
11
|
-
# is the same as for IPAccess.to_cidrs.
|
12
|
-
# This method will not add nor remove any
|
13
|
-
# whitelisted item.
|
14
|
-
#
|
15
|
-
# === Restrictions
|
16
|
-
#
|
17
|
-
# This method won't allow you to modify the list if
|
18
|
-
# the global access set is associated with an object.
|
19
|
-
# You may operate on IPAccess::Set.Global or use
|
20
|
-
# unblacklist! instead.
|
21
|
-
#
|
22
|
-
# === Return value
|
23
|
-
#
|
24
|
-
# It will return the result of calling
|
25
|
-
# IPAccess::List#unblacklist on the list.
|
26
|
-
#
|
27
|
-
# === Revalidation
|
28
|
-
#
|
29
|
-
# After modyfing access set current connection
|
30
|
-
# is validated again to avoid access leaks.
|
31
|
-
#
|
32
|
-
# === DNS Warning
|
33
|
-
#
|
34
|
-
# You should avoid passing hostnames as arguments since
|
35
|
-
# DNS is not reliable and responses may change with time,
|
36
|
-
# which may cause security flaws.
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# :call-seq:
|
2
|
-
# unwhitelist(*addresses)<br />
|
3
|
-
# unwhitelist(list, *addresses)
|
4
|
-
#
|
5
|
-
# This method removes whitelisted IP address(-es)
|
6
|
-
# from the input or output access list selected
|
7
|
-
# by the *list* argument (+:input+ or +:output+).
|
8
|
-
# If the access list selector is omited it
|
9
|
-
# operates on the default access list that certain
|
10
|
-
# kind of network object uses. The allowed format of address
|
11
|
-
# is the same as for IPAccess.to_cidrs.
|
12
|
-
# This method will not add nor remove any
|
13
|
-
# blacklisted item.
|
14
|
-
#
|
15
|
-
# === Restrictions
|
16
|
-
#
|
17
|
-
# This method won't allow you to modify the list if
|
18
|
-
# the global access set is associated with an object.
|
19
|
-
# You may operate on IPAccess::Set.Global or use
|
20
|
-
# unwhitelist! instead.
|
21
|
-
#
|
22
|
-
# === Return value
|
23
|
-
#
|
24
|
-
# It will return the result of calling
|
25
|
-
# IPAccess::List#unwhitelist on the list.
|
26
|
-
#
|
27
|
-
# === Revalidation
|
28
|
-
#
|
29
|
-
# After modyfing access set current connection
|
30
|
-
# is validated again to avoid access leaks.
|
31
|
-
#
|
32
|
-
# === DNS Warning
|
33
|
-
#
|
34
|
-
# You should avoid passing hostnames as arguments since
|
35
|
-
# DNS is not reliable and responses may change with time,
|
36
|
-
# which may cause security flaws.
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# :call-seq:
|
2
|
-
# whitelist(*addresses)<br />
|
3
|
-
# whitelist(list, *addresses)
|
4
|
-
#
|
5
|
-
# This method whitelists IP address(-es) in
|
6
|
-
# the input or output access list selected
|
7
|
-
# by the *list* argument (+:input+ or +:output+).
|
8
|
-
# If the access list selector is omited it
|
9
|
-
# operates on the default access list that certain
|
10
|
-
# kind of network object uses. The allowed format of address
|
11
|
-
# is the same as for IPAccess.to_cidrs.
|
12
|
-
# This method will not add nor remove any
|
13
|
-
# blacklisted item.
|
14
|
-
#
|
15
|
-
# === Restrictions
|
16
|
-
#
|
17
|
-
# This method won't allow you to modify the list if
|
18
|
-
# the global access set is associated with an object.
|
19
|
-
# You may operate on IPAccess::Set.Global or use
|
20
|
-
# whitelist! instead.
|
21
|
-
#
|
22
|
-
# === Return value
|
23
|
-
#
|
24
|
-
# It will return the result of calling
|
25
|
-
# IPAccess::List#whitelist on the list.
|
26
|
-
#
|
27
|
-
# === Revalidation
|
28
|
-
#
|
29
|
-
# After modyfing access set current connection
|
30
|
-
# is validated again to avoid access leaks.
|
31
|
-
#
|
32
|
-
# === DNS Warning
|
33
|
-
#
|
34
|
-
# You should avoid passing hostnames as arguments since
|
35
|
-
# DNS is not reliable and responses may change with time,
|
36
|
-
# which may cause security flaws.
|
@@ -1,64 +0,0 @@
|
|
1
|
-
# Access checks are lazy,
|
2
|
-
# which means they are performed when
|
3
|
-
# a real connection is going to happend.
|
4
|
-
#
|
5
|
-
# Instances of this class will also
|
6
|
-
# internally use patched versions of Ruby's network
|
7
|
-
# socket objects to avoid access leaks.
|
8
|
-
#
|
9
|
-
# You can pass access set in various ways: while
|
10
|
-
# creating a new object or while a communication is
|
11
|
-
# already started. You can also rely on a global
|
12
|
-
# access set, which is used by default.
|
13
|
-
#
|
14
|
-
# === Usage
|
15
|
-
#
|
16
|
-
# There are 3 ways to enable access control:
|
17
|
-
#
|
18
|
-
# * by patching original class (see IPAccess.arm) – use it in code that you cannot modify
|
19
|
-
# * by patching single instance (see IPAccess.arm) – use it occasionally
|
20
|
-
# * by using instances of this class directly – use it in your own code
|
21
|
-
#
|
22
|
-
# There are also 4 ways to manage access rules:
|
23
|
-
#
|
24
|
-
# * by using direct methods like blacklist and whitelist – preferred
|
25
|
-
# * by using +acl+ member – low-level
|
26
|
-
# * by using <tt>IPAccess::Set.Global</tt> constant – controls a global access set
|
27
|
-
# * by using methods of an external IPAccess::Set object associated with an instance
|
28
|
-
#
|
29
|
-
# ==== Using direct methods
|
30
|
-
#
|
31
|
-
# Patched network objects and variants have methods to control access.
|
32
|
-
# You should use them since they are most reliable way to perform
|
33
|
-
# modifications on an working instance. These methods (documented
|
34
|
-
# below) are: whitelist, blacklist, whitelist! and blacklist!.
|
35
|
-
# Each of the methods ensures that needed safety checks are made
|
36
|
-
# when detecting some change in access lists.
|
37
|
-
#
|
38
|
-
# ==== Using +acl+ member
|
39
|
-
#
|
40
|
-
# The +acl+ member gives you direct access to internal IPAccess::Set
|
41
|
-
# instance that an object uses to control an access. However,
|
42
|
-
# by accessing this member you may only modify private and shared
|
43
|
-
# access sets, and you have to manually re-check connection against lists
|
44
|
-
# (e.g. by using method acl_recheck).
|
45
|
-
#
|
46
|
-
# ==== Using IPAccess::Set.Global
|
47
|
-
#
|
48
|
-
# You may use IPAccess::Set.Global to add or remove rules
|
49
|
-
# conatined in lists of a global access set. You should use
|
50
|
-
# it before some network objects are created and if it's not
|
51
|
-
# possible call acl_recheck for any object that is using it
|
52
|
-
# when some changes in rules are made. It is also possible
|
53
|
-
# to manipulate global access set from object's scope using
|
54
|
-
# whitelist! and blacklist! methods. For working
|
55
|
-
# objects you should use them.
|
56
|
-
#
|
57
|
-
# ==== Using external access set
|
58
|
-
#
|
59
|
-
# External access sets are simply IPAccess::Set objects
|
60
|
-
# that were associated with an instance during initialization
|
61
|
-
# or by assigning it to +acl+ member. You may manipulate their
|
62
|
-
# access rules safely before a networking object is in
|
63
|
-
# a connected state. After it happens it is safer to use
|
64
|
-
# direct controlling methods that network object provides.
|