Skip to content

Nginx

Overview

NGINX is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server. It has a lot of features and because it is located between your application and your clients, it can give you a lot of information about either of them.

The following Sekoia.io built-in rules match the intake F5 NGINX. This documentation is updated automatically and is based solely on the fields used by the intake which are checked against our rules. This means that some rules will be listed but might not be relevant with the intake.

SEKOIA.IO x F5 NGINX on ATT&CK Navigator

Bazar Loader DGA (Domain Generation Algorithm)

Detects Bazar Loader domains based on the Bazar Loader DGA

  • Effort: elementary
Burp Suite Tool Detected

Burp Suite is a cybersecurity tool. When used as a proxy service, its purpose is to intercept packets and modify them to send them to the server. Burp Collaborator is a network service that Burp Suite uses to help discover many kinds of vulnerabilities (vulnerabilities scanner).

  • Effort: intermediate
CVE-2018-11776 Apache Struts2

Apache Struts versions 2.3 to 2.3.34 and 2.5 to 2.5.16 suffer from possible Remote Code Execution when alwaysSelectFullNamespace is true (either by user or a plugin like Convention Plugin) and then: results are used with no namespace and in same time, its upper package have no or wildcard namespace and similar to results, same possibility when using url tag which doesn't have value and action set and in same time, its upper package have no or wildcard namespace.

  • Effort: intermediate
CVE-2018-13379 Fortinet Exploit

Detects the successful exploitation of the Fortinet FortiOS CVE-2018-13379. This CVE is one of the most exploited CVEs since 2018. It is exploited by APT threat actors as well as cybercriminals. The exploitation of this CVE lead an unauthenticated user to get full access to FortiOS system file through SSL VPN via specially crafted HTTP resource requests. The exploit read /dev/cmdb/sslvpn_websession file, that contains login and passwords in (clear/text). An HTTP response status code = 200, means the file was successfully accessed. This vulnerability affects FortiOS 5.6.3 to 5.6.7 and FortiOS 6.0.0 to 6.0.4.

  • Effort: advanced
CVE-2019-0604 SharePoint

Detects the exploitation of the SharePoint vulnerability (CVE-2019-0604).

  • Effort: advanced
CVE-2019-11510 Pulse Secure Exploit

Detects the successful exploitation of the Pulse Secure vulnerability CVE-2019-11510. This CVE is one of the most exploited CVEs since 2019. It is exploited by diverse threat actors, leading sometimes in ransomware deployement among these groups: Maze, Conti, Egregor, DoppelPaymer, NetWalker and REvil. But also APT actors such as APT29. The exploitation of this CVE allows a remote, unauthenticated attacker to compromise a vulnerable VPN server. The attacker may be able to gain access to all active users and their plain-text credentials. It may also be possible for the attacker to execute arbitrary commands on each VPN client as it successfully connects to the VPN server. The exploit reads /etc/passwd file to get access to login and passwords in (clear/text). An HTTP response status code = 200, means the file was successfully accessed. This vulnerability affects 8.1R15.1, 8.2 before 8.2R12.1, 8.3 before 8.3R7.1, and 9.0 before 9.0R3.4 products.

  • Effort: elementary
CVE-2019-19781 Citrix NetScaler (ADC)

Detects CVE-2019-19781 exploitation attempt against Citrix NetScaler (ADC), Application Delivery Controller and Citrix Gateway Attack.

  • Effort: elementary
CVE-2019-2725 Oracle Weblogic Exploit

Detects the successful exploitation of a deserialization vulnerability in Oracle Weblogic Server, CVE-2019-2725. This vulnerability affects versions 10.X and 12.1.3 of WebLogic that have the components wls9_async_response.war and wls-wsat.war enabled. It is a remote code execution which can be exploited without authentication via HTTP. An HTTP response status code = 202, means the target is vulnerable, the analyst then has to look in depth to check if a webshell has been uploaded or something else has been done.

  • Effort: elementary
CVE-2020-0688 Microsoft Exchange Server Exploit

Detects the exploitation of CVE-2020-0688. The POC exploit a .NET serialization vulnerability in the Exchange Control Panel (ECP) web page. The vulnerability is due to Microsoft Exchange Server not randomizing the keys on a per-installation basis resulting in them using the same validationKey and decryptionKey values. With knowledge of these, values an attacker can craft a special viewstate to use an OS command to be executed by NT_AUTHORITY\SYSTEM using .NET deserialization. To exploit this vulnerability, an attacker needs to leverage the credentials of an account it had already compromised to authenticate to OWA.

  • Effort: elementary
CVE-2020-1147 SharePoint

