Skip to content

Commit fbed4f1

Browse files
committed
change
1 parent 705c92c commit fbed4f1

File tree

3 files changed

+234
-32
lines changed

3 files changed

+234
-32
lines changed

02-LogModules/Auth.Log/03-Features/04-SSHTable.ps1

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,47 @@ elseif ($UsernameFlag -eq "False") {
8080

8181
if ($Format_1_Count -ge 1) {
8282
Write-Output ""
83-
Write-Output "Successful SSH Password Authentication"
84-
Write-Output "+------------------------------------+"
85-
$Successful_SSH_HashTable["format_1"]
83+
Write-Output "Successful SSH Password Authentication - Raw Table"
84+
85+
# variable to cretae the amount of spaces needed for the table
86+
$MaxLength = ($Successful_SSH_HashTable["format_1"] | Measure-Object Length -Maximum).Maximum
87+
88+
# variable to story the new amount of hyfens
89+
$Border = '-' * $MaxLength
90+
91+
foreach ($Event in $Successful_SSH_HashTable["format_1"]) {
92+
93+
# add space to the right of each event iteration
94+
$Event = $Event.PadRight($MaxLength)
95+
96+
Write-Output "+$Border+"
97+
Write-Output "|$Event|"
98+
99+
}
100+
Write-Output "+$Border+"
101+
86102
}
87103

88104
if ($Format_2_Count -ge 1) {
89105
Write-Output ""
90-
Write-Output "Successful SSH Public key Authentication"
91-
Write-Output "+--------------------------------------+"
92-
$Successful_SSH_HashTable["format_2"]
106+
Write-Output "Successful SSH Public key Authentication - Raw Table"
107+
108+
# variable to cretae the amount of spaces needed for the table
109+
$MaxLength = ($Successful_SSH_HashTable["format_2"] | Measure-Object Length -Maximum).Maximum
110+
111+
# variable to story the new amount of hyfens
112+
$Border = '-' * $MaxLength
113+
114+
foreach ($Event in $Successful_SSH_HashTable["format_2"]) {
115+
116+
# add space to the right of each event iteration
117+
$Event = $Event.PadRight($MaxLength)
118+
119+
Write-Output "+$Border+"
120+
Write-Output "|$Event|"
121+
122+
}
123+
Write-Output "+$Border+"
93124
}
94125

95126
# reset 1

02-LogModules/Auth.Log/03-Features/05-UsersGroupsActivity.ps1

Lines changed: 194 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -121,68 +121,236 @@ foreach ($SingleLine in $AuthLogCopyContent) {
121121
# print out the user creation activity
122122
if ($useradd_Count -ge 1) {
123123
Write-Output ""
124-
Write-Output "New User Creation Activity"
125-
Write-Output "+------------------------+"
126-
$UsersGroupActivity_HT["useradd"]
124+
Write-Output "New User Creation Activity - Raw Events"
125+
126+
# variable to cretae the amount of spaces needed for the table
127+
$MaxLength = ($UsersGroupActivity_HT["useradd"] | Measure-Object Length -Maximum).Maximum
128+
129+
# variable to stor the new amount of hyfens
130+
$Border = '-' * $MaxLength
131+
132+
# foreach loop to iterate and past each event seperate from the hashtable
133+
foreach ($Event in $UsersGroupActivity_HT["useradd"]) {
134+
135+
# add space to the right of each event iteration
136+
$Event = $Event.PadRight($MaxLength)
137+
138+
# print start\middle border
139+
Write-Output "+$Border+"
140+
141+
# print each event
142+
Write-Output "|$Event|"
143+
144+
}
145+
146+
# print last border
147+
Write-Output "+$Border+"
127148
}
128149

129150
# print out the user deletion activity
130151
if ($userdel_Count -ge 1) {
131152
Write-Output ""
132-
Write-Output "User Deletion Activity"
133-
Write-Output "+--------------------+"
134-
$UsersGroupActivity_HT["userdel"]
153+
Write-Output "User Deletion Activity - Raw Events"
154+
155+
# variable to cretae the amount of spaces needed for the table
156+
$MaxLength = ($UsersGroupActivity_HT["userdel"] | Measure-Object Length -Maximum).Maximum
157+
158+
# variable to stor the new amount of hyfens
159+
$Border = '-' * $MaxLength
160+
161+
# foreach loop to iterate and past each event seperate from the hashtable
162+
foreach ($Event in $UsersGroupActivity_HT["userdel"]) {
163+
164+
# add space to the right of each event iteration
165+
$Event = $Event.PadRight($MaxLength)
166+
167+
# print start\middle border
168+
Write-Output "+$Border+"
169+
170+
# print each event
171+
Write-Output "|$Event|"
172+
173+
}
174+
175+
# print last border
176+
Write-Output "+$Border+"
135177
}
136178

137179
# print out the user Password Change Activity
138180
if ($ChangePassword_Count -ge 1) {
139181
Write-Output ""
140-
Write-Output "User Password Change Activity"
141-
Write-Output "+---------------------------+"
142-
$UsersGroupActivity_HT["ChangePassword"]
182+
Write-Output "User Password Change Activity - Raw Events"
183+
184+
# variable to cretae the amount of spaces needed for the table
185+
$MaxLength = ($UsersGroupActivity_HT["ChangePassword"] | Measure-Object Length -Maximum).Maximum
186+
187+
# variable to stor the new amount of hyfens
188+
$Border = '-' * $MaxLength
189+
190+
# foreach loop to iterate and past each event seperate from the hashtable
191+
foreach ($Event in $UsersGroupActivity_HT["ChangePassword"]) {
192+
193+
# add space to the right of each event iteration
194+
$Event = $Event.PadRight($MaxLength)
195+
196+
# print start\middle border
197+
Write-Output "+$Border+"
198+
199+
# print each event
200+
Write-Output "|$Event|"
201+
202+
}
203+
204+
# print last border
205+
Write-Output "+$Border+"
143206
}
144207

145208
# print out the group creation
146209
if ($groupadd_Count -ge 1) {
147210
Write-Output ""
148-
Write-Output "New Group Creation Activity"
149-
Write-Output "+-------------------------+"
150-
$UsersGroupActivity_HT["groupadd"]
211+
Write-Output "New Group Creation Activity - Raw Events"
212+
213+
# variable to cretae the amount of spaces needed for the table
214+
$MaxLength = ($UsersGroupActivity_HT["groupadd"] | Measure-Object Length -Maximum).Maximum
215+
216+
# variable to stor the new amount of hyfens
217+
$Border = '-' * $MaxLength
218+
219+
# foreach loop to iterate and past each event seperate from the hashtable
220+
foreach ($Event in $UsersGroupActivity_HT["groupadd"]) {
221+
222+
# add space to the right of each event iteration
223+
$Event = $Event.PadRight($MaxLength)
224+
225+
# print start\middle border
226+
Write-Output "+$Border+"
227+
228+
# print each event
229+
Write-Output "|$Event|"
230+
231+
}
232+
233+
# print last border
234+
Write-Output "+$Border+"
151235
}
152236

153237
# print out the group deletion
154238
if ($groudel_Count -ge 1) {
155239
Write-Output ""
156-
Write-Output "Group Deletion Activity"
157-
Write-Output "+---------------------+"
158-
$UsersGroupActivity_HT["groudel"]
240+
Write-Output "Group Deletion Activity - Raw Events"
241+
242+
# variable to cretae the amount of spaces needed for the table
243+
$MaxLength = ($UsersGroupActivity_HT["groudel"] | Measure-Object Length -Maximum).Maximum
244+
245+
# variable to stor the new amount of hyfens
246+
$Border = '-' * $MaxLength
247+
248+
# foreach loop to iterate and past each event seperate from the hashtable
249+
foreach ($Event in $UsersGroupActivity_HT["groudel"]) {
250+
251+
# add space to the right of each event iteration
252+
$Event = $Event.PadRight($MaxLength)
253+
254+
# print start\middle border
255+
Write-Output "+$Border+"
256+
257+
# print each event
258+
Write-Output "|$Event|"
259+
260+
}
261+
262+
# print last border
263+
Write-Output "+$Border+"
159264
}
160265

161266
# print out the add user to group activity
162267
if ($AddUserToGroup_Count -ge 1) {
163268
Write-Output ""
164-
Write-Output "User Added To A Group Activity"
165-
Write-Output "+----------------------------+"
166-
$UsersGroupActivity_HT["AddUserToGroup"]
269+
Write-Output "User Added To A Group Activity - Raw Events"
270+
271+
# variable to cretae the amount of spaces needed for the table
272+
$MaxLength = ($UsersGroupActivity_HT["AddUserToGroup"] | Measure-Object Length -Maximum).Maximum
273+
274+
# variable to stor the new amount of hyfens
275+
$Border = '-' * $MaxLength
276+
277+
# foreach loop to iterate and past each event seperate from the hashtable
278+
foreach ($Event in $UsersGroupActivity_HT["AddUserToGroup"]) {
279+
280+
# add space to the right of each event iteration
281+
$Event = $Event.PadRight($MaxLength)
282+
283+
# print start\middle border
284+
Write-Output "+$Border+"
285+
286+
# print each event
287+
Write-Output "|$Event|"
288+
289+
}
290+
291+
# print last border
292+
Write-Output "+$Border+"
167293
}
168294

169295
# print out the remove user from group activity
170296
if ($RemoveUserFromGroup_Count -ge 1) {
171-
Write-Output ""
172-
Write-Output "User Removed From A Group Activity"
173-
Write-Output "+--------------------------------+"
174-
$UsersGroupActivity_HT["RemoveUserFromGroup"]
297+
Write-Output ""
298+
Write-Output "User Removed From A Group Activity - Raw Events"
299+
300+
# variable to cretae the amount of spaces needed for the table
301+
$MaxLength = ($UsersGroupActivity_HT["RemoveUserFromGroup"] | Measure-Object Length -Maximum).Maximum
302+
303+
# variable to stor the new amount of hyfens
304+
$Border = '-' * $MaxLength
305+
306+
# foreach loop to iterate and past each event seperate from the hashtable
307+
foreach ($Event in $UsersGroupActivity_HT["RemoveUserFromGroup"]) {
308+
309+
# add space to the right of each event iteration
310+
$Event = $Event.PadRight($MaxLength)
311+
312+
# print start\middle border
313+
Write-Output "+$Border+"
314+
315+
# print each event
316+
Write-Output "|$Event|"
317+
318+
}
319+
320+
# print last border
321+
Write-Output "+$Border+"
175322
}
176323

177324
# print out the user information change
178325
if ($UserInformationChange_Count -ge 1) {
179326
Write-Output ""
180-
Write-Output "User Information Change"
181-
Write-Output "+---------------------+"
182-
$UsersGroupActivity_HT["UserInformationChange"]
327+
Write-Output "User Information Change - Raw Events"
328+
329+
# variable to cretae the amount of spaces needed for the table
330+
$MaxLength = ($UsersGroupActivity_HT["UserInformationChange"] | Measure-Object Length -Maximum).Maximum
331+
332+
# variable to stor the new amount of hyfens
333+
$Border = '-' * $MaxLength
334+
335+
# foreach loop to iterate and past each event seperate from the hashtable
336+
foreach ($Event in $UsersGroupActivity_HT["UserInformationChange"]) {
337+
338+
# add space to the right of each event iteration
339+
$Event = $Event.PadRight($MaxLength)
340+
341+
# print start\middle border
342+
Write-Output "+$Border+"
343+
344+
# print each event
345+
Write-Output "|$Event|"
346+
347+
}
348+
349+
# print last border
350+
Write-Output "+$Border+"
183351
}
184352

185-
# reset
353+
# reset variables
186354
$useradd_Count = $null
187355
$userdel_Count = $null
188356
$ChangePassword_Count = $null

02-LogModules/Auth.Log/03-Features/06-GeneralActivity.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ $MaxLength = ($GeneralActivity_HT["PowerButton"] | Measure-Object Length -Maximu
3232
$Border = '-' * $MaxLength
3333

3434
foreach ($Event in $GeneralActivity_HT["PowerButton"]) {
35+
36+
# add space to the right of each event iteration
37+
$Event = $Event.PadRight($MaxLength)
3538

3639
Write-Output "+$Border+"
3740
Write-Output "|$Event|"

0 commit comments

Comments
 (0)