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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203 | from collections import OrderedDict
VERSION = "1.1.0"
"""Version of this set of plugin definitions."""
MINIMUM_THAT_VERSION = "1.1.0"
"""Minimum THAT version required to run these plugin definitions."""
NAME = "security"
PRIORITY = 7
ANALYZE_DATA = OrderedDict()
GET_TANIUM_DATA = OrderedDict()
GET_INTERNET_DATA = [
]
# ask the question 'Get Online from all machines'
# and store results in "online.csv"
GET_TANIUM_DATA["seconline.csv"] = {
"filters": [],
"sensors": ["online"],
}
# ask the question 'Get UAC Status from all machines'
# and store results in "uac.csv"
GET_TANIUM_DATA["uac.csv"] = {
"filters": [],
"sensors": ["UAC Status"],
}
# ask the question 'Get Windows Credential Security Settings from all machines'
# and store results in "wincredssettings.csv"
GET_TANIUM_DATA["wincredssettings.csv"] = {
"filters": [],
"sensors": ["Windows Credential Security Settings"],
}
# ask the question 'Get Local Account Last Password Change Days Ago from all machines'
# and store results in "lapwchange.csv"
GET_TANIUM_DATA["lapwchange.csv"] = {
"filters": [],
"sensors": ["Local Account Last Password Change Days Ago"],
}
# ask the question 'Get DNS Server from all machines'
# and store results in "dns.csv"
GET_TANIUM_DATA["dns.csv"] = {
"filters": ["DNS Server, that not contains:N/A"],
"sensors": ["DNS Server"],
}
# ask the question 'Get Open Shares from all machines'
# and store results in "openshares.csv"
GET_TANIUM_DATA["openshares.csv"] = {
"filters": ["Open Shares, that not contains:N/A"],
"sensors": ["Open Shares"],
}
# ask the question 'Get Firewall Status containing "disabled" from all machines with Firewall Status containing "disabled"'
# and store results in "firewalldisabled.csv"
GET_TANIUM_DATA["firewalldisabled.csv"] = {
"filters": ["Firewall Status, that contains:disable"],
"sensors": ["Firewall Status"],
}
# ask the question 'Get Unencrypted Wireless Networks from all machines with Unencrypted Wireless Networks containing "open"'
# and store results in "openwifi.csv"
GET_TANIUM_DATA["openwifi.csv"] = {
"filters": ["Unencrypted Wireless Networks, that contains:open"],
"sensors": ["Unencrypted Wireless Networks"],
}
# ask the question 'Get Network IP Gateway from all machines with Network IP Gateway not containing "N/A"'
# and store results in "netgateway.csv"
GET_TANIUM_DATA["netgateway.csv"] = {
"filters": ["Network IP Gateway, that not contains:N/A"],
"sensors": ["Network IP Gateway"],
}
ANALYZE_DATA["dns_server_count"] = """
# Number of DNS Servers detected across endpoints
csv = "dns.csv"
df = self.load_csv_as_df(csv)
col1 = 'DNS Server'
result = len(df[col1])
"""
ANALYZE_DATA["firewall_disabled"] = """
# total endpoints with firewall Disabled
csv = "firewalldisabled.csv"
df = self.load_csv_as_df(csv)
col1 = 'Count'
result = df[col1].sum()
"""
ANALYZE_DATA["open_wifi"] = """
# total endpoints with unencrypted wifi
csv = "openwifi.csv"
df = self.load_csv_as_df(csv)
col1 = 'Count'
result = df[col1].sum()
"""
ANALYZE_DATA["net_gateway"] = """
# Number of gateways detected across endpoints
csv = "netgateway.csv"
df = self.load_csv_as_df(csv)
col1 = 'Network IP Gateway'
result = len(df[col1])
"""
ANALYZE_DATA["uac_status"] = """
# total endpoints with UAC Disabled
csv = "uac.csv"
df = self.load_csv_as_df(csv)
col1 = 'UAC Status'
col2 = 'Disabled'
col3 = 'Count'
result = df.loc[df[col1] == col2, col3].sum()
"""
ANALYZE_DATA["lm_hash_enabled"] = """
# Endpoints where setting "LM Hash is prevented from being stored" is Disabled
# In other words, credentials are being stored
csv = "wincredssettings.csv"
df = self.load_csv_as_df(csv)
col1 = 'Setting Name'
col2 = 'LM Hash is prevented from being stored'
col3 = 'Setting Value'
col4 = 'Disabled'
col5 = 'Count'
predf = df.loc[df[col1] == col2]
result = predf.loc[predf[col3] == col4, col5].sum()
"""
ANALYZE_DATA["lsa_auditing_disabled"] = """
# Protected LSA Auditing Disabled
csv = "wincredssettings.csv"
df = self.load_csv_as_df(csv)
col1 = 'Setting Name'
col2 = 'Protected LSA Auditing'
col3 = 'Setting Value'
col4 = 'Disabled'
col5 = 'Count'
predf = df.loc[df[col1] == col2]
result = predf.loc[predf[col3] == col4, col5].sum()
"""
ANALYZE_DATA["cache_cred_count"] = """
# Cached Credential Logon Count
# Number of Endpoints with Cached Logon Count setting set to Default (10).
# If the Default value of 10 is set, the setting was likely never changed across endpoints.
# The default setting could be a potential security concern.
csv = "wincredssettings.csv"
df = self.load_csv_as_df(csv)
col1 = 'Setting Name'
col2 = 'Cached logons count'
col3 = 'Setting Value'
col4 = '10'
col5 = 'Count'
predf = df.loc[df[col1] == col2]
result = predf.loc[predf[col3] == col4, col5].sum()
"""
ANALYZE_DATA["KB2871997"] = """
# KB2871997 Enhanced Credential Security update missing
csv = "wincredssettings.csv"
df = self.load_csv_as_df(csv)
col1 = 'Setting Name'
col2 = 'KB2871997 Enhanced Credential Security update'
col3 = 'Setting Value'
col4 = 'Missing'
col5 = 'Count'
predf = df.loc[df[col1] == col2]
result = predf.loc[predf[col3] == col4, col5].sum()
"""
|