Detection of SharePoint vulnerability CVE-2020-1147.

  • Effort: advanced
CVE-2020-14882 Oracle WebLogic Server

Detects the exploitation of the Oracle WebLogic Server vulnerability (CVE-2020-16952).

  • Effort: advanced
CVE-2020-17530 Apache Struts RCE

Detects the exploitation of the Apache Struts RCE vulnerability (CVE-2020-17530).

  • Effort: intermediate
CVE-2020-5902 F5 BIG-IP Exploitation Attempts

Detects the exploitation attempt of the vulnerability found in F5 BIG-IP and described in CVE-2020-5902.

  • Effort: elementary
CVE-2021-20021 SonicWall Unauthenticated Administrator Access

Detects the exploitation of SonicWall Unauthenticated Admin Access.

  • Effort: advanced
CVE-2021-20023 SonicWall Arbitrary File Read

Detects Arbitrary File Read, which can be used with other vulnerabilities as a mean to obtain outputs generated by attackers, or sensitive data.

  • Effort: advanced
CVE-2021-21972 VMware vCenter

The vSphere Client (HTML5) contains a remote code execution vulnerability in a vCenter Server plugin. A malicious actor with network access to port 443 may exploit this issue to execute commands with unrestricted privileges on the underlying operating system that hosts vCenter Server. This affects VMware vCenter Server (7.x before 7.0 U1c, 6.7 before 6.7 U3l and 6.5 before 6.5 U3n) and VMware Cloud Foundation (4.x before 4.2 and 3.x before 3.10.1.2). POST request on the following PATH "/ui/vropspluginui/rest/services/uploadova". If in response body (500) the words it has "uploadFile", that means the vCenter is available to accept files via POST without any restrictions.

  • Effort: intermediate
CVE-2021-21985 VMware vCenter

The VMware vSphere Client (HTML5) contains a remote code execution vulnerability due to lack of input validation in the Virtual SAN Health Check plug-in which is enabled by default in vCenter Server. A malicious actor with network access to port 443 may exploit this issue to execute commands with unrestricted privileges on the underlying operating system that hosts vCenter Server. This affects VMware vCenter Server (7.0 before 7.0 U2b, 6.7 before 6.7 U3n and 6.5 before 6.5 U3p) and VMware Cloud Foundation (4.x before 4.2.1 and 3.x before 3.10.2.1).

  • Effort: advanced
CVE-2021-22123 Fortinet FortiWeb OS Command Injection

Detects Fortinet FortiWeb OS Command Injection (August 2021) vulnerability exploitation attempt. A remote, authenticated attacker can execute arbitrary commands on the system hosting a vulnerable FortiWeb WAF by sending a POST request with the command in the name field. At the time of writing this rule, it would appear that the request would respond in code 500 for a successful exploitation attempt.

  • Effort: advanced
CVE-2021-22893 Pulse Connect Secure RCE Vulnerability

Detects potential exploitation of the authentication by-pass vulnerability that can allow an unauthenticated user to perform remote arbitrary file execution on the Pulse Connect Secure gateway. It is highly recommended to apply the Pulse Secure mitigations and seach for indicators of compromise on affected servers if you are in doubt over the integrity of your Pulse Connect Secure product.

  • Effort: intermediate
CVE-2021-26855 Exchange SSRF

Detects the exploitation of ProyxLogon vulerability on Exchange servers.

  • Effort: advanced
CVE-2021-34473 ProxyShell Attempt

Detects CVE-2021-34473 ProxyShell attempt against Microsoft Exchange Server, Remote Code Execution Vulnerability.

  • Effort: advanced
CVE-2021-41773 Apache 2.4.49 Path Traversal

Detects successful exploitation of the Apache Path Traversal CVE-2021-41773.

  • Effort: advanced
CVE-2021-43798 Grafana Directory Traversal

Grafana version 8.x has a 0day arbitrary file read (with no fix yet) based on a directory traversal vulnerability

  • Effort: intermediate
Cobalt Strike HTTP Default GET beaconing

Detects GET HTTP queries from known Cobalt Strike beacons (source code 4.3)

  • Effort: advanced
Cobalt Strike HTTP Default POST Beaconing

Detects POST HTTP queries from known Cobalt Strike beacons (source code 4.3)

  • Effort: advanced
Covenant Default HTTP Beaconing

Detects potential Covenant communications through the user-agent and specific urls

  • Effort: intermediate
Cryptomining

Detection of domain names potentially related to cryptomining activities.

  • Effort: master
Detect requests to Konni C2 servers

This rule detects requests to Konni C2 servers. These patterns come from an analysis done in 2022, September.

  • Effort: elementary
