Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
12e5f3d
Main (#179)
osmontero Dec 27, 2023
337b860
main (#214)
leonardomoralopez89 Jan 4, 2024
7bb1923
Merge branch 'main' into qa
jdieguez89 Jan 5, 2024
8cb566a
Update agent version and fix agent update based on master version (#2…
Kbayero Jan 5, 2024
a1b5b19
Merge branch 'main' into qa
osmontero Jan 5, 2024
8e71da3
Bugfix/frontend/202 unable to remove groups in the datasources view (…
jdieguez89 Jan 5, 2024
68a7d57
Updating qa (#239)
c3s4rfred Jan 8, 2024
d0572fb
Merge branch 'main' into qa
osmontero Jan 11, 2024
87050a8
Merge branch 'main' into qa
osmontero Jan 11, 2024
f077d50
Fixing issues for 10.2 release (#272) (#273)
osmontero Jan 15, 2024
355a2a8
Preparing v10.2 release (#284)
osmontero Jan 15, 2024
f2b1803
Qa (#286)
osmontero Jan 15, 2024
82df8f7
Qa (#288)
osmontero Jan 15, 2024
97c9b83
remove csp
osmontero Jan 15, 2024
be71431
fixed logout observable emission (#314) (#315)
mjabascal10 Jan 16, 2024
e8f45ff
Fixing overwriting of the properties host and IP of the alert that is…
leonardomoralopez89 Jan 22, 2024
1bb5295
Updating security configuration to fix ROLE_USER disconnection bug (#…
c3s4rfred Jan 22, 2024
35fd977
Fixed Down datasource shows an empty detail in view and error in cons…
mjabascal10 Jan 22, 2024
1e8f1f2
Bugfix/10.3/325 detail view alert crashed disconnected datasource (#332)
mjabascal10 Jan 23, 2024
fb42c6a
Fix error cannot assign requested address (#357)
Kbayero Jan 23, 2024
ffc34be
Bugfix/10.2/333 incorrect linux install command (#361)
mjabascal10 Jan 23, 2024
fede312
Add 10.2.1 to CHANGELOG.md (#367)
jdieguez89 Jan 25, 2024
151cda2
Fixed User management module allows an action that causes UTMStack ha…
mjabascal10 Jan 25, 2024
861ae85
using node1 always
osmontero Jan 25, 2024
2c5d5d5
Updating security access to info endpoint to be used by agent install…
c3s4rfred Jan 26, 2024
91d3164
Bugfix/10.2/359 rc unhandled login error (#374)
mjabascal10 Jan 26, 2024
d03220c
Bugfix/10.2/378 overview dashboard has wrong alert value (#387)
mjabascal10 Jan 29, 2024
f3704de
Fixing rule history filter condition for IRA (#388)
c3s4rfred Jan 30, 2024
8218d3a
Fixed integration disconnected alert coming to often (#313) (#393)
mjabascal10 Feb 1, 2024
b5b18e8
Adding default agent for incident rules (#397)
c3s4rfred Feb 1, 2024
72e21f4
Fixed 217 Log-explorer-query-crashed-when-type-something (#398)
mjabascal10 Feb 2, 2024
656b505
Fixed Incident-response-automation-must-allow-to-run-in-default-agent…
mjabascal10 Feb 5, 2024
1ad4d0c
Fixed Incident-response-trigger-select-cause-modal-scroll (#402) (#412)
mjabascal10 Feb 5, 2024
563a285
Adding incident variables
jdieguez89 Feb 5, 2024
e35dfc0
Bugfix/10.2/402 incident response trigger select cause modal scroll (…
mjabascal10 Feb 5, 2024
9c2e47e
Merge remote-tracking branch 'origin/rc' into feature/v10.x/secret-ma…
jdieguez89 Feb 5, 2024
2242ad4
Adding frontend to variable management
jdieguez89 Feb 5, 2024
0fece58
hidden secrets in command history, move variables to sidebar menu, de…
jdieguez89 Feb 6, 2024
fa7b0b3
format code UTMIncidentCommandWebsocket.java
jdieguez89 Feb 6, 2024
3be3654
Merge branch 'main' into feature/v10.x/secret-management
jdieguez89 Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion agent-manager/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"log"
"regexp"
"time"

"github.com/utmstack/UTMStack/agent-manager/config"
Expand Down Expand Up @@ -101,6 +102,19 @@ func (s *Grpc) AgentStream(stream AgentService_AgentStreamServer) error {
}
}

func (s *Grpc) replaceSecretValues(input string) string {
pattern := regexp.MustCompile(`\$\[(\w+):([^\]]+)\]`)
return pattern.ReplaceAllStringFunc(input, func(match string) string {
matches := pattern.FindStringSubmatch(match)
if len(matches) < 3 {
return match // In case of no match, return the original
}
encryptedValue := matches[2]
decryptedValue, _ := util.DecryptValue(encryptedValue)
return decryptedValue
})
}

func (s *Grpc) ProcessCommand(stream PanelService_ProcessCommandServer) error {
for {
cmd, err := stream.Recv()
Expand Down Expand Up @@ -144,7 +158,7 @@ func (s *Grpc) ProcessCommand(stream PanelService_ProcessCommandServer) error {
StreamMessage: &BidirectionalStream_Command{
Command: &UtmCommand{
AgentKey: cmd.AgentKey,
Command: cmd.Command,
Command: s.replaceSecretValues(cmd.Command),
CmdId: cmdID,
InternalKey: config.GetInternalKey(),
},
Expand Down
1 change: 1 addition & 0 deletions agent-manager/config/global_const.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func ConnectionKeyRoutes() []string {

const PanelConnectionKeyUrl = "%s/api/authenticateFederationServiceManager"
const UTMSharedKeyEnv = "INTERNAL_KEY"
const UTMEncryptionKeyEnv = "ENCRYPTION_KEY"
const UTMHostEnv = "UTM_HOST"

func GetInternalKey() string {
Expand Down
2 changes: 1 addition & 1 deletion agent-manager/util/aes.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var (
passphrase = os.Getenv(config.UTMSharedKeyEnv)
passphrase = os.Getenv(config.UTMEncryptionKeyEnv)
)

func EncryptDecryptConfValues(conf *models.AgentModuleConfiguration, action string) *models.AgentModuleConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public SecurityConfiguration(AuthenticationManagerBuilder authenticationManagerB
public void init() {
try {
authenticationManagerBuilder
.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoder());
.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoder());
} catch (Exception e) {
throw new BeanInitializationException("Security configuration failed", e);
}
Expand All @@ -76,51 +76,53 @@ public PasswordEncoder passwordEncoder() {
@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return web -> web.ignoring()
.antMatchers(HttpMethod.OPTIONS, "/**")
.antMatchers("/swagger-ui/**")
.antMatchers("/i18n/**");
.antMatchers(HttpMethod.OPTIONS, "/**")
.antMatchers("/swagger-ui/**")
.antMatchers("/i18n/**");
}

@Override
public void configure(HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class)
.exceptionHandling()
.authenticationEntryPoint((request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED))
.accessDeniedHandler((request, response, accessDeniedException) -> response.sendError(HttpServletResponse.SC_FORBIDDEN))
.and()
.headers()
.frameOptions()
.disable()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/api/authenticate").permitAll()
.antMatchers("/api/authenticateFederationServiceManager").permitAll()
.antMatchers("/api/ping").permitAll()
.antMatchers("/api/date-format").permitAll()
.antMatchers("/api/healthcheck").permitAll()
.antMatchers("/api/releaseInfo").permitAll()
.antMatchers("/api/account/reset-password/init").permitAll()
.antMatchers("/api/account/reset-password/finish").permitAll()
.antMatchers("/api/images/all").permitAll()
.antMatchers("/api/tfa/verifyCode").hasAuthority(AuthoritiesConstants.PRE_VERIFICATION_USER)
.antMatchers("/api/utm-incident-jobs").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/api/utm-incident-jobs/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/api/custom-reports/**").denyAll()
.antMatchers("/api/**").hasAnyAuthority(AuthoritiesConstants.ADMIN, AuthoritiesConstants.USER)
.antMatchers("/ws/topic").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/ws/**").permitAll()
.antMatchers("/management/info").permitAll()
.antMatchers("/management/**").hasAnyAuthority(AuthoritiesConstants.ADMIN, AuthoritiesConstants.USER)
.and()
.apply(securityConfigurerAdapterForJwt())
.and()
.apply(securityConfigurerAdapterForInternalApiKey());
.csrf()
.disable()
.addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class)
.exceptionHandling()
.authenticationEntryPoint((request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED))
.accessDeniedHandler((request, response, accessDeniedException) -> response.sendError(HttpServletResponse.SC_FORBIDDEN))
.and()
.headers()
.frameOptions()
.disable()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/api/authenticate").permitAll()
.antMatchers("/api/authenticateFederationServiceManager").permitAll()
.antMatchers("/api/ping").permitAll()
.antMatchers("/api/date-format").permitAll()
.antMatchers("/api/healthcheck").permitAll()
.antMatchers("/api/releaseInfo").permitAll()
.antMatchers("/api/account/reset-password/init").permitAll()
.antMatchers("/api/account/reset-password/finish").permitAll()
.antMatchers("/api/images/all").permitAll()
.antMatchers("/api/tfa/verifyCode").hasAuthority(AuthoritiesConstants.PRE_VERIFICATION_USER)
.antMatchers("/api/utm-incident-jobs").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/api/utm-incident-jobs/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/api/utm-incident-variables/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers(HttpMethod.GET, "/api/utm-incident-variables").hasAnyAuthority()
.antMatchers("/api/custom-reports/**").denyAll()
.antMatchers("/api/**").hasAnyAuthority(AuthoritiesConstants.ADMIN, AuthoritiesConstants.USER)
.antMatchers("/ws/topic").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/ws/**").permitAll()
.antMatchers("/management/info").permitAll()
.antMatchers("/management/**").hasAnyAuthority(AuthoritiesConstants.ADMIN, AuthoritiesConstants.USER)
.and()
.apply(securityConfigurerAdapterForJwt())
.and()
.apply(securityConfigurerAdapterForInternalApiKey());

}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package com.park.utmstack.domain.incident_response;


import javax.persistence.*;
import java.io.Serializable;
import java.time.Instant;

/**
* A UtmIncidentVariable.
*/
@Entity
@Table(name = "utm_incident_variables")
public class UtmIncidentVariable implements Serializable {

private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name = "variable_name")
private String variableName;

@Column(name = "variable_value")
private String variableValue;

@Column(name = "variable_description")
private String variableDescription;

@Column(name = "is_secret")
private boolean isSecret;

@Column(name = "created_by")
private String createdBy;

@Column(name = "last_modified_date")
private Instant lastModifiedDate;

@Column(name = "last_modified_by")
private String lastModifiedBy;


public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getVariableName() {
return variableName;
}

public void setVariableName(String variableName) {
this.variableName = variableName;
}

public String getVariableValue() {
return variableValue;
}

public void setVariableValue(String variableValue) {
this.variableValue = variableValue;
}

public boolean isSecret() {
return isSecret;
}

public void setSecret(boolean secret) {
isSecret = secret;
}

public String getCreatedBy() {
return createdBy;
}

public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}

public Instant getLastModifiedDate() {
return lastModifiedDate;
}

public void setLastModifiedDate(Instant lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}

public String getLastModifiedBy() {
return lastModifiedBy;
}

public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}

public String getVariableDescription() {
return variableDescription;
}

public void setVariableDescription(String variableDescription) {
this.variableDescription = variableDescription;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.park.utmstack.repository.incident_response;

import com.park.utmstack.domain.incident_response.UtmIncidentAction;
import com.park.utmstack.domain.incident_response.UtmIncidentVariable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;


/**
* Spring Data repository for the UtmIncidentAction entity.
*/
@SuppressWarnings("unused")
@Repository
public interface UtmIncidentVariableRepository extends JpaRepository<UtmIncidentVariable, Long>, JpaSpecificationExecutor<UtmIncidentVariable> {

Optional<UtmIncidentVariable> findByVariableName(String variable);

List<UtmIncidentVariable> findAllByVariableNameIn(List<String> variables);
}
Loading