easy_whitelist 1.0.31__py3-none-any.whl → 1.0.33__py3-none-any.whl
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.
- easy_whitelist/__init__.py +1 -1
- easy_whitelist/__main__.py +25 -10
- easy_whitelist/__version__.py +0 -0
- easy_whitelist/config/arg.py +3 -4
- easy_whitelist/ip/ip.py +20 -7
- easy_whitelist/ip/url.py +1 -1
- easy_whitelist/tcloud/client.py +8 -6
- easy_whitelist/tcloud/template.py +16 -14
- easy_whitelist-1.0.33.dist-info/METADATA +76 -0
- easy_whitelist-1.0.33.dist-info/RECORD +19 -0
- {easy_whitelist-1.0.31.dist-info → easy_whitelist-1.0.33.dist-info}/WHEEL +2 -1
- easy_whitelist-1.0.33.dist-info/entry_points.txt +2 -0
- easy_whitelist-1.0.33.dist-info/top_level.txt +1 -0
- easy_whitelist/doc/It is a test.docx +0 -0
- easy_whitelist/doc/a.txt +0 -1
- easy_whitelist-1.0.31.dist-info/METADATA +0 -68
- easy_whitelist-1.0.31.dist-info/RECORD +0 -19
- easy_whitelist-1.0.31.dist-info/entry_points.txt +0 -3
- {easy_whitelist-1.0.31.dist-info → easy_whitelist-1.0.33.dist-info}/LICENSE +0 -0
easy_whitelist/__init__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
r"""Easy_whitelist is a smart tool that detects the local Internet IP address and automatically updates the local Internet IP address to the cloud security group whitelist. The tool is written in Python.
|
2
2
|
"""
|
3
|
-
__version__ = '1.0.31'
|
3
|
+
# __version__ = '1.0.31'
|
4
4
|
# __author__ = 'qiqileleabaobao <qiqilelebaobao@163.com>'
|
5
5
|
|
6
6
|
__all__ = []
|
easy_whitelist/__main__.py
CHANGED
@@ -6,13 +6,14 @@ import os
|
|
6
6
|
import pprint
|
7
7
|
import string
|
8
8
|
import sys
|
9
|
+
import logging
|
9
10
|
|
10
11
|
from easy_whitelist.config import arg
|
11
12
|
from easy_whitelist.tcloud import client
|
12
13
|
from easy_whitelist.tcloud.template import list_template, set_template, create_template
|
13
14
|
|
14
15
|
|
15
|
-
def loop_list(common_client):
|
16
|
+
def loop_list(common_client, proxy=None):
|
16
17
|
template_ids = list_template(common_client)
|
17
18
|
last_input = None
|
18
19
|
while True:
|
@@ -23,9 +24,9 @@ def loop_list(common_client):
|
|
23
24
|
if input_from_user.isdigit():
|
24
25
|
if template_ids:
|
25
26
|
if (a := int(input_from_user)) > 0 and a <= len(template_ids):
|
26
|
-
set_template(common_client, template_ids[a - 1])
|
27
|
+
set_template(common_client, template_ids[a - 1], proxy)
|
27
28
|
else:
|
28
|
-
|
29
|
+
logging.info('Wrong index, please input right index from the list.')
|
29
30
|
elif input_from_user == 'l' or input_from_user == 'L':
|
30
31
|
list_template(common_client)
|
31
32
|
elif input_from_user == 'q' or input_from_user == 'Q':
|
@@ -33,23 +34,37 @@ def loop_list(common_client):
|
|
33
34
|
elif input_from_user == '':
|
34
35
|
continue
|
35
36
|
else:
|
36
|
-
|
37
|
+
logging.info('Input error.')
|
37
38
|
|
38
|
-
def
|
39
|
-
|
40
|
-
|
39
|
+
def set_log(verbose=0):
|
40
|
+
# FMT = '%(asctime)s %(process)d %(filename)s L%(lineno)s %(levelname)s %(message)s'
|
41
|
+
FMT = '%(asctime)s - %(process)d - %(filename)s - L%(lineno)s - %(levelname)s - %(message)s'
|
41
42
|
|
43
|
+
if verbose == 0:
|
44
|
+
logging.basicConfig(level=logging.WARN, format=FMT)
|
45
|
+
elif verbose == 1:
|
46
|
+
logging.basicConfig(level=logging.INFO, format=FMT)
|
47
|
+
elif verbose >=2:
|
48
|
+
logging.basicConfig(level=logging.DEBUG, format=FMT)
|
49
|
+
else:
|
50
|
+
print("Wrong position in set_log.")
|
51
|
+
|
52
|
+
def main():
|
53
|
+
tencent, alibaba, action, target, target_id, proxy, verbose = arg.init_arg()
|
54
|
+
|
55
|
+
set_log(verbose)
|
56
|
+
|
42
57
|
common_client = client.get_common_client(proxy)
|
43
58
|
|
44
59
|
if tencent and target == 'template':
|
45
60
|
if action == 'list':
|
46
61
|
loop_list(common_client)
|
47
62
|
elif action == 'set':
|
48
|
-
|
63
|
+
set_template(common_client, target_id, proxy)
|
49
64
|
elif action == 'create':
|
50
|
-
create_template(common_client, target_id)
|
65
|
+
create_template(common_client, target_id, proxy)
|
51
66
|
else:
|
52
|
-
|
67
|
+
logging.error('Wrong postion, shall not be here.')
|
53
68
|
|
54
69
|
|
55
70
|
if __name__ == '__main__':
|
File without changes
|
easy_whitelist/config/arg.py
CHANGED
@@ -9,7 +9,8 @@ def init_arg():
|
|
9
9
|
my_group.add_argument('-t', '-T', '--tencent', action='store_true', default=True, help='tencent cloud')
|
10
10
|
my_group.add_argument('-a', '-A', '--alibaba', action='store_true', help='alibaba cloud')
|
11
11
|
|
12
|
-
parser.add_argument('-p', '-P', '--proxy', action='store', default
|
12
|
+
parser.add_argument('-p', '-P', '--proxy', action='store', default=None, type=int, help ='local HTTP proxy port')
|
13
|
+
parser.add_argument('-v', '--verbose', action='count', default=0)
|
13
14
|
|
14
15
|
parser.add_argument('target', help='template or rule_id', choices=['template', 'rule_id'])
|
15
16
|
parser.add_argument('action', help='list', choices=['list', 'set', 'create'])
|
@@ -17,6 +18,4 @@ def init_arg():
|
|
17
18
|
|
18
19
|
args = parser.parse_args()
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
return args.tencent, args.alibaba, args.action, args.target, args.target_id, args.proxy
|
21
|
+
return args.tencent, args.alibaba, args.action, args.target, args.target_id, args.proxy, args.verbose
|
easy_whitelist/ip/ip.py
CHANGED
@@ -2,20 +2,33 @@ import requests
|
|
2
2
|
import sys
|
3
3
|
import random
|
4
4
|
import re
|
5
|
+
import time
|
6
|
+
import logging
|
5
7
|
|
6
8
|
from . import url
|
7
9
|
|
8
|
-
def get_local_ip_from_url_and_parse(u, patt, ag):
|
10
|
+
def get_local_ip_from_url_and_parse(u, patt, ag, proxy=None):
|
9
11
|
# 发送GET请求
|
10
12
|
headers = {'user-agent': ag}
|
11
|
-
# print(f'user_agent:{ag}')
|
12
13
|
try:
|
13
|
-
|
14
|
+
logging.info(f'Starting fetch local ip from {u} with proxy {proxy}')
|
15
|
+
|
16
|
+
if proxy:
|
17
|
+
response = requests.get(u, headers=headers, timeout=(3,5),
|
18
|
+
proxies={"http": f"http://127.0.0.1:{proxy}",
|
19
|
+
"https": f"http://127.0.0.1:{proxy}"
|
20
|
+
})
|
21
|
+
else:
|
22
|
+
response = requests.get(u, headers=headers, timeout=(3, 5))
|
23
|
+
|
14
24
|
# 获取响应内容
|
15
25
|
respon = response.text
|
16
26
|
l_ip = url.parse_ip_from_response(respon, patt)
|
27
|
+
logging.info(f'Ending fetch local ip from {u} with ip {l_ip}')
|
28
|
+
|
17
29
|
return l_ip
|
18
|
-
except Exception:
|
30
|
+
except Exception as e:
|
31
|
+
logging.error(e)
|
19
32
|
return None
|
20
33
|
|
21
34
|
def validate_ip(l_ip):
|
@@ -32,11 +45,11 @@ def validate_ip(l_ip):
|
|
32
45
|
else:
|
33
46
|
return False
|
34
47
|
|
35
|
-
def get_local_ips():
|
48
|
+
def get_local_ips(proxy=None):
|
36
49
|
ip_list = []
|
37
50
|
for i, u in enumerate(url.detect_url, 1):
|
38
|
-
l_ip = get_local_ip_from_url_and_parse(u[0], u[1], u[2])
|
39
|
-
if validate_ip(l_ip):
|
51
|
+
l_ip = get_local_ip_from_url_and_parse(u[0], u[1], u[2], proxy)
|
52
|
+
if l_ip and validate_ip(l_ip):
|
40
53
|
ip_list.append(l_ip)
|
41
54
|
return ip_list
|
42
55
|
|
easy_whitelist/ip/url.py
CHANGED
@@ -11,6 +11,6 @@ def parse_ip_from_response(response, patt):
|
|
11
11
|
|
12
12
|
detect_url = [
|
13
13
|
['https://ifconfig.me', IFCONFIG_ME_PATTERN, random.choice(curl_user_agent)],
|
14
|
-
['
|
14
|
+
['http://cip.cc', CIP_CC_PATTERN, random.choice(chrome_user_agent)],
|
15
15
|
['https://tool.lu/ip/', TOOL_LU_PATTERN, random.choice(chrome_user_agent)]
|
16
16
|
]
|
easy_whitelist/tcloud/client.py
CHANGED
@@ -7,17 +7,19 @@ from tencentcloud.common.common_client import CommonClient
|
|
7
7
|
|
8
8
|
|
9
9
|
def get_common_client(proxy):
|
10
|
-
cred = credential.Credential(
|
11
|
-
|
12
|
-
|
10
|
+
# cred = credential.Credential(
|
11
|
+
# os.environ.get("TENCENTCLOUD_SECRET_ID"),
|
12
|
+
# os.environ.get("TENCENTCLOUD_SECRET_KEY"))
|
13
|
+
|
14
|
+
cred = credential.DefaultCredentialProvider().get_credential()
|
13
15
|
|
14
16
|
httpProfile = HttpProfile()
|
15
|
-
httpProfile.endpoint = "vpc.tencentcloudapi.com"
|
16
|
-
if proxy
|
17
|
-
httpProfile.proxy = f'127.0.0.1:{proxy}'
|
17
|
+
# httpProfile.endpoint = "vpc.tencentcloudapi.com"
|
18
|
+
httpProfile.proxy = f'127.0.0.1:{proxy}' if proxy else None
|
18
19
|
|
19
20
|
clientProfile = ClientProfile()
|
20
21
|
clientProfile.httpProfile = httpProfile
|
22
|
+
# clientProfile.signMethod = 'HmacSHA256'
|
21
23
|
|
22
24
|
common_client = CommonClient("vpc", "2017-03-12", cred, "ap-nanjing", profile=clientProfile)
|
23
25
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import json
|
2
2
|
import random
|
3
|
-
|
3
|
+
import sys
|
4
|
+
import logging
|
4
5
|
|
5
6
|
from ..ip import ip
|
6
7
|
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
|
@@ -15,8 +16,9 @@ def write_template_list_to_temp_file(template_ids):
|
|
15
16
|
|
16
17
|
def get_template(common_client):
|
17
18
|
try:
|
18
|
-
|
19
|
-
templates = common_client.call_json("DescribeAddressTemplates",
|
19
|
+
params = {}
|
20
|
+
# templates = common_client.call_json("DescribeAddressTemplates", params, options = {'SkipSign': True})
|
21
|
+
templates = common_client.call_json("DescribeAddressTemplates", params, )
|
20
22
|
return templates
|
21
23
|
|
22
24
|
except TencentCloudSDKException as err:
|
@@ -79,8 +81,8 @@ def modify_template_address(common_client, client_ips, target_id):
|
|
79
81
|
return False
|
80
82
|
except (TencentCloudSDKException, IndexError) as err:
|
81
83
|
# IndexError catch when there is no match target.Example: 'AddressTemplateSet': []
|
82
|
-
print(f"{err=}, {type(err)=}
|
83
|
-
|
84
|
+
print(f"{err=}, {type(err)=}")
|
85
|
+
sys.exit(1)
|
84
86
|
|
85
87
|
params = "{{\"AddressTemplateId\":\"{}\",{}}}".format(target_id, client_ips)
|
86
88
|
try:
|
@@ -93,29 +95,29 @@ def modify_template_address(common_client, client_ips, target_id):
|
|
93
95
|
|
94
96
|
return True
|
95
97
|
|
96
|
-
def get_local_ip_and_format_addressesextra():
|
97
|
-
client_ip_list = ip.get_local_ips()
|
98
|
+
def get_local_ip_and_format_addressesextra(proxy=None):
|
99
|
+
client_ip_list = ip.get_local_ips(proxy)
|
98
100
|
# ip.print_ip_list(client_ip_list)
|
99
101
|
client_ip_list = list(set(client_ip_list))
|
100
102
|
addresses_extra = format_addres_extra_string_from_list(client_ip_list)
|
101
103
|
|
102
104
|
return addresses_extra
|
103
105
|
|
104
|
-
def set_template(common_client, target_id):
|
106
|
+
def set_template(common_client, target_id, proxy=None):
|
105
107
|
# with open('/tmp/template_0000.txt', 'r') as temp_file:
|
106
108
|
# data = json.load(temp_file)
|
107
109
|
# print(data)
|
108
110
|
if target_id:
|
109
111
|
if target_id.startswith('ipm-'):
|
110
|
-
addresses_extra = get_local_ip_and_format_addressesextra()
|
112
|
+
addresses_extra = get_local_ip_and_format_addressesextra(proxy)
|
111
113
|
if modify_template_address(common_client, addresses_extra, target_id):
|
112
|
-
|
114
|
+
logging.info(f'Successfully set {{{target_id}}} to {{{addresses_extra}}}')
|
113
115
|
else:
|
114
|
-
|
116
|
+
logging.warning('Wrong template id.')
|
115
117
|
else:
|
116
|
-
|
118
|
+
logging.error('Set template shall input template id.')
|
117
119
|
|
118
|
-
def create_template(common_client, rule_id):
|
120
|
+
def create_template(common_client, rule_id, proxy=None):
|
119
121
|
|
120
122
|
if not rule_id:
|
121
123
|
print('Create template shall input security group id.')
|
@@ -137,7 +139,7 @@ def create_template(common_client, rule_id):
|
|
137
139
|
print(f"{err=}, {type(err)=}")
|
138
140
|
return False
|
139
141
|
|
140
|
-
addresses_extra = get_local_ip_and_format_addressesextra()
|
142
|
+
addresses_extra = get_local_ip_and_format_addressesextra(proxy)
|
141
143
|
params = f"{{\"AddressTemplateName\":\"temp-open-{random.randint(1,9999):04d}\",{addresses_extra}}}"
|
142
144
|
try:
|
143
145
|
respon = common_client.call_json("CreateAddressTemplate", json.loads(params))
|
@@ -0,0 +1,76 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: easy_whitelist
|
3
|
+
Version: 1.0.33
|
4
|
+
Summary: Easy_whitelist is a smart tool that detects the local Internet IP address and automatically updates the local Internet IP address to the cloud security group whitelist. The tool is written in Python.
|
5
|
+
Home-page: https://github.com/qiqilelebaobao/easy_whitelist
|
6
|
+
Author: qiqilelebaobao
|
7
|
+
Author-email: qiqilelebaobao <qiqilelebaobao@163.com>
|
8
|
+
Maintainer-email: qiqilelebaobao <qiqilelebaobao@163.com>
|
9
|
+
License: Apache License 2.0
|
10
|
+
Project-URL: Homepage, https://github.com/qiqilelebaobao/easy_whitelist
|
11
|
+
Keywords: automation,whitelist,acl,security-groups,alibaba-cloud,tencent-cloud,security-tools,security-group-rule
|
12
|
+
Platform: any
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
25
|
+
Requires-Python: >=3.6
|
26
|
+
Description-Content-Type: text/markdown
|
27
|
+
License-File: LICENSE
|
28
|
+
Requires-Dist: tencentcloud-sdk-python
|
29
|
+
Provides-Extra: cli
|
30
|
+
Requires-Dist: rich ; extra == 'cli'
|
31
|
+
Requires-Dist: click ; extra == 'cli'
|
32
|
+
Provides-Extra: gui
|
33
|
+
Requires-Dist: PyQt5 ; extra == 'gui'
|
34
|
+
|
35
|
+
# Easy_whitelist
|
36
|
+
|
37
|
+
Easy_whitelist ������������������������������ IP ������������������������������IP������������������������������������������������������������������������ Python ���������
|
38
|
+
|
39
|
+
Easy_whitelist is a smart tool that detects the local Internet IP address and automatically updates the local Internet IP address to the cloud security group whitelist. The tool is written in Python.
|
40
|
+
|
41
|
+
���������������������
|
42
|
+
* ��������������������������� IP ������
|
43
|
+
* ������������������������������������������������������
|
44
|
+
* ���������������������������������
|
45
|
+
|
46
|
+
Main functions include:
|
47
|
+
* Automatically detect the local Internet IP address
|
48
|
+
* Support security group whitelist updates for Alibaba Cloud and Tencent Cloud
|
49
|
+
* Tencent Cloud supports address template updates
|
50
|
+
|
51
|
+
## ������������ Applicable Scenarios
|
52
|
+
|
53
|
+
* ������������������������������������������������IP��������������������������������������������� IP���������������������������������
|
54
|
+
* ������������IP ������������ NAT ������������������������������������������������������������������ IP ������������������������������������������������������
|
55
|
+
* ���������������������������������������������������������������������������������������������
|
56
|
+
|
57
|
+
* Scene1: Users who do not know how to detect the public IP of their local machine can use this tool to automatically detect the public IP and add it to the cloud security group whitelist
|
58
|
+
* Scene2: IP addresses often change due to NAT environments, including home environments or broadband environments without fixed export IPs in companies, which require safe use of cloud environment resources
|
59
|
+
* Scene3: Test scenarios, frequent changes in client environments, which require safe use of cloud environment resources
|
60
|
+
|
61
|
+
## ������������ Installation Guide
|
62
|
+
|
63
|
+
������ Python3 ������
|
64
|
+
Python3 is required
|
65
|
+
|
66
|
+
## ������������ Basic Usage
|
67
|
+
|
68
|
+
* ������������������������������������������
|
69
|
+
```shell
|
70
|
+
$ easy template list
|
71
|
+
```
|
72
|
+
|
73
|
+
* ������������������������������������������������������������������������ID
|
74
|
+
```shell
|
75
|
+
$ easy template create rule_id
|
76
|
+
```
|
@@ -0,0 +1,19 @@
|
|
1
|
+
easy_whitelist/__init__.py,sha256=oniEQkiWM2fVBhyZa1-WuwJ1dxkhb029_Tq95x4eZ1k,305
|
2
|
+
easy_whitelist/__main__.py,sha256=x5teqF_1OWhLujmBM37jYNJ9Ed1kF_xyzkYpJf4TCI0,2358
|
3
|
+
easy_whitelist/__version__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
easy_whitelist/config/__init__.py,sha256=fK-lJ3GD4u1_FGkZfPf-f7fxjMwb1t0AZcG7mfIHLks,19
|
5
|
+
easy_whitelist/config/arg.py,sha256=efzlQSHK49MFhf0VAnVt6jkGxdwW3ae3yUJmDIKx9mY,1087
|
6
|
+
easy_whitelist/ip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
easy_whitelist/ip/agent.py,sha256=dJDkw1mipazcOyldbBZW5Mhjr17UqDlaBn2jUo80C7I,487
|
8
|
+
easy_whitelist/ip/ip.py,sha256=K34xjZsFWsSi70crQQ51k04x8H5StC-yE5ZMWDEm41I,2145
|
9
|
+
easy_whitelist/ip/pattern.py,sha256=184XTlT0087eBZbm9LC5AB38PMLazQueW8E7l4jSwkM,149
|
10
|
+
easy_whitelist/ip/url.py,sha256=kFBZ2E_AYQ-AYo7eeKQJ22kjviQ61bZMdQS4EOR5j-k,439
|
11
|
+
easy_whitelist/tcloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
+
easy_whitelist/tcloud/client.py,sha256=eHevgHB1Y8C2Rwa8ztiIm-GkNTOJDlWU7RMNhw6oTmw,906
|
13
|
+
easy_whitelist/tcloud/template.py,sha256=NQzYPM67tMlILG5Q4AzNjOBlRKqaypTk36M1xzJE7fU,6053
|
14
|
+
easy_whitelist-1.0.33.dist-info/LICENSE,sha256=sWhlh6jzXRpuhxIbCZfjCEX_YQI4mMK6iO1bfpgkfzM,11343
|
15
|
+
easy_whitelist-1.0.33.dist-info/METADATA,sha256=FY1LD-EYu4Jrpi593Bn557RqZdgPqrghd-hv2jBlXSQ,5214
|
16
|
+
easy_whitelist-1.0.33.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
17
|
+
easy_whitelist-1.0.33.dist-info/entry_points.txt,sha256=vQB-2wmiATOP7-bhVNxVKrCEVve5oqokQBFdeBVn5JA,54
|
18
|
+
easy_whitelist-1.0.33.dist-info/top_level.txt,sha256=ZR8igmJpNA4m0VqhK0akcjJz5MYsx-7S3X6SKT5doDA,15
|
19
|
+
easy_whitelist-1.0.33.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
easy_whitelist
|
Binary file
|
easy_whitelist/doc/a.txt
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
It is a test.
|
@@ -1,68 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: easy_whitelist
|
3
|
-
Version: 1.0.31
|
4
|
-
Summary: Easy_whitelist is a smart tool that detects the local Internet IP address and automatically updates the local Internet IP address to the cloud security group whitelist. The tool is written in Python.
|
5
|
-
Keywords: automation,whitelist,acl,security-groups,alibaba-cloud,tencent-cloud,security-tools,security-group-rule
|
6
|
-
Author: qiqilelebaobao
|
7
|
-
Author-email: qiqilelebaobao <qiqilelebaobao@163.com>
|
8
|
-
Maintainer-email: qiqilelebaobao <qiqilelebaobao@163.com>
|
9
|
-
Requires-Python: >= 3.6
|
10
|
-
Description-Content-Type: text/markdown
|
11
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
13
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
14
|
-
Classifier: Programming Language :: Python :: 3.6
|
15
|
-
Classifier: Programming Language :: Python :: 3.7
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
20
|
-
Classifier: Programming Language :: Python :: 3.12
|
21
|
-
Classifier: Programming Language :: Python :: 3.13
|
22
|
-
Classifier: Programming Language :: Python :: 3.14
|
23
|
-
Requires-Dist: tencentcloud-sdk-python
|
24
|
-
Project-URL: Homepage, https://github.com/qiqilelebaobao/easy_whitelist
|
25
|
-
|
26
|
-
# Easy_whitelist
|
27
|
-
|
28
|
-
Easy_whitelist 是一个探测本机互联网 IP 地址,将并本机互联网IP地址,自动更新到云安全组白名单的小工具。工具使用 Python 编写。
|
29
|
-
|
30
|
-
Easy_whitelist is a smart tool that detects the local Internet IP address and automatically updates the local Internet IP address to the cloud security group whitelist. The tool is written in Python.
|
31
|
-
|
32
|
-
主要功能包括:
|
33
|
-
* 自动探测本机互联网 IP 地址
|
34
|
-
* 支持阿里云、腾讯云的安全组白名单更新
|
35
|
-
* 腾讯云支持地址模板更新
|
36
|
-
|
37
|
-
Main functions include:
|
38
|
-
* Automatically detect the local Internet IP address
|
39
|
-
* Support security group whitelist updates for Alibaba Cloud and Tencent Cloud
|
40
|
-
* Tencent Cloud supports address template updates
|
41
|
-
|
42
|
-
## 适用场景 Applicable Scenarios
|
43
|
-
|
44
|
-
* 场景一:不知道如何探测本机的公网IP的用户,通过本工具自动探测公网 IP,并添加云安全组白名单
|
45
|
-
* 场景二:IP 地址因为 NAT 环境经常变化,包括家庭环境或者公司无固定出口 IP 的宽带环境,需要安全的使用云环境资源
|
46
|
-
* 场景三:测试场景,频繁变换客户端环境,需要安全的使用云环境资源
|
47
|
-
|
48
|
-
* Scene1: Users who do not know how to detect the public IP of their local machine can use this tool to automatically detect the public IP and add it to the cloud security group whitelist
|
49
|
-
* Scene2: IP addresses often change due to NAT environments, including home environments or broadband environments without fixed export IPs in companies, which require safe use of cloud environment resources
|
50
|
-
* Scene3: Test scenarios, frequent changes in client environments, which require safe use of cloud environment resources
|
51
|
-
|
52
|
-
## 安装指南 Installation Guide
|
53
|
-
|
54
|
-
需要 Python3 环境
|
55
|
-
Python3 is required
|
56
|
-
|
57
|
-
## 使用说明 Basic Usage
|
58
|
-
|
59
|
-
* 通过列表选择模版,设置白名单
|
60
|
-
```shell
|
61
|
-
$ easy template list
|
62
|
-
```
|
63
|
-
|
64
|
-
* 通过新创建模版,设置白名单。需要指定关联的安全组ID
|
65
|
-
```shell
|
66
|
-
$ easy template create rule_id
|
67
|
-
```
|
68
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
easy_whitelist/__init__.py,sha256=5PrSB7dTn3Metbdbva4bSW4QjNNrp4u-YzfCnyb4ew4,303
|
2
|
-
easy_whitelist/__main__.py,sha256=8N3DqF3_9JNiq1qgZcOubPyUA0v7jmnz2deBBtMLdEQ,1801
|
3
|
-
easy_whitelist/config/__init__.py,sha256=fK-lJ3GD4u1_FGkZfPf-f7fxjMwb1t0AZcG7mfIHLks,19
|
4
|
-
easy_whitelist/config/arg.py,sha256=hB1CSpDfbIPykf8e-OqeKHStDujXGNaFk2guxdupAnE,1024
|
5
|
-
easy_whitelist/doc/It is a test.docx,sha256=aAPdtPbBj34q2V38SDwjLy5bRJwaLAF1AmvSdfM_VH8,10179
|
6
|
-
easy_whitelist/doc/a.txt,sha256=y_-nenhYi-eTXfGUbXiOVdYwPY8_Pqrb5F1rc2GkbWI,13
|
7
|
-
easy_whitelist/ip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
easy_whitelist/ip/agent.py,sha256=dJDkw1mipazcOyldbBZW5Mhjr17UqDlaBn2jUo80C7I,487
|
9
|
-
easy_whitelist/ip/ip.py,sha256=ri4KcamYJY3WRhOIPrtctlrhs2WO5Q_qDy661-dizb0,1595
|
10
|
-
easy_whitelist/ip/pattern.py,sha256=184XTlT0087eBZbm9LC5AB38PMLazQueW8E7l4jSwkM,149
|
11
|
-
easy_whitelist/ip/url.py,sha256=pZeexIQfJFWv-KdlOIAOVVk5aap4dyLsu2CiV8i9ofw,438
|
12
|
-
easy_whitelist/tcloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
-
easy_whitelist/tcloud/client.py,sha256=Cbx66K8S7fAMto9GJMynOplbgk1m-QWg863BxeO0D24,785
|
14
|
-
easy_whitelist/tcloud/template.py,sha256=Q2RX6uZVMMS0EhwVPXn1Ume5hBDQDslgaxXIic-cEvQ,5854
|
15
|
-
easy_whitelist-1.0.31.dist-info/entry_points.txt,sha256=-URzXdGXqVTDQm_AhH9k0u4Qm9G0s4ZDXcnA-XQt73Q,53
|
16
|
-
easy_whitelist-1.0.31.dist-info/LICENSE,sha256=sWhlh6jzXRpuhxIbCZfjCEX_YQI4mMK6iO1bfpgkfzM,11343
|
17
|
-
easy_whitelist-1.0.31.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
18
|
-
easy_whitelist-1.0.31.dist-info/METADATA,sha256=tTayuz-_ebZc1C2KqOWqP5j2ads2f1NfOBMq2hZEXvI,3325
|
19
|
-
easy_whitelist-1.0.31.dist-info/RECORD,,
|
File without changes
|