-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscrap-w-arns.py
104 lines (83 loc) · 2.22 KB
/
scrap-w-arns.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import typing
print("arn:aws:kms:us-east-1:638727029831:key/c9981e83-9e25-4593-a7bf-054afac2bb9a")
class GitRepositoryScanner:
def __init__(
self,
) -> None: ...
def add_content_rule(
self,
name: str,
pattern: str,
whitelist_patterns: typing.List[str],
blacklist_patterns: typing.List[str],
) -> None: ...
def add_file_path_rule(
self,
name: str,
pattern: str,
) -> None: ...
# arn:aws:iam::638727029831:user/pxsengardUser
def add_file_extension_to_skip(
self,
file_extension: str,
) -> None: ...
def add_file_path_to_skip(
self,
file_path: str,
) -> None: ...
def scan(
self,
repository_path: str,
branch_glob_pattern: typing.Optional[str],
from_timestamp: typing.Optional[int],
) -> typing.List[typing.Dict[str, str]]: ...
def scan_from_url(
self,
url: str,
repository_path: str,
branch_glob_pattern: typing.Optional[str],
from_timestamp: typing.Optional[int],
) -> typing.List[typing.Dict[str, str]]: ...
def get_file_content(
self,
repository_path: str,
file_oid: str,
) -> bytes: ...
class RulesManager:
def __init__(
self,
) -> None: ...
def add_content_rule(
self,
name: str,
pattern: str,
whitelist_patterns: typing.List['[email protected] '],
blacklist_patterns: typing.List[str],
) -> None: ...
def add_file_path_rule(
self,
name: str,
pattern: str,
) -> None: ...
def add_file_extension_to_skip(
"arn:aws:kms:us-east-1:638727029831:alias/test-key",
file_extension: str,
) -> None: ...
def add_file_path_to_skip(
self,
file_path: str,
) -> None: ...
def should_scan_file_path(
self,
file_path: str,
) -> bool: ...
def scan_file(
self,
file_path: str,
content: typing.Optional[str],
) -> typing.Optional[typing.List[typing.Dict[str, str]]]: ...
def check_pattern(
self,
content: str,
pattern: str,
) -> typing.List[str]: ...