Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
MalwareResultBean.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2023 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package com.basistech.df.cybertriage.autopsy.ctapi.json;
20
21import com.basistech.df.cybertriage.autopsy.ctapi.util.ObjectMapperUtil.ZonedDateTimeDeserializer;
22import com.fasterxml.jackson.annotation.JsonIgnore;
23import com.fasterxml.jackson.annotation.JsonProperty;
24import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
25import java.time.ZonedDateTime;
26import java.util.List;
27import javax.annotation.Nonnull;
28import javax.annotation.Nullable;
29
34public class MalwareResultBean {
35
43
44 @Nullable
45 @JsonProperty("malware_description")
46 private String malwareDescription;
47
48 @Nonnull
49 @JsonProperty("status")
50 private Status status;
51
52 @Nonnull
53 @JsonProperty("score")
54 private String score;
55
57
58 @Nullable
59 @JsonProperty("first_scan_date")
60 @JsonDeserialize(using = ZonedDateTimeDeserializer.class)
61 private ZonedDateTime firstAnalyzedDate;
62
63 @Nullable
64 @JsonProperty("last_scan_date")
65 @JsonDeserialize(using = ZonedDateTimeDeserializer.class)
66 private ZonedDateTime lastAnalyzedDate;
67
68 @JsonProperty("metadata")
69 private List<MetadataLabel> metadata;
70
71 @Nullable
72 @JsonProperty("status_description")
73 private String statusDescription;
74
75
76 @Nullable
77 @JsonProperty
78 private List<CTCloudCostBean> cost;
79
80 @JsonIgnore
82 return ctScore;
83 }
84
85 public String getScore() {
86 return score;
87 }
88
89 public ZonedDateTime getFirstAnalyzedDate() {
90 return firstAnalyzedDate;
91 }
92
93 public ZonedDateTime getLastAnalyzedDate() {
94 return lastAnalyzedDate;
95 }
96
97 public List<MetadataLabel> getMetadata() {
98 if (metadata != null) {
99 return List.copyOf(metadata);
100 } else {
101 return List.of(); // empty list
102 }
103 }
104
105 public Status getStatus() {
106 return status;
107 }
108
109 public String getStatusDescription() {
110 return statusDescription;
111 }
112
113
114 public String getMalwareDescription() {
115 return malwareDescription;
116 }
117
119 this.malwareDescription = malwareDescription;
120 }
121
122 public void setStatus(Status status) {
123 this.status = status;
124 }
125
126 public void setScore(String score) {
127 this.score = score;
128 switch(score) {
129 case "GOOD_HIGH":
130 this.ctScore = CTScore.NONE;
131 break;
132 case "GOOD_MEDIUM":
133 this.ctScore = CTScore.LIKELY_NONE;
134 break;
135 case "BAD_HIGH":
136 this.ctScore = CTScore.NOTABLE;
137 break;
138 case "BAD_MEDIUM":
139 this.ctScore = CTScore.LIKELY_NOTABLE;
140 break;
141 default:
142 this.ctScore = CTScore.UNKNOWN;
143 break;
144 }
145 }
146
147 public void setFirstAnalyzedDate(ZonedDateTime firstAnalyzedDate) {
148 this.firstAnalyzedDate = firstAnalyzedDate;
149 }
150
151 public void setLastAnalyzedDate(ZonedDateTime lastAnalyzedDate) {
152 this.lastAnalyzedDate = lastAnalyzedDate;
153 }
154
155 public void setMetadata(List<MetadataLabel> metadata) {
156 this.metadata = List.copyOf(metadata);
157 }
158
160 this.statusDescription = statusDescription;
161 }
162
163 public List<CTCloudCostBean> getCost() {
164 return List.copyOf(cost);
165 }
166
167 public void setCost(List<CTCloudCostBean> cost) {
168 this.cost = List.copyOf(cost);
169 }
170}

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.