diff --git a/roles/database/files/sql/idempotent/fworch-texts.sql b/roles/database/files/sql/idempotent/fworch-texts.sql index 5cbebdf91..5488bb828 100644 --- a/roles/database/files/sql/idempotent/fworch-texts.sql +++ b/roles/database/files/sql/idempotent/fworch-texts.sql @@ -302,6 +302,14 @@ INSERT INTO txt VALUES ('download_html', 'German', 'als HTML herunterladen'); INSERT INTO txt VALUES ('download_html', 'English', 'Download HTML'); INSERT INTO txt VALUES ('download_json', 'German', 'als JSON herunterladen'); INSERT INTO txt VALUES ('download_json', 'English', 'Download JSON'); +INSERT INTO txt VALUES ('page_format', 'German', 'Seitenformat'); +INSERT INTO txt VALUES ('page_format', 'English', 'Page Format'); +INSERT INTO txt VALUES ('width', 'German', 'Breite (mm)'); +INSERT INTO txt VALUES ('width', 'English', 'Width (mm)'); +INSERT INTO txt VALUES ('height', 'German', 'Höhe (mm)'); +INSERT INTO txt VALUES ('height', 'English', 'Height (mm)'); +INSERT INTO txt VALUES ('includes_json', 'German', '(beinhaltet JSON)'); +INSERT INTO txt VALUES ('includes_json', 'English', '(includes JSON)'); INSERT INTO txt VALUES ('save_as_template', 'German', 'Als Vorlage speichern'); INSERT INTO txt VALUES ('save_as_template', 'English', 'Save as Template'); INSERT INTO txt VALUES ('no_device_selected', 'German', 'Kein Device ausgewählt.'); @@ -1845,6 +1853,8 @@ INSERT INTO txt VALUES ('E5107', 'German', 'Gateway wurde bereits angelegt: '); INSERT INTO txt VALUES ('E5107', 'English', 'Gateway has already been created: '); INSERT INTO txt VALUES ('E5108', 'German', 'Email-Adresse muss "@"-Zeichen enthalten.'); INSERT INTO txt VALUES ('E5108', 'English', 'Email address must contain "@"-sign.'); +INSERT INTO txt VALUES ('E5109', 'German', 'Bitte keine Leerzeichen im Namen verwenden.'); +INSERT INTO txt VALUES ('E5109', 'English', 'Please do not use spaces in the name.'); INSERT INTO txt VALUES ('E5111', 'German', 'Es gibt bereits ein Gateway mit derselben Konfiguration und Import aktiviert'); INSERT INTO txt VALUES ('E5111', 'English', 'There is already a gateway in the same configuration with import enabled'); INSERT INTO txt VALUES ('E5112', 'German', 'Gateway konnte nicht angelegt werden'); @@ -2266,13 +2276,15 @@ INSERT INTO txt VALUES ('H1215', 'German', 'Aktuelle NAT Regeln: Aktuell aktive INSERT INTO txt VALUES ('H1215', 'English', 'Current NAT Rules: Currently active NAT rules of all selected devices.'); INSERT INTO txt VALUES ('H1301', 'German', 'Direkt nach der Erzeugung oder vom Archiv aus können Reports in verschiedenen Ausgabeformaten exportiert werden:'); INSERT INTO txt VALUES ('H1301', 'English', 'Directly after creation or from the archive reports can be exported to different output formats:'); -INSERT INTO txt VALUES ('H1302', 'German', '
  • pdf
  • html
  • csv (aktuell nur für aufgelösten Regel-Report-Typ unterstützt)
  • json
  • '); -INSERT INTO txt VALUES ('H1302', 'English', '
  • pdf
  • html
  • csv (currently only supported for resolved rules report type)
  • json
  • '); +INSERT INTO txt VALUES ('H1302', 'German', '
  • pdf
  • html
  • csv (aktuell nur für die aufgelösten und technischen Report-Typen unterstützt)
  • json
  • '); +INSERT INTO txt VALUES ('H1302', 'English', '
  • pdf
  • html
  • csv (currently only supported for resolved and technical report types)
  • json
  • '); INSERT INTO txt VALUES ('H1303', 'German', 'Nach betätigen des "Report exportieren"-Auswahlfeldes kann eines oder mehrere dieser Formate ausgewählt werden. + Bei Aktivierung der pdf-Ausgabe wird desweiteren das Seitenformat zur Auswahl angeboten.
    Auch kann der Report mit einem Namen versehen und archiviert werden. Ein weiteres Ausgabefenster erlaubt dann das separate Abholen der ausgewählten Ausgabedateien. '); INSERT INTO txt VALUES ('H1303', 'English', 'After clicking the "Export Report" button one or more of them can be selected. + When selecting the pdf export, the page format is offered for selection.
    Also the possibility to name and save the report in the archive is given. Another Popup allows then to download the selected output files separately. '); @@ -2905,21 +2917,25 @@ INSERT INTO txt VALUES ('H5102', 'English', 'The following firewall products can '); INSERT INTO txt VALUES ('H5103', 'German', 'Für Firewallgateways ohne separates Management oder im Falle, dass das zentrale Management nicht in den Firewall Orchestrator eingebunden werden kann, - werden die Details des Gateways als Management und gleichzeitig auch als Gateway eingetragen. + werden die Details des Gateways als Management und gleichzeitig auch als Gateway eingetragen.
    + Im Falle Fortigate: Um einen vollständigen Datenimport zu gewährleisten, bitte in der Fortigate config den Seitenumbruch deaktivieren, damit beim Kommando "show full-configuration" die komplette Config ausgegeben wird. '); INSERT INTO txt VALUES ('H5103', 'English', 'For firewall gateways without a separate management or in case the central management cannot be integrated into Firewall Orchestrator - you may enter the details of the gateway here as a management system as well and then add it again as a gateway. + you may enter the details of the gateway here as a management system as well and then add it again as a gateway.
    + In the case of Fortigate: To get the entire data imported, disable pagination in the Fortigate config to allow get command "show full-configuration" to retrieve the complete config. '); INSERT INTO txt VALUES ('H5104', 'German', 'Wenn Beispieldaten (definiert durch die Endung "_demo" vom Namen) existieren, wird eine Schaltfläche angezeigt, um diese und alle verknüpften Gateways zu löschen.'); INSERT INTO txt VALUES ('H5104', 'English', 'If there are sample data (defined by the ending "_demo" of the name), a button is displayed to delete them and all related gateways.'); INSERT INTO txt VALUES ('H5111', 'German', 'Name*: Name des Managements.
    Für die meisten Firewalls ist dies ein willkürlicher Name. Ausnahmen sind direkt verbundene Gateways von Fortigate, Netscreen und Juniper. Hier muss der Name des Firewallgateways eingetragen werden.
    + Da es zu Problemen mit dem perl-Importer kommen kann, sollten Leerzeichen im Namen von Legacy-Systemen nicht verwendet werden. Ein Management dessen Name mit "_demo" endet, wird beim Betätigen der "Beispieldaten löschen"-Schaltfläche gelöscht. '); INSERT INTO txt VALUES ('H5111', 'English', 'Name*: Name of the mangement.
    For most firewalls this is an arbitrary name. Exceptions are Fortigate, Netscreen and Juniper directly connected gateways. Here the name give needs to be the name of the firewall gateway.
    + Do not use spaces in the management name of legacy systems as perl importer cannot cope with spaces here. A management whose name ends with "_demo" will be deleted when using the "Remove Sample Data" button. '); INSERT INTO txt VALUES ('H5112', 'German', 'Kommentar: Optionale Beschreibung des Managements.'); @@ -2928,11 +2944,11 @@ INSERT INTO txt VALUES ('H5113', 'German', 'Gerätetyp*: bitte das korrekte INSERT INTO txt VALUES ('H5113', 'English', 'Device Type*: Select correct product from a list of available types, see above.'); INSERT INTO txt VALUES ('H5114', 'German', 'Hostname*: Adresse des Hosts (entweder IP-Addresse oder auflösbarer Name). Für Check Point R8x MDS Installationen die Addresse des MDS-Servers für alle Domains benutzen.
    - Für Fortinet, Barradua, Juniper muss die IP vom auflösbaren Namen des Firewallgateways spezifiziert werden. + Für alle Firewall-Plattformen, die kein separates Management-System besitzen, muss die IP oder der auflösbare Name des Firewallgateways spezifiziert werden. '); INSERT INTO txt VALUES ('H5114', 'English', 'Hostname*: Address of the host (either IP address or resolvable name). For Check Point R8x MDS installations use the address of the MDS server for all domains.
    - For Fortinet, Barradua, Juniper you need to specify the IP or resolvable name of the firewall gateway. + For all firewall platforms which do not possess a separate management, use the IP address or the resolvable name of the firewall gateway. '); INSERT INTO txt VALUES ('H5115', 'German', 'Port*: Port-Nummer des Hosts.
    Wenn das Ziel Check Point R8x, FortiManager, Azure oder Cisco FirePower ist, wird die Verbindung via API aufgebaut. Die Standard-Port-Nummer ist 443. Denken Sie daran, den API-Zugang auf Ihrem Firewall Managment zu aktivieren.
    @@ -2943,12 +2959,11 @@ INSERT INTO txt VALUES ('H5115', 'English', 'Port*: Port number of the host.
    If the target any other platform Firewall Orchestrator needs ssh-based access. The default port number here is 22. '); INSERT INTO txt VALUES ('H5116', 'German', 'Login-Daten*: Zugangsdaten für den Import-Nutzer des Managements.
    - Hier kann ein Satz Zugangsdaten ausgewählt werden, der zum Login auf dem Management dient. + Hier kann ein Satz Zugangsdaten ausgewählt werden, der zum Login auf dem Management dient. '); INSERT INTO txt VALUES ('H5116', 'English', 'Import Credentials*: User/Password combination for logging into the management.
    - Choose a set of credentials which will be used to get the management''s configuration. + Choose a set of credentials which will be used to get the management''s configuration. '); - INSERT INTO txt VALUES ('H5119', 'German', 'Domain: Firewall Domain Name
    für Check Point R8x MDS / Fortimanager Installationen, andernfall leer lassen. '); @@ -2968,9 +2983,9 @@ INSERT INTO txt VALUES ('H5122', 'English', 'Import Disabled: Flag if the data i INSERT INTO txt VALUES ('H5123', 'German', 'Nicht sichtbar: Wenn gesetzt ist dieses Management nicht mit Standard-Reporter-Rolle sichtbar.'); INSERT INTO txt VALUES ('H5123', 'English', 'Hide in UI: If set, this management is not visible to the standard reporter role.'); -INSERT INTO txt VALUES ('H5130', 'German', 'Hier werden die Zugangsdaten fü den Import der Firewall-Konfigurationen verwaltet. +INSERT INTO txt VALUES ('H5130', 'German', 'Hier werden die Zugangsdaten für den Import der Firewall-Konfigurationen verwaltet. Diese können auch für den Zugriff auf mehrere Firewall-Managements verwendet werden. -Ein Löschen is erst möglich, wenn die Zugangsdaten nirgends verwendet werden. +Ein Löschen ist erst möglich, wenn die Zugangsdaten nirgends mehr verwendet werden. '); INSERT INTO txt VALUES ('H5130', 'English', 'Manage credentials for importing firewall configuration data. Credentials can be used for logging in to one or multiple firewall managements. @@ -2988,18 +3003,20 @@ INSERT INTO txt VALUES ('H5132', 'English', 'Username*: The user used to login t This user needs to be created on the firewall system in advance and needs full read access to the system.
    On Check Point R8x we recommend using the predefined "Read Only All" profile (both global and domain management) for the user. '); -INSERT INTO txt VALUES ('H5135', 'German', 'Schlüsselpaar*: Handelt es sich bei diesen Login-Daten um ein SSH Public-Key Paar oder um Standard ein Standard-Passwort. -'); -INSERT INTO txt VALUES ('H5135', 'English', 'Key Pair*: Do these credentials consist of a private/public SSH key pair or do they contain a standard password. -'); -INSERT INTO txt VALUES ('H5133', 'German', 'Privater Schlüssel* / Passwort*: Für den ssh-Zugang hier den privaten ssh-Schlüssel hinterlegen (Schlüssel muss unverschlüsselt und ohne Passphrase sein)
    - Für den API-Zugang ist dies das Passwort des API-Nutzers. +INSERT INTO txt VALUES ('H5133', 'German', 'Privater Schlüssel* / Passwort*: Für den ssh-Zugang hier den privaten ssh-Schlüssel hinterlegen (Schlüssel muss unverschlüsselt und ohne Passphrase sein). + Bitte für ssh-basierten legacy FortiGate Zugriff kein RSA benutzen, da es hier ein Problem mit RSA-Schlüsseln zu geben scheint.
    + Für den API-Zugang ist hier das Passwort des API-Nutzers einzutragen. '); -INSERT INTO txt VALUES ('H5133', 'English', 'Login Secret* / Password*: For ssh access enter the private ssh key (key needs to be unencrypted without passphrase)
    - For API access this is the password of the API user. +INSERT INTO txt VALUES ('H5133', 'English', 'Login Secret* / Password*: For ssh access enter the private ssh key (key needs to be unencrypted without passphrase). + For legacy ssh based FortiGate, do not use RSA as there seems to be a problem with RSA keys.
    + For API access insert the password of the API user here. '); INSERT INTO txt VALUES ('H5134', 'German', 'Öffentlicher Schlüssel: Dieses Feld muss nur für Netscreen-Firewalls gefüllt werden - dieses System benötigt auch den öffentlichen Schlüssel zum Anmelden.'); INSERT INTO txt VALUES ('H5134', 'English', 'Public Key: This field only needs to be filled for netscreen firewalls - this system also needs the public key for successful login.'); +INSERT INTO txt VALUES ('H5135', 'German', 'Schlüsselpaar*: Handelt es sich bei diesen Login-Daten um ein SSH Public-Key Paar oder um ein Standard-Passwort. +'); +INSERT INTO txt VALUES ('H5135', 'English', 'Key Pair*: Do these credentials consist of a private/public SSH key pair or do they contain a standard password. +'); INSERT INTO txt VALUES ('H5136', 'German', 'Cloud Client ID: Nur für Cloud Instanzen (Azure) benötigt - für alle anderen Plattformen kann dieses Feld leer gelassen werden. '); INSERT INTO txt VALUES ('H5136', 'English', 'Cloud Client ID: If you have a cloud installation (e.g. Azure) - enter your Azure client ID here. For all other installations, leave this field empty. diff --git a/roles/lib/files/FWO.Report/Display/RuleDisplayHtml.cs b/roles/lib/files/FWO.Report/Display/RuleDisplayHtml.cs index a855916ae..8d73d3f4f 100644 --- a/roles/lib/files/FWO.Report/Display/RuleDisplayHtml.cs +++ b/roles/lib/files/FWO.Report/Display/RuleDisplayHtml.cs @@ -1,6 +1,7 @@ using FWO.Api.Data; using FWO.Config.Api; using System.Text; +using FWO.Report; using FWO.Report.Filter; namespace FWO.Ui.Display @@ -97,17 +98,6 @@ protected string constructLink(string type, string symbol, long id, string name, return $" {name}"; } - protected string getObjSymbol(string objType) - { - switch(objType) - { - case "group": return "oi oi-list-rich"; - case "network": return "oi oi-rss"; - case "ip_range": return "oi oi-resize-width"; - default: return "oi oi-monitor"; - } - } - protected string NetworkLocationToHtml(NetworkLocation userNetworkObject, int mgmtId, OutputLocation location, string style, ReportType reportType) { StringBuilder result = new StringBuilder(); @@ -120,7 +110,7 @@ protected string NetworkLocationToHtml(NetworkLocation userNetworkObject, int mg } else { - result.Append(constructLink("user", "oi oi-people", userNetworkObject.User.Id, userNetworkObject.User.Name, location, mgmtId, style) + "@"); + result.Append(constructLink("user", ReportBase.GetIconClass(ObjCategory.user, userNetworkObject.User.Type.Name), userNetworkObject.User.Id, userNetworkObject.User.Name, location, mgmtId, style) + "@"); } } @@ -132,7 +122,7 @@ protected string NetworkLocationToHtml(NetworkLocation userNetworkObject, int mg } else { - result.Append(constructLink("nwobj", getObjSymbol(userNetworkObject.Object.Type.Name), userNetworkObject.Object.Id, userNetworkObject.Object.Name, location, mgmtId, style)); + result.Append(constructLink("nwobj", ReportBase.GetIconClass(ObjCategory.nobj, userNetworkObject.Object.Type.Name), userNetworkObject.Object.Id, userNetworkObject.Object.Name, location, mgmtId, style)); } if (userNetworkObject.Object.Type.Name != "group") { @@ -158,7 +148,7 @@ protected string ServiceToHtml(NetworkService service, int mgmtId, OutputLocatio } else { - result.Append(constructLink("svc", service.Type.Name == "group" ? "oi oi-list-rich" : "oi oi-wrench", service.Id, service.Name, location, mgmtId, style)); + result.Append(constructLink("svc", ReportBase.GetIconClass(ObjCategory.nsrv, service.Type.Name), service.Id, service.Name, location, mgmtId, style)); } } if (service.DestinationPort != null) diff --git a/roles/lib/files/FWO.Report/ReportBase.cs b/roles/lib/files/FWO.Report/ReportBase.cs index 10cde69fc..f555aa7c5 100644 --- a/roles/lib/files/FWO.Report/ReportBase.cs +++ b/roles/lib/files/FWO.Report/ReportBase.cs @@ -16,7 +16,7 @@ public enum RsbTab rule = 30 } - public enum RsbObjType + public enum ObjCategory { all = 0, nobj = 1, @@ -89,7 +89,7 @@ public ReportBase(DynGraphqlQuery query, UserConfig UserConfig, ReportType repor public abstract Task GetObjectsInReport(int objectsPerFetch, ApiConnection apiConnection, Func callback); // to be called when exporting - public abstract Task GetObjectsForManagementInReport(Dictionary objQueryVariables, RsbObjType objects, int maxFetchCycles, ApiConnection apiConnection, Func callback); + public abstract Task GetObjectsForManagementInReport(Dictionary objQueryVariables, ObjCategory objects, int maxFetchCycles, ApiConnection apiConnection, Func callback); public abstract string ExportToCsv(); @@ -223,5 +223,33 @@ public async Task getRelevantImportIds(ApiConnection apiConnection ImpIdQueryVariables["mgmIds"] = Query.RelevantManagementIds; return await apiConnection.SendQueryAsync(ReportQueries.getRelevantImportIdsAtTime, ImpIdQueryVariables); } + + public static string GetIconClass(ObjCategory objCategory, string objType) + { + switch (objType) + { + case "group" when objCategory == ObjCategory.user: + return "oi oi-people"; + case "group": + return "oi oi-list-rich"; + case "host": + return "oi oi-laptop"; + case "network": + return "oi oi-rss"; + case "ip_range": + return "oi oi-resize-width"; + default: + switch (objCategory) + { + case ObjCategory.nobj: + return "oi oi-laptop"; + case ObjCategory.nsrv: + return "oi oi-wrench"; + case ObjCategory.user: + return "oi oi-person"; + } + return ""; + } + } } } diff --git a/roles/lib/files/FWO.Report/ReportChanges.cs b/roles/lib/files/FWO.Report/ReportChanges.cs index d398db981..f5f1d9059 100644 --- a/roles/lib/files/FWO.Report/ReportChanges.cs +++ b/roles/lib/files/FWO.Report/ReportChanges.cs @@ -20,7 +20,7 @@ public override async Task GetObjectsInReport(int objectsPerFetch, ApiConn return true; } - public override Task GetObjectsForManagementInReport(Dictionary objQueryVariables, RsbObjType objects, int maxFetchCycles, ApiConnection apiConnection, Func callback) + public override Task GetObjectsForManagementInReport(Dictionary objQueryVariables, ObjCategory objects, int maxFetchCycles, ApiConnection apiConnection, Func callback) { throw new NotImplementedException(); } diff --git a/roles/lib/files/FWO.Report/ReportRules.cs b/roles/lib/files/FWO.Report/ReportRules.cs index 242d6db16..8933a814c 100644 --- a/roles/lib/files/FWO.Report/ReportRules.cs +++ b/roles/lib/files/FWO.Report/ReportRules.cs @@ -61,7 +61,7 @@ public override async Task GetObjectsInReport(int objectsPerFetch, ApiConn }; // get objects for this management in the current report - gotAllObjects &= await GetObjectsForManagementInReport(objQueryVariables, RsbObjType.all, int.MaxValue, apiConnection, callback); + gotAllObjects &= await GetObjectsForManagementInReport(objQueryVariables, ObjCategory.all, int.MaxValue, apiConnection, callback); } } GotObjectsInReport = true; @@ -70,7 +70,7 @@ public override async Task GetObjectsInReport(int objectsPerFetch, ApiConn return gotAllObjects; } - public override async Task GetObjectsForManagementInReport(Dictionary objQueryVariables, RsbObjType objects, int maxFetchCycles, ApiConnection apiConnection, Func callback) + public override async Task GetObjectsForManagementInReport(Dictionary objQueryVariables, ObjCategory objects, int maxFetchCycles, ApiConnection apiConnection, Func callback) { if (!objQueryVariables.ContainsKey("mgmIds") || !objQueryVariables.ContainsKey("limit") || !objQueryVariables.ContainsKey("offset")) throw new ArgumentException("Given objQueryVariables dictionary does not contain variable for management id, limit or offset"); @@ -87,13 +87,13 @@ public override async Task GetObjectsForManagementInReport(Dictionary GetObjectsForManagementInReport(Dictionary GetObjectsInReport(int objectsPerFetch, ApiConn return true; } - public override Task GetObjectsForManagementInReport(Dictionary objQueryVariables, RsbObjType objects, int maxFetchCycles, ApiConnection apiConnection, Func callback) + public override Task GetObjectsForManagementInReport(Dictionary objQueryVariables, ObjCategory objects, int maxFetchCycles, ApiConnection apiConnection, Func callback) { return Task.FromResult(true); } diff --git a/roles/test/files/FWO.Test/ExportTest.cs b/roles/test/files/FWO.Test/ExportTest.cs index 5b9811153..45d0e2870 100644 --- a/roles/test/files/FWO.Test/ExportTest.cs +++ b/roles/test/files/FWO.Test/ExportTest.cs @@ -20,7 +20,7 @@ internal class ExportTest static NetworkService TestService2 = new NetworkService(){ Id = 2, DestinationPort = 6666, DestinationPortEnd = 7777, Name = "TestService2", Protocol = new NetworkProtocol { Name = "UDP" }}; static NetworkUser TestUser1 = new NetworkUser(){ Id = 1, Name = "TestUser1" }; - static NetworkUser TestUser2 = new NetworkUser(){ Id = 2, Name = "TestUser2" }; + static NetworkUser TestUser2 = new NetworkUser(){ Id = 2, Name = "TestUser2", Type = new NetworkUserType() { Name = "group"} }; static Rule Rule1 = new Rule(); static Rule Rule1Changed = new Rule(); @@ -63,7 +63,7 @@ public void RulesGenerateHtml() " TestService1 (443/TCP)" + "acceptnoneYuid1comment1" + "2TestRule2" + - "not
     TestUser1@ TestIp1 (1.2.3.4/32)
     TestUser1@ TestIp2 (127.0.0.1/32)" + + "not
     TestUser1@ TestIp1 (1.2.3.4/32)
     TestUser1@ TestIp2 (127.0.0.1/32)" + "" + "not
     TestUser2@ TestIpRange (1.2.3.4/32-1.2.3.5/32)" + "not
     TestService2 (6666-7777/UDP)" + @@ -236,7 +236,7 @@ public void RecertReportGenerateHtml() "" + "TestRule2" + "" + - "not
     TestUser1@ TestIp1 (1.2.3.4/32)
     TestUser1@ TestIp2 (127.0.0.1/32)" + + "not
     TestUser1@ TestIp1 (1.2.3.4/32)
     TestUser1@ TestIp2 (127.0.0.1/32)" + "" + "not
     TestUser2@ TestIpRange (1.2.3.4/32-1.2.3.5/32)" + "not
     TestService2 (6666-7777/UDP)" + @@ -349,8 +349,8 @@ public void ChangesGenerateHtml() "acceptnoneYdeleted:

    uid1

    " + "deleted:

    comment1

    added:

    new comment

    " + "05.04.2023 12:00:00Rule modifiedTestRule2" + - "not
     TestUser1@ TestIp1 (1.2.3.4/32)
    " + - " TestUser1@ TestIp2 (127.0.0.1/32)" + + "not
     TestUser1@ TestIp1 (1.2.3.4/32)
    " + + " TestUser1@ TestIp2 (127.0.0.1/32)" + "" + "deleted:

    not
     TestUser2@ TestIpRange (1.2.3.4/32-1.2.3.5/32)

    " + "added:

     TestUser2@ TestIpRange (1.2.3.4/32-1.2.3.5/32)

    " + @@ -358,8 +358,8 @@ public void ChangesGenerateHtml() "added:

     TestService2 (6666-7777/UDP)

    " + "denynonedeleted:

    Y

    added:

    N

    uid2:123comment2" + "05.04.2023 12:00:00Rule deleted

    TestRule2

    " + - "

    not
     TestUser1@ TestIp1 (1.2.3.4/32)
    " + - " TestUser1@ TestIp2 (127.0.0.1/32)

    " + + "

    not
     TestUser1@ TestIp1 (1.2.3.4/32)
    " + + " TestUser1@ TestIp2 (127.0.0.1/32)

    " + "" + "

    not
     TestUser2@ TestIpRange (1.2.3.4/32-1.2.3.5/32)

    " + "

    not
     TestService2 (6666-7777/UDP)

    " + @@ -368,24 +368,6 @@ public void ChangesGenerateHtml() "

    Y

    " + "

    uid2:123

    " + "

    comment2

    " + - // "

    Network Objects


    " + - // "" + - // "" + - // "" + - // "" + - // "" + - // "" + - // "
    No.NameTypeIP AddressMembersUidComment
    1TestIp1network1.2.3.4/32
    2TestIp2network127.0.0.1/32
    3TestIpRangeip_range1.2.3.4/32-1.2.3.5/32
    3TestIpNewnetwork10.0.6.1/32
    3TestIp1Changednetwork2.3.4.5/32
    " + - // "

    Network Services


    " + - // "" + - // "" + - // "" + - // "
    No.NameTypeProtocolPortMembersUidComment
    1TestService1TestService1TCP443
    2TestService2TestService2UDP6666-7777
    " + - // "

    Users


    " + - // "" + - // "" + - // "" + - // "
    No.NameTypeMembersUidComment
    1TestUser1TestUser1
    2TestUser2TestUser2
    "+ ""; Assert.AreEqual(expectedHtmlResult, removeLinebreaks((removeGenDate(reportChanges.ExportToHtml(), true)))); } diff --git a/roles/ui/files/FWO.UI/Pages/Reporting/Report.razor b/roles/ui/files/FWO.UI/Pages/Reporting/Report.razor index 4dc1a88f7..0cc0683c5 100644 --- a/roles/ui/files/FWO.UI/Pages/Reporting/Report.razor +++ b/roles/ui/files/FWO.UI/Pages/Reporting/Report.razor @@ -360,9 +360,9 @@ private Management[] managementsReport = new Management[0]; private Management? globalStats = null; - public ReportType selectedReportType = ReportType.Rules; - public FwoOwner? selectedOwner = null; - public List ownerList = new List(); + private ReportType selectedReportType = ReportType.Rules; + private FwoOwner? selectedOwner = null; + private List ownerList = new List(); private DeviceFilter deviceFilter = new DeviceFilter(); private bool selectAll = true; @@ -454,7 +454,7 @@ actEndDate = actEndTime = timeFilter.EndTime; } - public void SelectTime() + private void SelectTime() { ShowSelectTimeDialog = true; } @@ -511,7 +511,7 @@ filterInput = Regex.Replace(filterInput, "recertdisplay=" + @"-?\d+", $"recertdisplay={(userConfig.RecertificationPeriod-userConfig.RecertificationDisplayPeriod).ToString()}"); } *@ - public bool checkTimeRange() + private bool checkTimeRange() { if(actTimeFilter.TimeRangeType == TimeRangeType.Fixeddates && actTimeFilter.StartTime > actTimeFilter.EndTime) { @@ -521,7 +521,7 @@ return true; } - public void DisplayTime() + private void DisplayTime() { if (selectedReportType.IsChangeReport()) { @@ -699,7 +699,7 @@ reportGenerationDuration = watch.ElapsedMilliseconds/1000.0; } - protected bool PrepareMetadata(Management[] Managements) + private bool PrepareMetadata(Management[] Managements) { bool rulesFound = false; foreach (Management management in Managements) diff --git a/roles/ui/files/FWO.UI/Pages/Reporting/ReportExport.razor b/roles/ui/files/FWO.UI/Pages/Reporting/ReportExport.razor index c8e632f32..33f046c50 100644 --- a/roles/ui/files/FWO.UI/Pages/Reporting/ReportExport.razor +++ b/roles/ui/files/FWO.UI/Pages/Reporting/ReportExport.razor @@ -32,19 +32,19 @@ @if (ExportPdf) {
    - Paper Kind: + @(userConfig.GetText("page_format")): @if (SelectedPaperKind == PaperKind.Custom) {
    - Width (mm) + @(userConfig.GetText("width"))
    - Height (mm) + @(userConfig.GetText("height"))
    @@ -83,7 +83,7 @@
    diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsManagements.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsManagements.razor index 0db841864..b56961970 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsManagements.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsManagements.razor @@ -485,15 +485,17 @@ private bool CheckValues(Management mgm, string checkCause) { - if - ( - mgm.Name == null || mgm.Name == "" || - (mgm.DeviceType.Manufacturer != "DummyRouter" && (mgm.Hostname == null || mgm.Hostname == "")) - ) + if(mgm.Name == null || mgm.Name == "" || + (mgm.DeviceType.Manufacturer != "DummyRouter" && (mgm.Hostname == null || mgm.Hostname == ""))) { DisplayMessageInUi(null, checkCause, userConfig.GetText("E5102"), true); return false; } + if(mgm.DeviceType.IsLegacyDevType() && mgm.Name.Contains(" ")) + { + DisplayMessageInUi(null, checkCause, userConfig.GetText("E5109"), true); + return false; + } if (mgm.DeviceType.Manufacturer != "DummyRouter" && (mgm.Port < 1 || mgm.Port > 65535)) { DisplayMessageInUi(null, checkCause, userConfig.GetText("E5103"), true); diff --git a/roles/ui/files/FWO.UI/Shared/MainLayout.razor b/roles/ui/files/FWO.UI/Shared/MainLayout.razor index d984f4fe8..9fdd0f03b 100644 --- a/roles/ui/files/FWO.UI/Shared/MainLayout.razor +++ b/roles/ui/files/FWO.UI/Shared/MainLayout.razor @@ -180,7 +180,7 @@ cssClass = "footer alert alert-success fly-in-animation"; break; case MessageType.Warning: - cssClass = "footer alert alert-warning fly-in-animation"; + cssClass = "footer alert alert-warning-override fly-in-animation"; break; case MessageType.Error: Task.Run(async () => await setAlert(title, message)); diff --git a/roles/ui/files/FWO.UI/Shared/ObjectGroup.razor b/roles/ui/files/FWO.UI/Shared/ObjectGroup.razor index 0bb73044a..9ea60968d 100644 --- a/roles/ui/files/FWO.UI/Shared/ObjectGroup.razor +++ b/roles/ui/files/FWO.UI/Shared/ObjectGroup.razor @@ -36,12 +36,12 @@ @if(NetworkObjectExtractor != null) { - + @@ -57,7 +57,7 @@ { if(member.Object != null) { - @AddLinkToObject(RsbObjType.nobj, member.Object.Id, member.Object.Type.Name, member.Object.Name) + @AddLinkToObject(ObjCategory.nobj, member.Object.Id, member.Object.Type.Name, member.Object.Name)
    } } @@ -72,7 +72,7 @@ continue; shownMemberIds.Add(member.Object.Id); - @AddLinkToObject(RsbObjType.nobj, member.Object.Id, member.Object.Type.Name, member.Object.Name) + @AddLinkToObject(ObjCategory.nobj, member.Object.Id, member.Object.Type.Name, member.Object.Name)
    } } @@ -87,12 +87,12 @@ } @if(NetworkServiceExtractor != null) { - +
    @@ -114,7 +114,7 @@ { if(member.Object != null) { - @AddLinkToObject(RsbObjType.nsrv, member.Object.Id, member.Object.Type.Name, member.Object.Name) + @AddLinkToObject(ObjCategory.nsrv, member.Object.Id, member.Object.Type.Name, member.Object.Name)
    } } @@ -129,7 +129,7 @@ continue; shownMemberIds.Add(member.Object.Id); - @AddLinkToObject(RsbObjType.nsrv, member.Object.Id, member.Object.Type.Name, member.Object.Name) + @AddLinkToObject(ObjCategory.nsrv, member.Object.Id, member.Object.Type.Name, member.Object.Name)
    } } @@ -144,12 +144,12 @@ } @if(NetworkUserExtractor != null) { - +
    @@ -164,7 +164,7 @@ { if(member.Object != null) { - @AddLinkToObject(RsbObjType.user, member.Object.Id, member.Object.Type.Name, member.Object.Name) + @AddLinkToObject(ObjCategory.user, member.Object.Id, member.Object.Type.Name, member.Object.Name)
    } } @@ -179,7 +179,7 @@ continue; shownMemberIds.Add(member.Object.Id); - @AddLinkToObject(RsbObjType.user, member.Object.Id, member.Object.Type.Name, member.Object.Name) + @AddLinkToObject(ObjCategory.user, member.Object.Id, member.Object.Type.Name, member.Object.Name)
    } } @@ -205,7 +205,7 @@ AnchorNavToRSB? anchorNavToRSB { get; set; } [Parameter] - public Func, long, bool, Task>? FetchObjects { get; set; } + public Func, long, bool, Task>? FetchObjects { get; set; } [Parameter] public bool Recert { get; set; } @@ -248,10 +248,10 @@ { Content = InitialContent; if (StartContentDetailed) - await FetchContent(RsbObjType.all); + await FetchContent(ObjCategory.all); } - private string GetIDPrefix(RsbObjType objCategory, RsbTab? tab = null, bool toMgmtObj = false) + private string GetIDPrefix(ObjCategory objCategory, RsbTab? tab = null, bool toMgmtObj = false) { string idPref = ""; switch (tab ?? Tab) @@ -280,29 +280,29 @@ } switch (objCategory) { - case RsbObjType.nobj: + case ObjCategory.nobj: idPref += "nwobj"; break; - case RsbObjType.nsrv: + case ObjCategory.nsrv: idPref += "svc"; break; - case RsbObjType.user: + case ObjCategory.user: idPref += "user"; break; } return idPref; } - private string GetID(RsbObjType objCategory, long objId) + private string GetID(ObjCategory objCategory, long objId) { return GetIDPrefix(objCategory) + objId; } - private string GetIconClass(RsbObjType objCategory, string type) + @* private string GetIconClass(ObjCategory objCategory, string type) { switch (type) { - case "group" when objCategory == RsbObjType.user: + case "group" when objCategory == ObjCategory.user: return "oi oi-people"; case "group": return "oi oi-list-rich"; @@ -315,42 +315,42 @@ default: switch (objCategory) { - case RsbObjType.nobj: + case ObjCategory.nobj: return "oi oi-laptop"; - case RsbObjType.nsrv: + case ObjCategory.nsrv: return "oi oi-wrench"; - case RsbObjType.user: + case ObjCategory.user: return "oi oi-person"; } return ""; } - } + } *@ - RenderFragment AddLinkToObject(RsbObjType objCategory, long objId, string type, string name) + RenderFragment AddLinkToObject(ObjCategory objCategory, long objId, string type, string name) { RsbTab targetTab = Tab == RsbTab.all ? RsbTab.all : RsbTab.report; string htmlObjRefPrefix = GetIDPrefix(objCategory, targetTab, true); string page = Recert ? "certification" : "report"; - return @ @(name); + return @ @(name); } - private async Task HandleUncollapse(RsbObjType objCategory) + private async Task HandleUncollapse(ObjCategory objCategory) { if (Tab != RsbTab.rule) await FetchContent(objCategory); anchorNavToRSB?.ScrollToFragmentIfMatch(GetIDPrefix(objCategory)); } - private async Task FetchContent(RsbObjType objCategory) + private async Task FetchContent(ObjCategory objCategory) { try { - if (Tab == RsbTab.rule && objCategory != RsbObjType.all) + if (Tab == RsbTab.rule && objCategory != ObjCategory.all) return; - if (objCategory == RsbObjType.all && !ContentIsDetailed || objCategory == RsbObjType.nobj && !nobjDetailed || objCategory == RsbObjType.nsrv && !nsrvDetailed || objCategory == RsbObjType.user && !userDetailed) + if (objCategory == ObjCategory.all && !ContentIsDetailed || objCategory == ObjCategory.nobj && !nobjDetailed || objCategory == ObjCategory.nsrv && !nsrvDetailed || objCategory == ObjCategory.user && !userDetailed) { if(FetchObjects != null) { @@ -366,13 +366,13 @@ { switch (objCategory) { - case RsbObjType.all: + case ObjCategory.all: m = m_updated; break; - case RsbObjType.nobj: + case ObjCategory.nobj: m.Objects = m_updated.Objects; break; - case RsbObjType.nsrv: + case ObjCategory.nsrv: m.Services = m_updated.Services; break; - case RsbObjType.user: + case ObjCategory.user: m.Users = m_updated.Users; break; } @@ -400,9 +400,9 @@ } } - nobjDetailed = nobjDetailed || objCategory == RsbObjType.all || objCategory == RsbObjType.nobj; - nsrvDetailed = nsrvDetailed || objCategory == RsbObjType.all || objCategory == RsbObjType.nsrv; - userDetailed = userDetailed || objCategory == RsbObjType.all || objCategory == RsbObjType.user; + nobjDetailed = nobjDetailed || objCategory == ObjCategory.all || objCategory == ObjCategory.nobj; + nsrvDetailed = nsrvDetailed || objCategory == ObjCategory.all || objCategory == ObjCategory.nsrv; + userDetailed = userDetailed || objCategory == ObjCategory.all || objCategory == ObjCategory.user; await InvokeAsync(StateHasChanged); } diff --git a/roles/ui/files/FWO.UI/Shared/ObjectGroupCollection.razor b/roles/ui/files/FWO.UI/Shared/ObjectGroupCollection.razor index a7be6a9ad..44a847e01 100644 --- a/roles/ui/files/FWO.UI/Shared/ObjectGroupCollection.razor +++ b/roles/ui/files/FWO.UI/Shared/ObjectGroupCollection.razor @@ -17,7 +17,7 @@ @code { [Parameter] - public Func, long, bool, Task>? FetchObjects { get; set; } + public Func, long, bool, Task>? FetchObjects { get; set; } [Parameter] public bool Recert { get; set; } diff --git a/roles/ui/files/FWO.UI/Shared/RightSidebar.razor b/roles/ui/files/FWO.UI/Shared/RightSidebar.razor index db370acee..13e94f7c8 100644 --- a/roles/ui/files/FWO.UI/Shared/RightSidebar.razor +++ b/roles/ui/files/FWO.UI/Shared/RightSidebar.razor @@ -116,7 +116,7 @@ }); } - public async Task FetchContent(RsbTab rsbTab, RsbObjType objType, Func callback, long id = 0, bool nat = false) + public async Task FetchContent(RsbTab rsbTab, ObjCategory objType, Func callback, long id = 0, bool nat = false) { Log.WriteDebug("Fetching Content..", $"nat: {nat}"); @@ -139,16 +139,16 @@ }; switch (objType) { - case RsbObjType.all: + case ObjCategory.all: query = ObjectQueries.getAllObjectDetails; break; - case RsbObjType.nobj: + case ObjCategory.nobj: query = ObjectQueries.getNetworkObjectDetails; break; - case RsbObjType.nsrv: + case ObjCategory.nsrv: query = ObjectQueries.getNetworkServiceObjectDetails; break; - case RsbObjType.user: + case ObjCategory.user: query = ObjectQueries.getUserDetails; break; } @@ -174,7 +174,7 @@ { "limit", userConfig.ElementsPerFetch }, { "offset", (int)0 } }; - if(objType == RsbObjType.all) + if(objType == ObjCategory.all) { if (nat) query = RuleQueries.getNatRuleDetails; diff --git a/roles/ui/files/FWO.UI/wwwroot/css/site.css b/roles/ui/files/FWO.UI/wwwroot/css/site.css index afabb90b4..61644ffa7 100644 --- a/roles/ui/files/FWO.UI/wwwroot/css/site.css +++ b/roles/ui/files/FWO.UI/wwwroot/css/site.css @@ -83,6 +83,12 @@ app { color: red; } +.alert-warning-override { + color:#732d00; + background-color:#ffe494; + border-color:#f5d0b8 +} + .col-form-label-marg7 { margin-left: 7px; /* hier wird der Abstand zwischen Checkbox und Label definiert */ }