Skip to content

Commit 4448a1e

Browse files
authored
Merge pull request #140 from djoreilly/remove-sha1
Remove SHA1 file signatures
2 parents 99496a1 + 403f12d commit 4448a1e

8 files changed

Lines changed: 16 additions & 25 deletions

File tree

artifacts/definitions/Linux/Events/ProcessExecutions.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ sources:
3030
WHERE "vrr_procmon" in Tags AND Result = 'success'
3131
3232
LET hash_log = SELECT *,
33-
hash(path=Exe, hashselect=['SHA1', 'SHA256']) AS hashes
33+
hash(path=Exe, hashselect=['SHA256']) AS hashes
3434
FROM exec_log
3535
3636
// Cache Uid -> Username mapping.
@@ -42,7 +42,6 @@ sources:
4242
{ SELECT User from users WHERE Uid = UserId} AS User,
4343
CmdLine,
4444
Exe, CWD,
45-
hashes.SHA1 AS SHA1,
4645
hashes.SHA256 AS SHA256
4746
FROM hash_log
4847
@@ -58,7 +57,7 @@ sources:
5857
LET exec_log = SELECT * FROM execsnoop()
5958
6059
LET hash_log = SELECT *,
61-
hash(path=Exe, hashselect=['SHA1', 'SHA256']) AS hashes
60+
hash(path=Exe, hashselect=['SHA256']) AS hashes
6261
FROM exec_log
6362
6463
// Cache Uid -> Username mapping.
@@ -70,6 +69,5 @@ sources:
7069
Argv AS CmdLine,
7170
Exe,
7271
Cwd AS CWD,
73-
hashes.SHA1 AS SHA1,
7472
hashes.SHA256 AS SHA256
7573
FROM hash_log

artifacts/definitions/SUSE/Linux/Events/ExecutableFiles.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sources:
4444
4545
LET hash_log = SELECT Time, UserId,
4646
State, FileName, FilePath,
47-
hash(path=FilePath, hashselect=["SHA1", "SHA256"]) AS hashes
47+
hash(path=FilePath, hashselect=["SHA256"]) AS hashes
4848
FROM exec_bit_log
4949
WHERE FilePath =~ directories_regex
5050
@@ -57,6 +57,5 @@ sources:
5757
SELECT Time, UserId,
5858
get(item=uids_to_names, field=UserId).User AS User,
5959
State, FileName, FilePath,
60-
hashes.SHA256 AS SHA256,
61-
hashes.SHA1 AS SHA1
60+
hashes.SHA256 AS SHA256
6261
FROM hash_log

artifacts/definitions/SUSE/Linux/Events/ImmutableFile.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ sources:
1111
- query: |
1212
LET events = SELECT
1313
*,
14-
hash(path=Path, hashselect=["SHA1", "SHA256"]) as hashes
14+
hash(path=Path, hashselect=["SHA256"]) as hashes
1515
FROM chattrsnoop()
1616
1717
SELECT
1818
Timestamp,
1919
Path,
2020
Dir,
2121
Action,
22-
hashes.SHA256 AS SHA256,
23-
hashes.SHA1 AS SHA1
22+
hashes.SHA256 AS SHA256
2423
FROM events

artifacts/definitions/SUSE/Linux/Events/NewFiles.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ sources:
3030
LET hash_log = SELECT Time, UserId,
3131
{ SELECT User from usrs WHERE Uid = UserId} AS User,
3232
State, FileName, FilePath,
33-
hash(path=FilePath, hashselect=['SHA1', 'SHA256']) AS Hash
33+
hash(path=FilePath, hashselect=['SHA256']) AS Hash
3434
FROM new_file_log
3535
3636
// Enrich the original artifact with more data.
3737
SELECT Time, UserId, User,
3838
State, FileName, FilePath,
39-
Hash.SHA256 AS Hash_SHA256, Hash.SHA1 AS Hash_SHA1
39+
Hash.SHA256 AS SHA256
4040
FROM hash_log

