Skip to content

Commit 0ac9a0c

Browse files
authored
Merge pull request #1102 from utmstack/bugfix/10.7.1/add-organization-name-settings
Bugfix/10.7.1/add organization name settings
2 parents 385b4b3 + 8cf44c7 commit 0ac9a0c

File tree

17 files changed

+906
-47
lines changed

17 files changed

+906
-47
lines changed

CHANGELOG.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
# UTMStack 10.7.0 Release Notes
2-
## New Features and Improvements
3-
- **Agent & Collector Dependencies**: agents and collectors now fetch their dependencies from the **agent-manager**, improving consistency and centralizing dependency management.
4-
5-
- **Agent Installation**: improved the installation messages for the agent to provide clearer instructions during the setup process.
6-
7-
- **Agent Service Cleanup**: removed unnecessary services to streamline the system and reduce overhead.
1+
# UTMStack 10.7.1 Release Notes
82

9-
- **Error Recovery**: enhanced the agent's ability to recover from certain data streaming errors when interacting with the agent-manager, improving stability and fault tolerance.
3+
### Bug Fixes
4+
- Fixed responsive text alignment for action buttons in Log Explorer to enhance visual consistency.
105

11-
- **Debug Mode for Agents**: Added a debug mode for agents, allowing better troubleshooting and logging for debugging purposes.
12-
13-
- **Certificate Verification Improvements**: Improved certificate verification in agents to enhance security and prevent connection issues.
14-
15-
- **Windows ARM64 Agent Support**: Added support for a Windows ARM64 agent, expanding compatibility to more architectures.
6+
## New Features and Improvements
7+
- Added organization name in app settings to distinguish alert and notification emails for better clarity.
8+
- Enhanced the email notification system by including the organization name to improve recipient identification.
9+
- Introduced new compliance reports aligned with the PCI DSS standard to expand auditing capabilities.
10+
- Resolves issues with malformed queries when filtering incidents by id.

backend/src/main/java/com/park/utmstack/config/Constants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public final class Constants {
1818
public static final String PROP_MAIL_PORT = "utmstack.mail.port";
1919
public static final String PROP_MAIL_PASSWORD = "utmstack.mail.password";
2020
public static final String PROP_MAIL_USERNAME = "utmstack.mail.username";
21+
public static final String PROP_MAIL_ORGNAME = "utmstack.mail.organization";
2122
public static final String PROP_MAIL_SMTP_AUTH = "utmstack.mail.properties.mail.smtp.auth";
2223

2324
public static final String PROP_EMAIL_PROTOCOL_VALUE = "smtp";

backend/src/main/java/com/park/utmstack/service/MailService.java

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.springframework.scheduling.annotation.Async;
2525
import org.springframework.stereotype.Service;
2626
import org.springframework.util.CollectionUtils;
27-
import org.springframework.util.StringUtils;
2827
import org.thymeleaf.context.Context;
2928
import org.thymeleaf.extras.java8time.dialect.Java8TimeDialect;
3029
import org.thymeleaf.spring5.SpringTemplateEngine;
@@ -62,6 +61,8 @@ public class MailService {
6261

6362
private static final String BASE_URL = "baseUrl";
6463

64+
private static final String ORG_NAME = "orgName";
65+
6566
private final MessageSource messageSource;
6667
private final SpringTemplateEngine templateEngine;
6768
private final ApplicationEventService eventService;
@@ -79,22 +80,6 @@ public MailService(MessageSource messageSource,
7980
this.templateEngine.addDialect(new Java8TimeDialect());
8081
}
8182

82-
// private JavaMailSender getJavaMailSender() {
83-
// JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
84-
// mailSender.setHost(Constants.CFG.get(Constants.PROP_MAIL_HOST));
85-
// mailSender.setPort(Integer.parseInt(Constants.CFG.get(Constants.PROP_MAIL_PORT)));
86-
// mailSender.setPassword(Constants.CFG.get(Constants.PROP_MAIL_PASSWORD));
87-
// mailSender.setUsername(Constants.CFG.get(Constants.PROP_MAIL_USERNAME));
88-
// mailSender.setProtocol(Constants.CFG.get(Constants.PROP_MAIL_PROTOCOL));
89-
//
90-
// Properties props = mailSender.getJavaMailProperties();
91-
// props.put("mail.smtp.auth", Constants.CFG.get(Constants.PROP_MAIL_SMTP_AUTH));
92-
// props.put("mail.smtp.starttls.enable", Constants.CFG.get(Constants.PROP_MAIL_SMTP_STARTTLS_ENABLE));
93-
// props.put("mail.smtp.ssl.trust", Constants.CFG.get(Constants.PROP_MAIL_SMTP_SSL_TRUST));
94-
//
95-
// return mailSender;
96-
// }
97-
9883
private MailSenderStrategy getSender(String type){
9984
return mailSenders.stream()
10085
.filter(s -> s.getEncryptionType().equals(type))
@@ -277,11 +262,12 @@ public void sendAlertEmail(List<String> emailsTo, AlertType alert, List<LogType>
277262
context.setVariable("relatedLogs", relatedLogs);
278263
context.setVariable("timestamp", alert.getTimestampFormatted());
279264
context.setVariable(BASE_URL, Constants.CFG.get(Constants.PROP_MAIL_BASE_URL));
265+
context.setVariable(ORG_NAME, Constants.CFG.get(Constants.PROP_MAIL_ORGNAME));
280266

281267
final MimeMessage mimeMessage = javaMailSender.createMimeMessage();
282268
final MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8");
283269
message.setSubject(String.format("%1$s[%2$s]: %3$s", alert.getIncident() ? "INFOSEC-" : "", alert.getId().substring(0, 5), alert.getName()));
284-
message.setFrom(Constants.CFG.get(Constants.PROP_MAIL_FROM));
270+
message.setFrom(new InternetAddress(Constants.CFG.get(Constants.PROP_MAIL_FROM), Constants.CFG.get(Constants.PROP_MAIL_ORGNAME)));
285271
message.setTo(emailsTo.toArray(new String[0]));
286272

287273
final String htmlContent = templateEngine.process("mail/alertEmail", context);
@@ -314,9 +300,12 @@ public void sendIncidentEmail(List<String> emailsTo, List<AlertType> alerts, Utm
314300
context.setVariable("alerts", alerts);
315301
context.setVariable("incident", incident);
316302
context.setVariable(BASE_URL, Constants.CFG.get(Constants.PROP_MAIL_BASE_URL));
303+
context.setVariable(ORG_NAME, Constants.CFG.get(Constants.PROP_MAIL_ORGNAME));
304+
317305
final MimeMessage mimeMessage = javaMailSender.createMimeMessage();
318306
final MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8");
319307
message.setSubject(String.format("%1$s[%2$s]: %3$s", "INFOSEC- New Incident ", incident.getId().toString(), incident.getIncidentName()));
308+
message.setFrom(new InternetAddress(Constants.CFG.get(Constants.PROP_MAIL_FROM), Constants.CFG.get(Constants.PROP_MAIL_ORGNAME)));
320309
message.setFrom(Constants.CFG.get(Constants.PROP_MAIL_FROM));
321310
message.setTo(emailsTo.toArray(new String[0]));
322311

backend/src/main/java/com/park/utmstack/service/incident/UtmIncidentQueryService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private Specification<UtmIncident> createSpecification(UtmIncidentCriteria crite
112112
Specification<UtmIncident> specification = Specification.where(null);
113113
if (criteria != null) {
114114
if (criteria.getId() != null) {
115-
specification = specification.and(buildSpecification(criteria.getId(), UtmIncident_.id));
115+
specification = specification.and(buildRangeSpecification(criteria.getId(), UtmIncident_.id));
116116
}
117117
if (criteria.getIncidentName() != null) {
118118
specification = specification.and(buildStringSpecification(criteria.getIncidentName(), UtmIncident_.incidentName));

backend/src/main/java/com/park/utmstack/service/mail_config/MailConfigService.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
import com.park.utmstack.domain.mail_sender.MailConfig;
66
import org.springframework.stereotype.Service;
77

8+
import javax.mail.internet.InternetAddress;
9+
import java.io.UnsupportedEncodingException;
810
import java.util.List;
911

1012
@Service
1113
public class MailConfigService {
12-
public MailConfig getMailConfigFromParameters(List<UtmConfigurationParameter> parameters){
14+
public MailConfig getMailConfigFromParameters(List<UtmConfigurationParameter> parameters) throws UnsupportedEncodingException {
1315
MailConfig mailConfig = new MailConfig();
1416

1517
mailConfig.setHost(getParamValue(parameters, Constants.PROP_MAIL_HOST));
1618
mailConfig.setUsername(getParamValue(parameters, Constants.PROP_MAIL_USERNAME));
1719
mailConfig.setPassword(getParamValue(parameters, Constants.PROP_MAIL_PASSWORD));
1820
mailConfig.setAuthType(getParamValue(parameters, Constants.PROP_MAIL_SMTP_AUTH));
19-
mailConfig.setFrom(getParamValue(parameters, Constants.PROP_MAIL_FROM));
21+
mailConfig.setFrom(String.valueOf(new InternetAddress(Constants.CFG.get(Constants.PROP_MAIL_FROM), getParamValue(parameters, Constants.PROP_MAIL_ORGNAME))));
2022
mailConfig.setPort(Integer.parseInt(getParamValue(parameters, Constants.PROP_MAIL_PORT)));
2123

2224
return mailConfig;
@@ -26,7 +28,7 @@ public String getParamValue(List<UtmConfigurationParameter> parameters, String s
2628
return parameters.stream()
2729
.filter(p -> p.getConfParamShort().equals(shortName))
2830
.findFirst()
29-
. map(UtmConfigurationParameter::getConfParamValue)
31+
.map(UtmConfigurationParameter::getConfParamValue)
3032
.orElse(Constants.CFG.get(shortName));
3133
}
3234
}

0 commit comments

Comments
 (0)