You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If we flagged the file as invalid we return the same scan status value AWS Guard Duty offers to avoid breaking Data Retrieval API service integration
// File size is too small to test and contains no content that can be of value to the end user
100
106
return{
101
107
...item,
102
-
scanStatus: "THREATS_FOUND",
108
+
scanStatus: scanStatus,
103
109
};
110
+
}catch(error){
111
+
switch((errorasError).constructor){
112
+
caseFileSizeUnder100BytesException:
113
+
console.warn(
114
+
JSON.stringify({
115
+
level: "warn",
116
+
msg: `Will not try to validate file as its size is under 100 bytes and probably contains no content that can be of value to the end user. Flagging ${item.attachmentPath} as potentially malicious.`,
117
+
})
118
+
);
119
+
120
+
return{
121
+
...item,
122
+
scanStatus: "THREATS_FOUND",
123
+
};
124
+
default: {
125
+
thrownewError(`Failed to verify submission attachment ${item.attachmentPath}`);
// If we flagged the file as invalid we return the same scan status value AWS Guard Duty offers to avoid breaking Data Retrieval API service integration
0 commit comments