diff --git a/admin/src/main/scala/com/neu/api/group/GroupApi.scala b/admin/src/main/scala/com/neu/api/group/GroupApi.scala
index 79ecc9a4d..a5ee6c47a 100644
--- a/admin/src/main/scala/com/neu/api/group/GroupApi.scala
+++ b/admin/src/main/scala/com/neu/api/group/GroupApi.scala
@@ -212,9 +212,9 @@ class GroupApi(resourceService: GroupService) extends BaseApi {
}
} ~
get {
- parameter(Symbol("name").?) { name =>
+ parameter(Symbol("name").?, Symbol("scope").?) { (name, scope) =>
Utils.respondWithWebServerHeaders() {
- resourceService.getDlpSensor(tokenId, name)
+ resourceService.getDlpSensor(tokenId, name, scope)
}
}
} ~
@@ -285,9 +285,9 @@ class GroupApi(resourceService: GroupService) extends BaseApi {
}
} ~
get {
- parameter(Symbol("name").?) { name =>
+ parameter(Symbol("name").?, Symbol("scope").?) { (name, scope) =>
Utils.respondWithWebServerHeaders() {
- resourceService.getWafSensor(tokenId, name)
+ resourceService.getWafSensor(tokenId, name, scope)
}
}
} ~
diff --git a/admin/src/main/scala/com/neu/model/DlpJsonProtocol.scala b/admin/src/main/scala/com/neu/model/DlpJsonProtocol.scala
index b1eb9ba3e..d4df70cb6 100644
--- a/admin/src/main/scala/com/neu/model/DlpJsonProtocol.scala
+++ b/admin/src/main/scala/com/neu/model/DlpJsonProtocol.scala
@@ -21,7 +21,7 @@ object DlpJsonProtocol extends DefaultJsonProtocol {
given dlpSensorFmt: RootJsonFormat[DlpSensor] = jsonFormat4(DlpSensor.apply)
given dlpSensorDataFmt: RootJsonFormat[DlpSensorData] = jsonFormat1(DlpSensorData.apply)
given dlpSensorsDataFmt: RootJsonFormat[DlpSensorsData] = jsonFormat1(DlpSensorsData.apply)
- given dlpSensorConfigFmt: RootJsonFormat[DlpSensorConfig] = jsonFormat7(DlpSensorConfig.apply)
+ given dlpSensorConfigFmt: RootJsonFormat[DlpSensorConfig] = jsonFormat8(DlpSensorConfig.apply)
given dlpSensorConfigDataFmt: RootJsonFormat[DlpSensorConfigData] = jsonFormat1(
DlpSensorConfigData.apply
)
diff --git a/admin/src/main/scala/com/neu/model/DlpRule.scala b/admin/src/main/scala/com/neu/model/DlpRule.scala
index 3d60c4f59..fb3c6482a 100644
--- a/admin/src/main/scala/com/neu/model/DlpRule.scala
+++ b/admin/src/main/scala/com/neu/model/DlpRule.scala
@@ -47,6 +47,7 @@ case class DlpSensorsData(sensors: Seq[DlpSensor])
case class DlpSensorConfig(
name: String,
comment: Option[String],
+ cfg_type: Option[String],
change: Option[Seq[DlpRule]],
delete: Option[Seq[DlpRule]],
rules: Option[Seq[DlpRule]],
diff --git a/admin/src/main/scala/com/neu/model/Group.scala b/admin/src/main/scala/com/neu/model/Group.scala
index eeed260c0..4f9a5f195 100644
--- a/admin/src/main/scala/com/neu/model/Group.scala
+++ b/admin/src/main/scala/com/neu/model/Group.scala
@@ -142,6 +142,7 @@ case class Groups4Export(
groups: Array[String],
policy_mode: Option[String],
profile_mode: Option[String],
+ use_name_referral: Boolean,
remote_export_options: Option[RemoteExportOptions] = None
)
diff --git a/admin/src/main/scala/com/neu/model/GroupJsonProtocol.scala b/admin/src/main/scala/com/neu/model/GroupJsonProtocol.scala
index c56935231..76fb61e56 100644
--- a/admin/src/main/scala/com/neu/model/GroupJsonProtocol.scala
+++ b/admin/src/main/scala/com/neu/model/GroupJsonProtocol.scala
@@ -45,7 +45,7 @@ object GroupJsonProtocol extends DefaultJsonProtocol {
given remoteExportOptionsFormat: RootJsonFormat[RemoteExportOptions] = jsonFormat3(
RemoteExportOptions.apply
)
- given groups4ExportFormat: RootJsonFormat[Groups4Export] = jsonFormat4(Groups4Export.apply)
+ given groups4ExportFormat: RootJsonFormat[Groups4Export] = jsonFormat5(Groups4Export.apply)
given criteriaItemFormat: RootJsonFormat[CriteriaItem] = jsonFormat1(CriteriaItem.apply)
given groupConfigDTOFormat: RootJsonFormat[GroupConfigDTO] = jsonFormat8(GroupConfigDTO.apply)
diff --git a/admin/src/main/scala/com/neu/model/WafJsonProtocol.scala b/admin/src/main/scala/com/neu/model/WafJsonProtocol.scala
index a161d05cd..892d30c6f 100644
--- a/admin/src/main/scala/com/neu/model/WafJsonProtocol.scala
+++ b/admin/src/main/scala/com/neu/model/WafJsonProtocol.scala
@@ -20,7 +20,7 @@ object WafJsonProtocol extends DefaultJsonProtocol {
given wafSensorFmt: RootJsonFormat[WafSensor] = jsonFormat4(WafSensor.apply)
given wafSensorDataFmt: RootJsonFormat[WafSensorData] = jsonFormat1(WafSensorData.apply)
given wafSensorsDataFmt: RootJsonFormat[WafSensorsData] = jsonFormat1(WafSensorsData.apply)
- given wafSensorConfigFmt: RootJsonFormat[WafSensorConfig] = jsonFormat5(WafSensorConfig.apply)
+ given wafSensorConfigFmt: RootJsonFormat[WafSensorConfig] = jsonFormat6(WafSensorConfig.apply)
given wafSensorConfigDataFmt: RootJsonFormat[WafSensorConfigData] = jsonFormat1(
WafSensorConfigData.apply
)
diff --git a/admin/src/main/scala/com/neu/model/WafRule.scala b/admin/src/main/scala/com/neu/model/WafRule.scala
index b795b2e7a..9d64bdfd8 100644
--- a/admin/src/main/scala/com/neu/model/WafRule.scala
+++ b/admin/src/main/scala/com/neu/model/WafRule.scala
@@ -35,6 +35,7 @@ case class WafSensorsData(sensors: Seq[WafSensor])
case class WafSensorConfig(
name: String,
comment: Option[String],
+ cfg_type: Option[String],
change: Option[Seq[WafRule]],
delete: Option[Seq[WafRule]],
rules: Option[Seq[WafRule]]
diff --git a/admin/src/main/scala/com/neu/service/group/GroupService.scala b/admin/src/main/scala/com/neu/service/group/GroupService.scala
index 3a6cb3881..5cb083dfa 100644
--- a/admin/src/main/scala/com/neu/service/group/GroupService.scala
+++ b/admin/src/main/scala/com/neu/service/group/GroupService.scala
@@ -73,7 +73,7 @@ class GroupService extends BaseService with DefaultJsonFormats with LazyLogging
logger.info("Exporting groups: {}", payload)
RestClient.httpRequestWithHeaderDecode(
s"${baseClusterUri(tokenId)}/file/group",
- GET,
+ POST,
payload,
tokenId
)
@@ -551,11 +551,11 @@ class GroupService extends BaseService with DefaultJsonFormats with LazyLogging
}
}
- def getDlpSensor(tokenId: String, name: Option[String]): Route = complete {
+ def getDlpSensor(tokenId: String, name: Option[String], scope: Option[String]): Route = complete {
if (name.isEmpty) {
logger.info("Getting sensors")
RestClient.httpRequestWithHeader(
- s"${baseClusterUri(tokenId)}/dlp/sensor",
+ s"${baseClusterUri(tokenId)}/dlp/sensor${if (scope.nonEmpty) s"?scope=${scope.get}" else ""}",
GET,
"",
tokenId
@@ -691,11 +691,11 @@ class GroupService extends BaseService with DefaultJsonFormats with LazyLogging
)
}
- def getWafSensor(tokenId: String, name: Option[String]): Route = complete {
+ def getWafSensor(tokenId: String, name: Option[String], scope: Option[String]): Route = complete {
if (name.isEmpty) {
logger.info("Getting sensors")
RestClient.httpRequestWithHeader(
- s"${baseClusterUri(tokenId)}/waf/sensor",
+ s"${baseClusterUri(tokenId)}/waf/sensor${if (scope.nonEmpty) s"?scope=${scope.get}" else ""}",
GET,
"",
tokenId
diff --git a/admin/webapp/websrc/app/common/api/policy-http.service.ts b/admin/webapp/websrc/app/common/api/policy-http.service.ts
index 993b5fd20..de0eb95e3 100644
--- a/admin/webapp/websrc/app/common/api/policy-http.service.ts
+++ b/admin/webapp/websrc/app/common/api/policy-http.service.ts
@@ -3,6 +3,7 @@ import { PathConstant } from '@common/constants/path.constant';
import { Group, NetworkRule, ResponseRule, Service } from '@common/types';
import { GlobalVariable } from '@common/variables/global.variable';
import { Observable } from 'rxjs';
+import { GlobalConstant } from '@common/constants/global.constant';
import { pluck } from 'rxjs/operators';
@Injectable()
@@ -124,9 +125,23 @@ export class PolicyHttpService {
return GlobalVariable.http.patch(PathConstant.DLP_GROUPS_URL, payload);
}
- getDLPSensors() {
+ getDLPSensors(source) {
+ const options: any = [];
+ if (source === GlobalConstant.NAV_SOURCE.FED_POLICY) {
+ options.push({
+ params: {
+ scope: 'fed',
+ },
+ });
+ } else {
+ options.push({
+ params: {
+ scope: 'local',
+ },
+ });
+ }
return GlobalVariable.http
- .get(PathConstant.DLP_SENSORS_URL)
+ .get(PathConstant.DLP_SENSORS_URL, ...options)
.pipe(pluck('sensors'));
}
@@ -140,9 +155,23 @@ export class PolicyHttpService {
return GlobalVariable.http.patch(PathConstant.WAF_GROUPS_URL, payload);
}
- getWAFSensors() {
+ getWAFSensors(source) {
+ const options: any = [];
+ if (source === GlobalConstant.NAV_SOURCE.FED_POLICY) {
+ options.push({
+ params: {
+ scope: 'fed',
+ },
+ });
+ } else {
+ options.push({
+ params: {
+ scope: 'local',
+ },
+ });
+ }
return GlobalVariable.http
- .get(PathConstant.WAF_SENSORS_URL)
+ .get(PathConstant.WAF_SENSORS_URL, ...options)
.pipe(pluck('sensors'));
}
}
diff --git a/admin/webapp/websrc/app/common/services/dlp-sensors.service.ts b/admin/webapp/websrc/app/common/services/dlp-sensors.service.ts
index 80ef9893f..211088dd0 100644
--- a/admin/webapp/websrc/app/common/services/dlp-sensors.service.ts
+++ b/admin/webapp/websrc/app/common/services/dlp-sensors.service.ts
@@ -8,9 +8,9 @@ import { TranslateService } from '@ngx-translate/core';
import { DomSanitizer } from '@angular/platform-browser';
import { UtilsService } from '@common/utils/app.utils';
import { pluck } from 'rxjs/operators';
-import { SensorActionButtonsComponent } from '@routes/dlp-sensors/partial/sensor-action-buttons/sensor-action-buttons.component';
-import { RuleActionButtonsComponent } from '@routes/dlp-sensors/partial/rule-action-buttons/rule-action-buttons.component';
-import { PatternActionButtonsComponent } from '@routes/dlp-sensors/partial/pattern-action-buttons/pattern-action-buttons.component';
+import { SensorActionButtonsComponent } from '@components/dlp-sensors/partial/sensor-action-buttons/sensor-action-buttons.component';
+import { RuleActionButtonsComponent } from '@components/dlp-sensors/partial/rule-action-buttons/rule-action-buttons.component';
+import { PatternActionButtonsComponent } from '@components/dlp-sensors/partial/pattern-action-buttons/pattern-action-buttons.component';
@Injectable({
providedIn: 'root',
@@ -26,21 +26,25 @@ export class DlpSensorsService {
this.$win = $(GlobalVariable.window);
}
- configGrids = (isWriteDLPSensorAuthorized: boolean) => {
+ configGrids = (isWriteDLPSensorAuthorized: boolean, source: string = '') => {
const columnDefs4Sensor = [
{
headerName: this.translate.instant('dlp.gridHeader.SENSOR_NAME'),
field: 'name',
- headerCheckboxSelection: true,
- headerCheckboxSelectionFilteredOnly: true,
- checkboxSelection: params => {
- if (params.data) return !params.data.predefine;
- return false;
- },
+ headerCheckboxSelection: params =>
+ params.context.componentParent.source !==
+ GlobalConstant.NAV_SOURCE.FED_POLICY,
+ headerCheckboxSelectionFilteredOnly: params =>
+ params.context.componentParent.source !==
+ GlobalConstant.NAV_SOURCE.FED_POLICY,
cellRenderer: params => {
if (params.value)
return `
${params.value}
`;
@@ -100,6 +104,19 @@ export class DlpSensorsService {
},
];
+ if (source !== GlobalConstant.NAV_SOURCE.FED_POLICY) {
+ columnDefs4Sensor[0]['checkboxSelection'] = params => {
+ if (params.data)
+ return (
+ !params.data.predefine &&
+ params.context.componentParent.source !==
+ GlobalConstant.NAV_SOURCE.FED_POLICY &&
+ params.data.cfg_type !== GlobalConstant.CFG_TYPE.FED
+ );
+ return false;
+ };
+ }
+
const columnDefs4Rules = [
{
headerName: this.translate.instant('dlp.gridHeader.PATTERN_NAME'),
@@ -186,7 +203,8 @@ export class DlpSensorsService {
),
};
- grids.gridOptions.rowSelection = 'multiple';
+ grids.gridOptions.rowSelection =
+ source !== GlobalConstant.NAV_SOURCE.FED_POLICY ? 'multiple' : 'single';
grids.gridOptions.rowClassRules = {
'disabled-row': params => {
@@ -204,9 +222,17 @@ export class DlpSensorsService {
return grids;
};
- getDlpSensorsData = () => {
+ getDlpSensorsData = source => {
+ const options: any = [];
+ if (source === GlobalConstant.NAV_SOURCE.FED_POLICY) {
+ options.push({
+ params: {
+ scope: 'fed',
+ },
+ });
+ }
return GlobalVariable.http
- .get(PathConstant.DLP_SENSORS_URL)
+ .get(PathConstant.DLP_SENSORS_URL, ...options)
.pipe(pluck('sensors'));
};
diff --git a/admin/webapp/websrc/app/common/services/federated-configuration.service.ts b/admin/webapp/websrc/app/common/services/federated-configuration.service.ts
index 8badf58b9..cdb564b5f 100644
--- a/admin/webapp/websrc/app/common/services/federated-configuration.service.ts
+++ b/admin/webapp/websrc/app/common/services/federated-configuration.service.ts
@@ -6,6 +6,7 @@ import { Webhook } from '@common/types';
@Injectable()
export class FederatedConfigurationService {
+ public activeTabIndex4Group: number = 0;
constructor(private configHttpService: ConfigHttpService) {}
getFederatedConfig() {
diff --git a/admin/webapp/websrc/app/common/services/groups.service.ts b/admin/webapp/websrc/app/common/services/groups.service.ts
index 78f0d2acc..902d919b9 100644
--- a/admin/webapp/websrc/app/common/services/groups.service.ts
+++ b/admin/webapp/websrc/app/common/services/groups.service.ts
@@ -843,8 +843,8 @@ export class GroupsService {
return this.policyHttpService.getDLPGroups(groupName);
};
- getDlpSensorData = () => {
- return this.policyHttpService.getDLPSensors();
+ getDlpSensorData = source => {
+ return this.policyHttpService.getDLPSensors(source);
};
updateGroupDlpSensorData = payload => {
@@ -855,8 +855,8 @@ export class GroupsService {
return this.policyHttpService.getWAFGroups(groupName);
};
- getWafSensorData = () => {
- return this.policyHttpService.getWAFSensors();
+ getWafSensorData = getWAFSensors => {
+ return this.policyHttpService.getWAFSensors(getWAFSensors);
};
updateGroupWafSensorData = payload => {
diff --git a/admin/webapp/websrc/app/common/services/waf-sensors.service.ts b/admin/webapp/websrc/app/common/services/waf-sensors.service.ts
index d7c6b5461..67eda9573 100644
--- a/admin/webapp/websrc/app/common/services/waf-sensors.service.ts
+++ b/admin/webapp/websrc/app/common/services/waf-sensors.service.ts
@@ -8,9 +8,9 @@ import { TranslateService } from '@ngx-translate/core';
import { DomSanitizer } from '@angular/platform-browser';
import { UtilsService } from '@common/utils/app.utils';
import { pluck } from 'rxjs/operators';
-import { SensorActionButtonsComponent } from '@routes/waf-sensors/partial/sensor-action-buttons/sensor-action-buttons.component';
-import { RuleActionButtonsComponent } from '@routes/waf-sensors/partial/rule-action-buttons/rule-action-buttons.component';
-import { PatternActionButtonsComponent } from '@routes/waf-sensors/partial/pattern-action-buttons/pattern-action-buttons.component';
+import { SensorActionButtonsComponent } from '@components/waf-sensors/partial/sensor-action-buttons/sensor-action-buttons.component';
+import { RuleActionButtonsComponent } from '@components/waf-sensors/partial/rule-action-buttons/rule-action-buttons.component';
+import { PatternActionButtonsComponent } from '@components/waf-sensors/partial/pattern-action-buttons/pattern-action-buttons.component';
@Injectable({
providedIn: 'root',
@@ -26,21 +26,25 @@ export class WafSensorsService {
this.$win = $(GlobalVariable.window);
}
- configGrids = (isWriteWAFSensorAuthorized: boolean) => {
+ configGrids = (isWriteWAFSensorAuthorized: boolean, source: string = '') => {
const columnDefs4Sensor = [
{
headerName: this.translate.instant('waf.gridHeader.SENSOR_NAME'),
field: 'name',
- headerCheckboxSelection: true,
- headerCheckboxSelectionFilteredOnly: true,
- checkboxSelection: params => {
- if (params.data) return !params.data.predefine;
- return false;
- },
+ headerCheckboxSelection: params =>
+ params.context.componentParent.source !==
+ GlobalConstant.NAV_SOURCE.FED_POLICY,
+ headerCheckboxSelectionFilteredOnly: params =>
+ params.context.componentParent.source !==
+ GlobalConstant.NAV_SOURCE.FED_POLICY,
cellRenderer: params => {
if (params.value)
return `
${params.value}
`;
@@ -100,6 +104,19 @@ export class WafSensorsService {
},
];
+ if (source !== GlobalConstant.NAV_SOURCE.FED_POLICY) {
+ columnDefs4Sensor[0]['checkboxSelection'] = params => {
+ if (params.data)
+ return (
+ !params.data.predefine &&
+ params.context.componentParent.source !==
+ GlobalConstant.NAV_SOURCE.FED_POLICY &&
+ params.data.cfg_type !== GlobalConstant.CFG_TYPE.FED
+ );
+ return false;
+ };
+ }
+
const columnDefs4Rules = [
{
headerName: this.translate.instant('waf.gridHeader.PATTERN_NAME'),
@@ -186,7 +203,8 @@ export class WafSensorsService {
),
};
- grids.gridOptions.rowSelection = 'multiple';
+ grids.gridOptions.rowSelection =
+ source !== GlobalConstant.NAV_SOURCE.FED_POLICY ? 'multiple' : 'single';
grids.gridOptions.rowClassRules = {
'disabled-row': params => {
@@ -204,9 +222,17 @@ export class WafSensorsService {
return grids;
};
- getWafSensorsData = () => {
+ getWafSensorsData = source => {
+ const options: any = [];
+ if (source === GlobalConstant.NAV_SOURCE.FED_POLICY) {
+ options.push({
+ params: {
+ scope: 'fed',
+ },
+ });
+ }
return GlobalVariable.http
- .get(PathConstant.WAF_SENSORS_URL)
+ .get(PathConstant.WAF_SENSORS_URL, ...options)
.pipe(pluck('sensors'));
};
diff --git a/admin/webapp/websrc/app/common/types/settings/remote-repository.ts b/admin/webapp/websrc/app/common/types/settings/remote-repository.ts
index 30bfb0353..9a05461d7 100644
--- a/admin/webapp/websrc/app/common/types/settings/remote-repository.ts
+++ b/admin/webapp/websrc/app/common/types/settings/remote-repository.ts
@@ -32,6 +32,7 @@ export interface RemoteExportOptionsWrapper {
export interface RemoteExportOptionsConfig {
policy_mode: string;
profile_mode: string;
+ use_name_referral: boolean;
remote_repository_nickname: string;
export_mode: string;
file_path?: string;
diff --git a/admin/webapp/websrc/app/routes/dlp-sensors/dlp-sensors.component.html b/admin/webapp/websrc/app/routes/components/dlp-sensors/dlp-sensors.component.html
similarity index 89%
rename from admin/webapp/websrc/app/routes/dlp-sensors/dlp-sensors.component.html
rename to admin/webapp/websrc/app/routes/components/dlp-sensors/dlp-sensors.component.html
index f8fe02d81..d5aafd3a9 100644
--- a/admin/webapp/websrc/app/routes/dlp-sensors/dlp-sensors.component.html
+++ b/admin/webapp/websrc/app/routes/components/dlp-sensors/dlp-sensors.component.html
@@ -1,5 +1,7 @@
-
+
{{ 'sidebar.nav.DLP_SENSORS' | translate }}
@@ -35,7 +37,10 @@
-
+
@@ -95,7 +100,14 @@