Skip to content

Github Audit Logs

Overview

Github audit logs represents activities on your Github organization.

This setup guide describes how to forward audit logs from Github to Sekoia.io.

The following Sekoia.io built-in rules match the intake Github Audit logs. 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 Github Audit logs on ATT&CK Navigator

Cryptomining

Detection of domain names potentially related to cryptomining activities.

  • 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
GitHub Delete Action

Detects a Delete/Destroy action in GitHub audit logs.

  • Effort: advanced
GitHub Dependabot Or Vulnerability Alerts Disabled

Detects dependabot or vulnerability alerts being disabled. Dependabot performs a scan to detect insecure dependencies, and sends Dependabot alerts.

  • Effort: advanced
GitHub High Risk Configuration Disabled

Detects a configuration being disabled in GitHub. It detects only configuration judged as highly risky if disabled. An organization should adapt this rule according to its environment.

  • Effort: advanced
GitHub New Organization Member

Detects when a member is added or invited to a GitHub organization.

  • Effort: advanced
GitHub Outside Collaborator Detected

Detects an outside collaborator being removed or having its permissions changed.

  • Effort: advanced
Nimbo-C2 User Agent

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

  • Effort: intermediate
Potential Bazar Loader User-Agents

Detects potential Bazar loader communications through the user-agent

  • Effort: elementary
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
Remote Access Tool Domain

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

  • Effort: master
Sekoia.io EICAR Detection

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

  • Effort: master
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

Event Categories

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

Data Source Description
Third-party application logs Github audit logs.

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

Name Values
Kind ``
Category configuration
Type allowed, change, creation, deletion, denied, info, user

Event Samples

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

{
    "message": "{\"@timestamp\": 1685465626150,\"_document_id\": \"ioehzret57biefb87\",\"action\": \"org.block_user\",\"actor\": \"Admin\",\"actor_id\": 6493123,\"actor_location\": {\"country_code\": \"FR\"},\"blocked_user\": \"aaa\",\"created_at\": 1685465626150,\"operation_type\": \"create\",\"org\": \"Test-org\",\"org_id\": 123123995,\"user_agent\": \"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}",
    "event": {
        "action": "org.block_user",
        "category": [
            "configuration"
        ],
        "type": [
            "change",
            "creation",
            "denied",
            "info",
            "user"
        ]
    },
    "@timestamp": "2023-05-30T16:53:46.150000Z",
    "geo": {
        "country_iso_code": "FR"
    },
    "github": {
        "audit_logs": {
            "_document_id": "ioehzret57biefb87",
            "blocked_user": "aaa",
            "operation_type": "create"
        }
    },
    "organization": {
        "id": "123123995",
        "name": "Test-org"
    },
    "related": {
        "user": [
            "Admin"
        ]
    },
    "user": {
        "id": "6493123",
        "name": "Admin"
    },
    "user_agent": {
        "device": {
            "name": "Samsung SM-S906N"
        },
        "name": "Chrome Mobile WebView",
        "original": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36",
        "os": {
            "name": "Android",
            "version": "12"
        },
        "version": "80.0.3987"
    }
}
{
    "message": "{\"@timestamp\": 1686150683340,\"_document_id\": \"w-eifejgjg877jjf\",\"action\": \"org.allow_third_party_access_requests_from_outside_collaborators_disabled\",\"actor\": \"Admin\",\"actor_id\": 6123123,\"actor_location\": {  \"country_code\": \"FR\"},\"created_at\": 1686150683340,\"operation_type\": \"modify\",\"org\": \"Test-org\",\"org_id\": 123123995,\"user_agent\": \"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"  }",
    "event": {
        "action": "org.allow_third_party_access_requests_from_outside_collaborators_disabled",
        "category": [
            "configuration"
        ],
        "type": [
            "change",
            "info"
        ]
    },
    "@timestamp": "2023-06-07T15:11:23.340000Z",
    "geo": {
        "country_iso_code": "FR"
    },
    "github": {
        "audit_logs": {
            "_document_id": "w-eifejgjg877jjf",
            "operation_type": "modify"
        }
    },
    "organization": {
        "id": "123123995",
        "name": "Test-org"
    },
    "related": {
        "user": [
            "Admin"
        ]
    },
    "user": {
        "id": "6123123",
        "name": "Admin"
    },
    "user_agent": {
        "device": {
            "name": "Samsung SM-S906N"
        },
        "name": "Chrome Mobile WebView",
        "original": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36",
        "os": {
            "name": "Android",
            "version": "12"
        },
        "version": "80.0.3987"
    }
}
{
    "message": "{\"@timestamp\": 1686150676330,\"_document_id\": \"s-ioehzret57biefb87\",\"action\": \"members_can_create_public_pages.enable\",\"actor\": \"Admin\",\"actor_id\": 6123123,\"actor_location\": {  \"country_code\": \"FR\"},\"created_at\": 1686150676330,\"operation_type\": \"modify\",\"org\": \"Test-org\",\"org_id\": 123123995,\"user\": \"Admin\",\"user_agent\": \"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\",\"user_id\": 6123123  }",
    "event": {
        "action": "members_can_create_public_pages.enable",
        "category": [
            "configuration"
        ],
        "type": [
            "change",
            "info"
        ]
    },
    "@timestamp": "2023-06-07T15:11:16.330000Z",
    "geo": {
        "country_iso_code": "FR"
    },
    "github": {
        "audit_logs": {
            "_document_id": "s-ioehzret57biefb87",
            "operation_type": "modify",
            "user": "Admin",
            "user_id": 6123123
        }
    },
    "organization": {
        "id": "123123995",
        "name": "Test-org"
    },
    "related": {
        "user": [
            "Admin"
        ]
    },
    "user": {
        "id": "6123123",
        "name": "Admin"
    },
    "user_agent": {
        "device": {
            "name": "Samsung SM-S906N"
        },
        "name": "Chrome Mobile WebView",
        "original": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36",
        "os": {
            "name": "Android",
            "version": "12"
        },
        "version": "80.0.3987"
    }
}
{
    "message": "{\"@timestamp\": 1686150672357,\"_document_id\": \"ioehzret57biefb87\",\"action\": \"org.update_member_repository_invitation_permission\",\"actor\": \"Admin\",\"actor_id\": 6123123,\"actor_location\": {  \"country_code\": \"FR\"},\"created_at\": 1686150672357,\"operation_type\": \"modify\",\"org\": \"Test-org\",\"org_id\": 123123995,\"permission\": false,\"user_agent\": \"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\" }",
    "event": {
        "action": "org.update_member_repository_invitation_permission",
        "category": [
            "configuration"
        ],
        "type": [
            "change",
            "info"
        ]
    },
    "@timestamp": "2023-06-07T15:11:12.357000Z",
    "geo": {
        "country_iso_code": "FR"
    },
    "github": {
        "audit_logs": {
            "_document_id": "ioehzret57biefb87",
            "operation_type": "modify",
            "permission": "false"
        }
    },
    "organization": {
        "id": "123123995",
        "name": "Test-org"
    },
    "related": {
        "user": [
            "Admin"
        ]
    },
    "user": {
        "id": "6123123",
        "name": "Admin"
    },
    "user_agent": {
        "device": {
            "name": "Samsung SM-S906N"
        },
        "name": "Chrome Mobile WebView",
        "original": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36",
        "os": {
            "name": "Android",
            "version": "12"
        },
        "version": "80.0.3987"
    }
}

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.
event.action keyword The action captured by the event.
event.category keyword Event category. The second categorization field in the hierarchy.
event.type keyword Event type. The third categorization field in the hierarchy.
geo.country_iso_code keyword Country ISO code.
geo.country_name keyword Country name.
organization.id keyword Unique identifier for the organization.
organization.name keyword Organization name.
user.email keyword User email address.
user.id keyword Unique identifier of the user.
user.name keyword Short name or login of the user.
user_agent.original keyword Unparsed user_agent string.

Configure

Prerequisites

Creating the Github API key

To create an API key on Github:

  1. On the top right corner, click on your profile picture then on Settings.

    Personal settings

  2. On the Developper Settings, create a Personnal access token (classic) with read access to the audit_logs.

    Developer settings

    Personal tokens

    Generate new token

    Generate new token

  3. Validate the configuration and save the token for the configuration of the connector.

Create the Github PEM file

  1. On the top right corner, click on your profile picture then on Your organizations.

    Users organizations

  2. Select organization you want to create PEM file for:

    Select organization

  3. Scroll to Developer settings and select Github apps:

    Org developer settings

  4. Click on edit Github app:

    Edit Github app

    • Make sure you have all necessary rights (#1)
    • After that click on edit (#2)
  5. Go to General section:

    General

  6. Scroll to Private keys section and click on Generate a private key:

    Private keys

  7. Follow all necessary instructions and save PEM file for the configuration of the connector.

  8. Scroll up and copy App ID for the configuration of the connector.

    App ID

  9. As a result you should have App ID and PEM file for the configuration of the connector.

Create the intake in Sekoia.io

Go to the intake page and create a new intake from the format Github audit logs. Copy the intake key.

Pull events

To start to pull events, you have to:

  1. Go to the playbooks page and create a new playbook with the Fetch new audit logs from Github trigger
  2. Set up the module configuration with the Github organization and the APIkey. Set up the trigger configuration with the intake key
  3. Start the playbook and enjoy your events