artifacts/definitions/SUSE/Linux/Events/NewFilesNoOwner.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ sources:
106106
AND NOT get(item=known_uids, field=UserID)
107107
108108
LET fchown_events_with_hashes = SELECT *,
109-
hash(path=FullPath, hashselect=['SHA1', 'SHA256']) AS hashes
109+
hash(path=FullPath, hashselect=['SHA256']) AS hashes
110110
FROM fchown_events
111111
112112
LET fchownat_events = SELECT
@@ -121,7 +121,7 @@ sources:
121121
AND NOT get(item=known_uids, field=UserID)
122122
123123
LET fchownat_events_with_hashes = SELECT *,
124-
hash(path=FullPath, hashselect=['SHA1', 'SHA256']) AS hashes
124+
hash(path=FullPath, hashselect=['SHA256']) AS hashes
125125
FROM fchownat_events
126126
127127
SELECT * FROM chain(
@@ -136,15 +136,13 @@ sources:
136136
SELECT
137137
FullPath,
138138
UserID,
139-
hashes.SHA1 AS SHA1,
140139
hashes.SHA256 AS SHA256
141140
FROM fchown_events_with_hashes
142141
},
143142
d={
144143
SELECT
145144
FullPath,
146145
UserID,
147-
hashes.SHA1 AS SHA1,
148146
hashes.SHA256 AS SHA256
149147
FROM fchownat_events_with_hashes
150148
}

artifacts/definitions/SUSE/Linux/Events/NewHiddenFile.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,15 @@ sources:
5252
LET new_hidden_files_with_hashes = SELECT *,
5353
{ SELECT * FROM if(
5454
condition=action="opened-file",
55-
then={ SELECT hash(path=Path, hashselect=['SHA1', 'SHA256']) FROM scope() },
56-
else={ SELECT dict(SHA1=null, SHA256=null) FROM scope() })
55+
then={ SELECT hash(path=Path, hashselect=['SHA256']) FROM scope() },
56+
else={ SELECT dict(SHA256=null) FROM scope() })
5757
} AS hashes
5858
FROM hidden_files_events
5959
6060
SELECT
6161
Time,
6262
Filename,
6363
Path,
64-
hashes.SHA1 AS SHA1,
6564
hashes.SHA256 AS SHA256
6665
FROM new_hidden_files_with_hashes
6766

artifacts/definitions/SUSE/Linux/Events/NewZeroSizeLogFile.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ sources:
4040
4141
LET zero_size_files_with_hashes = SELECT
4242
*,
43-
hash(path=FilePath, hashselect=["SHA1", "SHA256"]) AS hashes
43+
hash(path=FilePath, hashselect=["SHA256"]) AS hashes
4444
FROM zero_size_files
4545
4646
SELECT
4747
Time,
4848
Sequence,
4949
FileName,
5050
FilePath,
51-
hashes.SHA1 AS SHA1,
5251
hashes.SHA256 AS SHA256
5352
FROM zero_size_files_with_hashes
5453

artifacts/definitions/SUSE/Linux/Events/ProcessStatuses.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sources:
4141
SELECT Time, Pid, Ppid, UserId,
4242
{ SELECT User from usrs WHERE Uid = UserId} AS User,
4343
State,CmdLine,
44-
CWD, Exe AS ImagePath, Hash.SHA256 AS Hash_Sha256, Hash.SHA1 AS Hash_Sha1
44+
CWD, Exe AS ImagePath, Hash.SHA256 AS SHA256
4545
FROM proc_exec_log
4646
4747
@@ -57,7 +57,7 @@ sources:
5757
LET exec_log = SELECT * FROM execsnoop() WHERE Uid != 0
5858
5959
LET hash_log = SELECT *,
60-
hash(path=Exe, hashselect=['SHA1', 'SHA256']) AS hashes
60+
hash(path=Exe, hashselect=['SHA256']) AS hashes
6161
FROM exec_log
6262
6363
// Cache Uid -> Username mapping.
@@ -71,6 +71,5 @@ sources:
7171
Argv AS CmdLine,
7272
Cwd AS CWD,
7373
Exe AS ImagePath,
74-
hashes.SHA256 AS Hash_Sha256,
75-
hashes.SHA1 AS Hash_Sha1
74+
hashes.SHA256 AS SHA256
7675
FROM hash_log

0 commit comments

Comments
 (0)