Discord Suspicious Download

Discord is a messaging application. It allows users to create their own communities to share messages and attachments. Those attachments have little to no overview and can be downloaded by almost anyone, which has been abused by attackers to host malicious payloads.

  • Effort: intermediate
Download Files From Non-Legitimate TLDs

Detects file downloads from non-legitimate TLDs. Additional legitimates TLDs should be filtered according to the business habits.

  • Effort: master
Download Files From Suspicious TLDs

Detects download of certain file types from hosts in suspicious TLDs

  • Effort: master
Dynamic DNS Contacted

Detect communication with dynamic dns domain. This kind of domain is often used by attackers. This rule can trigger false positive in non-controlled environment because dynamic dns is not always malicious.

  • Effort: master
Exfiltration Domain

Detects traffic toward a domain flagged as a possible exfiltration vector.

  • Effort: master
FoggyWeb HTTP Default GET/POST Requests

Detects GET or POST request pattern observed within the first FoggyWeb campaign detected by Microsoft.

  • Effort: advanced
GitLab CVE-2021-22205

Detects GitLab vulnerability CVE-2021-22205 exploitation success. It allows an attacker to do some remote code execution with user git. The HTTP return code 422 indicates a successfull exploitation.

  • Effort: intermediate
Koadic MSHTML Command

Detects Koadic payload using MSHTML module

  • Effort: intermediate
LokiBot Default C2 URL

Detects default C2 URL for trojan LokiBot

  • Effort: elementary
Nimbo-C2 User Agent

Nimbo-C2 Uses an unusual User-Agent format in its implants.

  • Effort: intermediate
Possible Malicious File Double Extension

Detects request to potential malicious file with double extension

  • Effort: elementary
Potential Azure AD Phishing Page (Adversary-in-the-Middle)

Detects an HTTP request to an URL typical of the Azure AD authentication flow, but towards a domain that is not one the legitimate Microsoft domains used for Azure AD authentication.

  • Effort: intermediate
Potential Bazar Loader User-Agents

Detects potential Bazar loader communications through the user-agent

  • Effort: elementary
Potential DNS Tunnel

Detects domain name which is longer than 95 characters. Long domain names are distinctive of DNS tunnels.

  • Effort: advanced
Potential Lemon Duck User-Agent

Detects LemonDuck user agent. The format used two sets of alphabetical characters separated by dashes, for example "User-Agent: Lemon-Duck-[A-Z]-[A-Z]".

  • Effort: elementary
Potential LokiBot User-Agent

Detects potential LokiBot communications through the user-agent

  • Effort: intermediate
Privilege Escalation Awesome Scripts (PEAS)

Detect PEAS privileges escalation scripts and binaries

  • Effort: elementary
ProxyShell Microsoft Exchange Suspicious Paths

Detects suspicious calls to Microsoft Exchange resources, in locations related to webshells observed in campaigns using this vulnerability.

  • Effort: elementary
Raccoon Stealer 2.0 Legitimate Third-Party DLL Download URL

Detects Raccoon Stealer 2.0 malware downloading legitimate third-party DLLs from its C2 server. These legitimate DLLs are used by the information stealer to collect data on the compromised hosts.

  • Effort: elementary
Remote Access Tool Domain

Detects traffic toward a domain flagged as a Remote Administration Tool (RAT).

  • Effort: master
SEKOIA.IO Intelligence Feed

Detect threats based on indicators of compromise (IOCs) collected by SEKOIA's Threat and Detection Research team.

  • Effort: elementary
Sekoia.io EICAR Detection

Detects observables in Sekoia.io CTI tagged as EICAR, which are fake samples meant to test detection.

  • Effort: master
SharePoint Authenticated SSRF

Detects succesful SSRF from an authenticated SharePoint user.

  • Effort: elementary
Suspicious Download Links From Legitimate Services

Detects users clicking on Google docs links to download suspicious files. This technique was used a lot by Bazar Loader in the past.

  • Effort: elementary
Suspicious URI Used In A Lazarus Campaign

Detects suspicious requests to a specific URI, usually on an .asp page. The website is often compromised.

  • Effort: intermediate
TOR Usage Generic Rule

Detects TOR usage globally, whether the IP is a destination or source. TOR is short for The Onion Router, and it gets its name from how it works. TOR intercepts the network traffic from one or more apps on user’s computer, usually the user web browser, and shuffles it through a number of randomly-chosen computers before passing it on to its destination. This disguises user location, and makes it harder for servers to pick him/her out on repeat visits, or to tie together separate visits to different sites, this making tracking and surveillance more difficult. Before a network packet starts its journey, user’s computer chooses a random list of relays and repeatedly encrypts the data in multiple layers, like an onion. Each relay knows only enough to strip off the outermost layer of encryption, before passing what’s left on to the next relay in the list.

  • Effort: master
Telegram Bot API Request

Detects suspicious DNS queries to api.telegram.org used by Telegram Bots of any kind

  • Effort: advanced
TrevorC2 HTTP Communication

Detects TrevorC2 HTTP communication based on the HTTP request URI and the user-agent.

  • Effort: elementary

Event Categories

The following table lists the data source offered by this integration.

Data Source Description
Web logs Nginx logs provide many information like the connected client, the requested resource, the user agent or the response status.

In details, the following table denotes the type of events produced by this integration.

Name Values
Kind ``
Category web
Type ``

Event Samples

Find below few samples of events and how they are normalized by Sekoia.io.

{
    "message": "51.255.128.104 - - [25/Aug/2019:23:59:51 +0000] \"GET /sic/ HTTP/1.1\" 200 537 \"http://app.sekoia.io/sic/\" \"Go-http-client/1.1\"",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2019-08-25T23:59:51Z",
    "http": {
        "request": {
            "method": "GET",
            "referrer": "http://app.sekoia.io/sic/"
        },
        "response": {
            "bytes": 537,
            "status_code": 200
        },
        "version": "1.1"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "ip": [
            "51.255.128.104"
        ]
    },
    "source": {
        "address": "51.255.128.104",
        "ip": "51.255.128.104"
    },
    "url": {
        "original": "/sic/",
        "path": "/sic/"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "Go-http-client",
        "original": "Go-http-client/1.1",
        "os": {
            "name": "Other"
        },
        "version": "1.1"
    }
}
{
    "message": "2019/08/25 23:59:53 [error] 9841#9841: *103137592 connect() failed (111: Connection refused) while connecting to upstream, client: 51.255.128.104, server: api.prod.sekoia.io, request: \"GET /v1/apiauth/auth/health HTTP/1.1\", upstream: \"http://10.110.30.121:80/v1/apiauth/auth/health\", host: \"api.sekoia.io\"",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "error"
        ]
    },
    "@timestamp": "2019-08-25T23:59:53Z",
    "destination": {
        "address": "api.prod.sekoia.io",
        "domain": "api.prod.sekoia.io"
    },
    "error": {
        "message": "connect() failed (111: Connection refused) while connecting to upstream"
    },
    "host": {
        "name": "api.sekoia.io"
    },
    "http": {
        "request": {
            "method": "GET"
        },
        "version": "1.1"
    },
    "log": {
        "level": "error"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "hosts": [
            "10.110.30.121",
            "api.prod.sekoia.io"
        ],
        "ip": [
            "51.255.128.104"
        ]
    },
    "source": {
        "address": "51.255.128.104",
        "ip": "51.255.128.104"
    },
    "url": {
        "domain": "10.110.30.121",
        "original": "/v1/apiauth/auth/health",
        "path": "/v1/apiauth/auth/health",
        "port": 80
    }
}
{
    "message": " rdp.acme.com 1.2.3.4 - - [22/Aug/2019:08:28:30 +0200] \"GET /lib/example.txt?key1=111111&time=1566455309850 HTTP/1.1\" 200 2 \"http://rdp.acme.com/\" \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134\" \"1.2.3.4\" \"0.010\" \"-/-\" \"text/plain\"",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2019-08-22T06:28:30Z",
    "destination": {
        "address": "rdp.acme.com",
        "domain": "rdp.acme.com"
    },
    "http": {
        "request": {
            "method": "GET",
            "referrer": "http://rdp.acme.com/"
        },
        "response": {
            "bytes": 2,
            "mime_type": "text/plain",
            "status_code": 200
        },
        "version": "1.1"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "hosts": [
            "rdp.acme.com"
        ],
        "ip": [
            "1.2.3.4"
        ]
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4"
    },
    "url": {
        "original": "/lib/example.txt?key1=111111&time=1566455309850",
        "path": "/lib/example.txt",
        "query": "key1=111111&time=1566455309850"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "Edge",
        "original": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134",
        "os": {
            "name": "Windows",
            "version": "10"
        },
        "version": "17.17134"
    }
}
{
    "message": "rdp.acme.com 1.2.3.4 - - [12/Feb/2020:17:31:31 +0100] \"GET /app/query/results?query=contentsitename=NDOX%111/AA%20AND%20(doctype:DOCX%20OR%20doctype:PDF)%20AND%20(date=\\x222018-4-4\\x22) HTTP/1.1\" 200 946 \"https://rdp.acme.com/eng\" \"Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko\" \"1.2.3.4\" \"0.184\" \"TLSv1.2/DHE-RSA-AES256-GCM-SHA384\" \"application/json; charset=utf-8\"",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2020-02-12T16:31:31Z",
    "destination": {
        "address": "rdp.acme.com",
        "domain": "rdp.acme.com"
    },
    "http": {
        "request": {
            "method": "GET",
            "referrer": "https://rdp.acme.com/eng"
        },
        "response": {
            "bytes": 946,
            "mime_type": "application/json; charset=utf-8",
            "status_code": 200
        },
        "version": "1.1"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "hosts": [
            "rdp.acme.com"
        ],
        "ip": [
            "1.2.3.4"
        ]
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4"
    },
    "url": {
        "original": "/app/query/results?query=contentsitename=NDOX%111/AA%20AND%20(doctype:DOCX%20OR%20doctype:PDF)%20AND%20(date=\\x222018-4-4\\x22)",
        "path": "/app/query/results",
        "query": "query=contentsitename=NDOX%111/AA%20AND%20(doctype:DOCX%20OR%20doctype:PDF)%20AND%20(date=\\x222018-4-4\\x22)"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "IE",
        "original": "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",
        "os": {
            "name": "Windows",
            "version": "7"
        },
        "version": "11.0"
    }
}
{
    "message": "rdp.acme.com 1.2.3.4 - - [12/Feb/2020:16:32:33 +0100] \"POST /update_pc_list.php?id=PD17TE700&available=y&email=Angele.BLAES@acme.com&login=BLAES&domain=KEY&ip=4.3.2.1 HTTP/1.1\" 200 - \"-\" \"Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)\" \"-\" \"0\" \"-\"",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2020-02-12T15:32:33Z",
    "destination": {
        "address": "rdp.acme.com",
        "domain": "rdp.acme.com"
    },
    "http": {
        "request": {
            "method": "POST"
        },
        "response": {
            "status_code": 200
        },
        "version": "1.1"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "hosts": [
            "rdp.acme.com"
        ],
        "ip": [
            "1.2.3.4"
        ]
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4"
    },
    "url": {
        "original": "/update_pc_list.php?id=PD17TE700&available=y&email=Angele.BLAES@acme.com&login=BLAES&domain=KEY&ip=4.3.2.1",
        "path": "/update_pc_list.php",
        "query": "id=PD17TE700&available=y&email=Angele.BLAES@acme.com&login=BLAES&domain=KEY&ip=4.3.2.1"
    },
    "user_agent": {
        "device": {
            "name": "Spider"
        },
        "name": "Other",
        "original": "Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)",
        "os": {
            "name": "Windows",
            "version": "95"
        }
    }
}
{
    "message": "2023/11/15 12:49:01 [error] 17308#17308: OCSP_basic_verify() failed (SSL: error:27069065:OCSP routines:OCSP_basic_verify:certificate verify error:Verify error:self signed certificate in certificate chain) while requesting certificate status, responder: ocsp.whatever.com, peer: 8.8.8.8:80, certificate: \"/etc/ssl/nginx/certificate.pem\"",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "error"
        ]
    },
    "@timestamp": "2023-11-15T12:49:01Z",
    "error": {
        "message": "OCSP_basic_verify() failed (SSL: error:27069065:OCSP routines:OCSP_basic_verify:certificate verify error:Verify error:self signed certificate in certificate chain) while requesting certificate status"
    },
    "log": {
        "level": "error"
    },
    "nginx": {
        "server": {
            "certificate": {
                "directory": "/etc/ssl/nginx",
                "extension": "pem",
                "name": "certificate.pem",
                "path": "/etc/ssl/nginx/certificate.pem"
            }
        }
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "hosts": [
            "8.8.8.8"
        ]
    },
    "tls": {
        "server": {
            "x509": {
                "issuer": {
                    "common_name": [
                        "ocsp.whatever.com"
                    ]
                }
            }
        }
    },
    "url": {
        "domain": "8.8.8.8",
        "port": 80
    }
}
{
    "message": "2023/11/15 12:49:01 [warn] 17308#17308: no resolver defined to resolve ocsp.whatever.com while requesting certificate status, responder: ocsp.whatever.com, certificate: \"/etc/ssl/nginx/certificate.pem\"",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "error"
        ]
    },
    "@timestamp": "2023-11-15T12:49:01Z",
    "error": {
        "message": "no resolver defined to resolve ocsp.whatever.com while requesting certificate status"
    },
    "log": {
        "level": "warn"
    },
    "nginx": {
        "server": {
            "certificate": {
                "directory": "/etc/ssl/nginx",
                "extension": "pem",
                "name": "certificate.pem",
                "path": "/etc/ssl/nginx/certificate.pem"
            }
        }
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "tls": {
        "server": {
            "x509": {
                "issuer": {
                    "common_name": [
                        "ocsp.whatever.com"
                    ]
                }
            }
        }
    }
}
{
    "message": "8.8.8.8 - - [15/Nov/2023:12:49:02 +0100] \"\\x01\\x01\\x00A\\x01\\x01\\xA1\\x1A0\\x00\" 400 150 \"-\" \"-\" 0.226 - .",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2023-11-15T11:49:02Z",
    "error": {
        "message": "HTTP error: bad request ('\\x01\\x01\\x00A\\x01\\x01\\xA1\\x1A0\\x00')."
    },
    "http": {
        "response": {
            "bytes": 150,
            "status_code": 400
        }
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "ip": [
            "8.8.8.8"
        ]
    },
    "source": {
        "address": "8.8.8.8",
        "ip": "8.8.8.8"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "Other",
        "original": "-",
        "os": {
            "name": "Other"
        }
    }
}
{
    "message": "{\"server_name\":\"rdp.acme.com\",\"server_addr\":\"5.6.7.8\",\"remote_addr\":\"1.2.3.4\",\"remote_user\":\"\",\"time_local\":\"02/Jun/2020:13:07:18 +0200\",\"request\":\"DELETE /blobstore/aaa/bbb/530fd9ee-23af-4d4e-a9e4-0b7280ace286/document.tgz HTTP/1.1\",\"status\":\"204\",\"body_bytes_sent\":\"0\",\"http_referer\":\"\",\"http_user_agent\":\"Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko\",\"proxy_add_x_forwarded_for\":\"1.2.3.4\",\"request_time\":\"0.007\",\"ssl_protocol\":\"\",\"ssl_cipher\":\"\",\"sent_http_content_type\":\"\"}",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "duration": 7000000.0,
        "outcome": "success",
        "type": [
            "error"
        ]
    },
    "@timestamp": "2020-06-02T11:07:18Z",
    "action": {
        "name": "DELETE",
        "outcome": "success"
    },
    "destination": {
        "address": "rdp.acme.com",
        "domain": "rdp.acme.com",
        "ip": "5.6.7.8"
    },
    "http": {
        "request": {
            "method": "DELETE"
        },
        "response": {
            "bytes": 0,
            "status_code": 204
        },
        "version": "1.1"
    },
    "network": {
        "forwarded_ip": "1.2.3.4"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "hosts": [
            "rdp.acme.com"
        ],
        "ip": [
            "1.2.3.4",
            "5.6.7.8"
        ]
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4"
    },
    "url": {
        "original": "/blobstore/aaa/bbb/530fd9ee-23af-4d4e-a9e4-0b7280ace286/document.tgz",
        "path": "/blobstore/aaa/bbb/530fd9ee-23af-4d4e-a9e4-0b7280ace286/document.tgz"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "IE",
        "original": "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",
        "os": {
            "name": "Windows",
            "version": "7"
        },
        "version": "11.0"
    }
}
{
    "message": "{ \"timestamp\": \"2020-06-04T11:17:10+02:00\", \"remote_addr\": \"1.2.3.4\", \"body_bytes_sent\": 36, \"request_time\": 0.003, \"response_status\": 404, \"request\": \"GET /rest/plugins/1.0/com.atlassian.jira.plugins.jira-slack-server-integration-plugin-key/media/plugin-icon HTTP/1.1\", \"request_method\": \"GET\", \"host\": \"rdp.acme.com\", \"http_scheme\": \"https\", \"upstream_cache_status\": \"-\", \"upstream_addr\": \"9.8.7.6:38080\", \"http_x_forwarded_for\": \"-\", \"http_referrer\": \"https://rdp.acme.com/plugins/servlet/project-config/PVC/summary\", \"http_user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36\", \"http_version\": \"HTTP/1.1\", \"nginx_access\": true }",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "duration": 3000000.0,
        "outcome": "failure",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2020-06-04T09:17:10Z",
    "action": {
        "name": "GET",
        "outcome": "failure"
    },
    "destination": {
        "address": "rdp.acme.com",
        "domain": "rdp.acme.com",
        "ip": "9.8.7.6",
        "port": 38080
    },
    "http": {
        "request": {
            "method": "GET",
            "referrer": "https://rdp.acme.com/plugins/servlet/project-config/PVC/summary"
        },
        "response": {
            "bytes": 36,
            "status_code": 404
        },
        "version": "1.1"
    },
    "network": {
        "protocol": "https"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "hosts": [
            "rdp.acme.com"
        ],
        "ip": [
            "1.2.3.4",
            "9.8.7.6"
        ]
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4"
    },
    "url": {
        "original": "/rest/plugins/1.0/com.atlassian.jira.plugins.jira-slack-server-integration-plugin-key/media/plugin-icon",
        "path": "/rest/plugins/1.0/com.atlassian.jira.plugins.jira-slack-server-integration-plugin-key/media/plugin-icon"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "Chrome",
        "original": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
        "os": {
            "name": "Windows",
            "version": "10"
        },
        "version": "81.0.4044"
    }
}
{
    "message": "{ \"timestamp\": \"2020-05-27T17:13:08+02:00\", \"remote_addr\": \"1.2.3.4\", \"body_bytes_sent\": 441, \"request_time\": 0.008, \"response_status\": 200, \"request\": \"GET /nuxeo/site/api/v1/automation/Bulk.RunAction/@async/2c9ebc2e-90a9-49bf-a723-f816eeb565e5/status HTTP/1.1\", \"request_method\": \"GET\", \"host\": \"acme.com\", \"http_scheme\": \"http\", \"upstream_cache_status\": \"-\", \"upstream_addr\": \"9.8.7.6:8080\", \"http_x_forwarded_for\": \"-\", \"http_referrer\": \"http://acme.com/nuxeo/ui/\", \"http_user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36\", \"http_version\": \"HTTP/1.1\", \"nginx_access\": true }",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "duration": 8000000.0,
        "outcome": "success",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2020-05-27T15:13:08Z",
    "action": {
        "name": "GET",
        "outcome": "success"
    },
    "destination": {
        "address": "acme.com",
        "domain": "acme.com",
        "ip": "9.8.7.6",
        "port": 8080
    },
    "http": {
        "request": {
            "method": "GET",
            "referrer": "http://acme.com/nuxeo/ui/"
        },
        "response": {
            "bytes": 441,
            "status_code": 200
        },
        "version": "1.1"
    },
    "network": {
        "protocol": "http"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "hosts": [
            "acme.com"
        ],
        "ip": [
            "1.2.3.4",
            "9.8.7.6"
        ]
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4"
    },
    "url": {
        "original": "/nuxeo/site/api/v1/automation/Bulk.RunAction/@async/2c9ebc2e-90a9-49bf-a723-f816eeb565e5/status",
        "path": "/nuxeo/site/api/v1/automation/Bulk.RunAction/@async/2c9ebc2e-90a9-49bf-a723-f816eeb565e5/status"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "Chrome",
        "original": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
        "os": {
            "name": "Windows",
            "version": "10"
        },
        "version": "81.0.4044"
    }
}
{
    "message": "{ \"timestamp\": \"2020-08-04T10:57:00+02:00\", \"remote_addr\": \"13.49.125.139\", \"body_bytes_sent\": 18752, \"request_time\": 0.000, \"response_status\": 403, \"request\": \"GET /.git/HEAD HTTP/1.1\", \"request_method\": \"GET\", \"host\": \"185.189.174.2\", \"http_scheme\": \"http\", \"upstream_cache_status\": \"-\", \"upstream_addr\": \"-\", \"http_x_forwarded_for\": \"-\", \"http_referrer\": \"-\", \"http_user_agent\": \"curl/7.47.0\", \"http_version\": \"HTTP/1.1\", \"nginx_access\": true }",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "duration": 0.0,
        "outcome": "failure",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2020-08-04T08:57:00Z",
    "action": {
        "name": "GET",
        "outcome": "failure"
    },
    "destination": {
        "address": "185.189.174.2",
        "ip": "185.189.174.2"
    },
    "http": {
        "request": {
            "method": "GET"
        },
        "response": {
            "bytes": 18752,
            "status_code": 403
        },
        "version": "1.1"
    },
    "network": {
        "protocol": "http"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "ip": [
            "13.49.125.139",
            "185.189.174.2"
        ]
    },
    "source": {
        "address": "13.49.125.139",
        "ip": "13.49.125.139"
    },
    "url": {
        "original": "/.git/HEAD",
        "path": "/.git/HEAD"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "curl",
        "original": "curl/7.47.0",
        "os": {
            "name": "Other"
        },
        "version": "7.47.0"
    }
}
{
    "message": "8.8.8.8 - - [15/Nov/2023:12:49:15 +0100] \"POST /path/to/url HTTP/1.1\" 200 6390 \"https://example.of.address/12345\" \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/1.0.0.0 Safari/537.36 Edg/1.0.0.0\" 0.239 0.223 .",
    "event": {
        "category": [
            "web"
        ],
        "dataset": "access",
        "type": [
            "access"
        ]
    },
    "@timestamp": "2023-11-15T11:49:15Z",
    "http": {
        "request": {
            "method": "POST",
            "referrer": "https://example.of.address/12345"
        },
        "response": {
            "bytes": 6390,
            "status_code": 200
        },
        "version": "1.1"
    },
    "observer": {
        "product": "nginx",
        "type": "WEB server",
        "vendor": "F5"
    },
    "related": {
        "ip": [
            "8.8.8.8"
        ]
    },
    "source": {
        "address": "8.8.8.8",
        "ip": "8.8.8.8"
    },
    "url": {
        "original": "/path/to/url",
        "path": "/path/to/url"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "Edge",
        "original": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/1.0.0.0 Safari/537.36 Edg/1.0.0.0",
        "os": {
            "name": "Windows",
            "version": "10"
        },
        "version": "1.0.0"
    }
}

Extracted Fields

The following table lists the fields that are extracted, normalized under the ECS format, analyzed and indexed by the parser. It should be noted that infered fields are not listed.

Name Type Description
@timestamp date Date/time when the event originated.
action.name keyword The action name
action.outcome keyword The action outcome
destination.address keyword Destination network address.
destination.domain keyword The domain name of the destination.
destination.ip ip IP address of the destination.
destination.port long Port of the destination.
error.message match_only_text Error message.
event.category keyword Event category. The second categorization field in the hierarchy.
event.dataset keyword Name of the dataset.
event.duration long Duration of the event in nanoseconds.
event.type keyword Event type. The third categorization field in the hierarchy.
host.name keyword Name of the host.
http.request.method keyword HTTP request method.
http.request.referrer keyword Referrer for this HTTP request.
http.response.bytes long Total size in bytes of the response (body and headers).
http.response.mime_type keyword Mime type of the body of the response.
http.response.status_code long HTTP response status code.
http.version keyword HTTP version.
log.level keyword Log level of the log event.
network.forwarded_ip ip Host IP address when the source IP address is the proxy.
network.protocol keyword Application protocol name.
nginx.server.certificate.directory keyword The directory containing the certificate
nginx.server.certificate.extension keyword certificate extension
nginx.server.certificate.name keyword The certificate name
nginx.server.certificate.path keyword The path to the certificate
observer.product keyword The product name of the observer.
observer.type keyword The type of the observer the data is coming from.
observer.vendor keyword Vendor name of the observer.
source.address keyword Source network address.
source.ip ip IP address of the source.
source.user.name keyword Short name or login of the user.
tls.server.x509.issuer.common_name keyword List of common name (CN) of issuing certificate authority.
url.domain keyword Domain of the url.
url.full wildcard Full unparsed URL.
url.original wildcard Unmodified original url as seen in the event source.
url.path wildcard Path of the request, such as "/search".
url.port long Port of the request, such as 443.
url.scheme keyword Scheme of the url.
url.username keyword Username of the request.
user_agent.original keyword Unparsed user_agent string.

Configure

There are 2 methods to collect NGINX Logs:

  1. You can use a local Rsyslog to read log files and send them directly to Sekoia.io or through a concentrator.
  2. You can configure NGINX to forwards logs using syslog and the UDP protocol to a concentrator.

Method 1: local Rsyslog method

The following snippet is an illustration of rsyslog configuration to monitor nginx's error.log and access.log files.

# error log
$InputFileName /var/log/nginx/error.log
$InputFileTag nginx:
$InputFileStateFile stat-nginx-error
$InputFileSeverity error
$InputFileFacility local5
$InputFilePollInterval 1
$InputRunFileMonitor

# access log
$InputFileName /var/log/nginx/access.log
$InputFileTag nginx:
$InputFileStateFile stat-nginx-access
$InputFileSeverity notice
$InputFileFacility local5
$InputFilePollInterval 1
$InputRunFileMonitor

The reader can consult the Rsyslog Transport documentation to forward these logs to Sekoia.io.

Method 2: configure NGINX to forwards logs using syslog and the UDP protocol

This method is simplier as you don't need to set up a Rsyslog to forward logs. To configure NGINX to forward logs to an IP with syslog and the UDP protocol, please add these lines in /etc/nginx/nginx.conf:

access_log syslog:server=127.0.0.1:20517,tag=nginx;
error_log syslog:server=127.0.0.1:20517,tag=nginx;

Further Reading