New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore uppercase and lowercase sorting an array #814

Merged
merged 4 commits into from Jul 13, 2018

Conversation

Projects
3 participants
@Lifka
Member

Lifka commented Jun 19, 2018

Hi team,

thir PR fixes the issue wazuh/wazuh-api#112.

Before:

$ curl -u foo:bar -k "http://127.0.0.1:55000/decoders?sort=name&pretty" -s | grep name
            [...]
            "name": "Sysmon-EventID#6",
            "name": "Sysmon-EventID#6",
            "name": "Sysmon-EventID#7",
            "name": "Sysmon-EventID#7",
            "name": "Sysmon-EventID#8",
            "name": "Sysmon-EventID#8",
            "name": "Windows-defender#1116",
            "name": "Windows-defender#1116",
               "order": "defender.name, defender.id, defender.severity, defender.category, defender.pathfound",
            "name": "Windows-defender#1116",
               "order": "defender.detectiontype, defender.detectionsource, srcuser, defender.processname",
            "name": "Windows-defender#1117",
            "name": "Windows-defender#1117",
               "order": "defender.name, defender.id, defender.severity, defender.category, defender.path",
            "name": "Windows-defender#1117",
            "name": "Windows-defender#1117",
               "order": "defender.processname, defender.action",
            "name": "agent-buffer",
            "name": "agent-restart",
            "name": "agent-upgrade",
               "order": "agent.id, agent.name, status"
            "name": "agent-upgrade",
            "name": "agent-upgrade",
            [...]
            "name": "roundcube",
            "name": "roundcube-denied-new",
            "name": "roundcube-denied-old",
            "name": "roundcube-success",
            "name": "rsa-auth-manager",
               "program_name": null,
            "name": "rsa-auth-manager-auth-login",
            "name": "rshd",
               "program_name": "^rshd$"
            "name": "rshd-illegal-connection",
            "name": "sendmail-pre-greeting",
            "name": "sendmail-reject",
               "program_name": "^sendmail|^sm-mta|^sm-msp-queue"
            "name": "sendmail-reject-dns",
            "name": "sendmail-reject-nodns",
            "name": "serv-u",
            "name": "serv-u_type",
            "name": "serv-u_type-session",
            "name": "serv-u_type-session_dir_created",
            "name": "serv-u_type-session_dir_deleted",
            "name": "serv-u_type-session_download",
            "name": "serv-u_type-session_file_deleted",
            "name": "serv-u_type-session_ip",
            "name": "serv-u_type-session_renamed",
               "regex": "^[(\\d\\d)] \\.+ - \\((\\d+)\\) Renamed \"(\\S+)\" to \"(\\S+)\"",
               "prematch": "^\\(\\d+\\) Renamed",
            "name": "serv-u_type-session_upload",
            "name": "serv-u_type-session_usr",
            "name": "serv-u_type-session_usr_invalid",
            "name": "serv-u_type-session_usr_invalid_too",
            "name": "serv-u_type_event",
            "name": "suhosin",
               "program_name": "^suhosin",
               "fts": "name, location, id"
            "name": "symantec-av",
               "fts": "name, location, id, system_name, extra_data",
               "order": "id, system_name, extra_data",
            "name": "symantec-websecurity",
            "name": "telnetd",
            [...]

Now:

$ curl -u foo:bar -k "http://127.0.0.1:55000/decoders?sort=name&pretty" -s | grep name
            [...]
            "name": "roundcube",
            "name": "roundcube-denied-new",
            "name": "roundcube-denied-old",
            "name": "serv-u_type-session_usr_invalid",
            "name": "sqlserver-loginsuccess",
            "name": "sqlserver-serverprocessid",
            "name": "ssh-pam-error",
            "name": "ssh-reverse-mapping",
            "name": "ssh-scan",
            "name": "sudo2-fields",
               "fts": "name,srcuser,location",
               "program_name": null,
            "name": "sudo2-fields",
            "name": "sudo2-fields",
            "name": "sudo2-fields",
            "name": "sudo2-fields",
            "name": "sudo2-fields",
            "name": "suhosin",
               "program_name": "^suhosin",
               "fts": "name, location, id"
            "name": "symantec-av",
               "fts": "name, location, id, system_name, extra_data",
               "order": "id, system_name, extra_data",
            "name": "symantec-websecurity",
            "name": "Sysmon-EventID#1",
            "name": "Sysmon-EventID#11",
            "name": "Sysmon-EventID#11",
               "regex": "File created: (\\.*)\\s+UtcTime: (\\.*)\\s+ProcessGuid: (\\.*)\\s+ProcessId: (\\.*)\\s+Image: (\\.*)\\s+TargetFilename: (\\.*)\\s+CreationUtcTime: (\\.*)",
               "order": "sysmon.filecreated, sysmon.utctime, sysmon.processguid, sysmon.processid, sysmon.image, sysmon.targetfilename, sysmon.creationutctime ",
            "name": "Sysmon-EventID#15",
            "name": "Sysmon-EventID#15",
               "regex": "ProcessId: (\\.*)\\s+Image: (\\.*)\\s+TargetFilename: (\\.*)\\s+CreationUtcTime: (\\.*)\\s+Hash: \\S+=(\\S*)",
               "order": "sysmon.processId, sysmon.image, sysmon.targetfilename, sysmon.creationUtcTime, sysmon.hash",
            "name": "Sysmon-EventID#1_new",
            "name": "Sysmon-EventID#1_new",
            "name": "Sysmon-EventID#1_new",
            "name": "Sysmon-EventID#1_new",
            "name": "Sysmon-EventID#2",
            "name": "Sysmon-EventID#2",
               "regex": "Image: (\\.*)\\s+TargetFilename: (\\.*)\\s+CreationUtcTime: (\\.*)\\s+PreviousCreationUtcTime: (\\.*)",
               "order": "sysmon.image, sysmon.targetfilename, sysmon.creationUtcTime, sysmon.previousCreationUtcTime",
            "name": "Sysmon-EventID#3",
            "name": "Sysmon-EventID#3",
               "regex": "ProcessGuid: (\\.*) \\s*ProcessId: (\\.*) \\s*Image: (\\.*)\\s+User: (\\.*)\\s+Protocol: (\\S*)\\s+Initiated: (\\.*) \\s*SourceIsIpv6: (\\.*) \\s*SourceIp: (\\S*)\\s+SourceHostname: (\\.*) \\s*SourcePort: (\\S*)\\s+SourcePortName:\\.+DestinationIsIpv6: (\\.*) \\s*DestinationIp: (\\S*)\\s+DestinationHostname: (\\.*) \\s*DestinationPort: (\\S*)",
               "order": "sysmon.processGuid, sysmon.processId, sysmon.image, srcuser, protocol, sysmon.initiated, sysmon.sourceIsIpv6, srcip, sysmon.sourceHostname, srcport, sysmon.destinationIsIpv6, dstip, sysmon.destinationHostname, dstport",
            "name": "Sysmon-EventID#4",
            "name": "Sysmon-EventID#4",
            "name": "Sysmon-EventID#5",
            "name": "Sysmon-EventID#5",
            "name": "Sysmon-EventID#6",
            "name": "Sysmon-EventID#6",
            "name": "Sysmon-EventID#7",
            "name": "Sysmon-EventID#7",
            "name": "Sysmon-EventID#8",
            "name": "Sysmon-EventID#8",
            "name": "telnetd",
               "program_name": "^telnetd|^in.telnetd"
            "name": "telnetd-ip",
            [...]

Regards,
Javier.

@Lifka Lifka added this to In review in Wazuh TBD via automation Jun 19, 2018

@Lifka Lifka requested a review from mgmacias95 Jun 19, 2018

Show outdated Hide outdated framework/wazuh/utils.py

@jesuslinares jesuslinares removed this from In review in Wazuh TBD Jul 5, 2018

@jesuslinares jesuslinares added this to In review in Wazuh 3.5 via automation Jul 5, 2018

@mgmacias95 mgmacias95 changed the base branch from 3.3 to 3.5 Jul 9, 2018

@jesuslinares jesuslinares merged commit 87bafb0 into 3.5 Jul 13, 2018

Wazuh 3.5 automation moved this from In review to Done Jul 13, 2018

@jesuslinares jesuslinares deleted the fix-sort-array-uppercase branch Jul 13, 2018

mgmacias95 added a commit to wazuh/wazuh-api that referenced this pull request Jul 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment