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.

Warning

Important note - This format is currently in beta. We highly value your feedback to improve its performance.

Benefit from SEKOIA.IO built-in rules and upgrade Github Audit Logs [BETA] with the following detection capabilities out-of-the-box.

SEKOIA.IO x Github Audit Logs [BETA] on ATT&CK Navigator

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
RYUK Ransomeware - martinstevens Username

Detects user name "martinstevens". Wizard Spider is used to add the user name "martinstevens" to the AD of its victims. It was observed in several campaigns; in 2019 and 2020.

  • Effort: elementary

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 event
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"
        ],
        "kind": "event",
        "type": [
            "info",
            "change",
            "denied",
            "creation",
            "user"
        ]
    },
    "@timestamp": "2023-05-30T16:53:46.150000Z",
    "geo": {
        "country_iso_code": "FR"
    },
    "organization": {
        "id": "123123995",
        "name": "Test-org"
    },
    "user": {
        "id": "6493123",
        "name": "Admin"
    },
    "user_agent": {
        "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",
        "device": {
            "name": "Samsung SM-S906N"
        },
        "name": "Chrome Mobile WebView",
        "version": "80.0.3987",
        "os": {
            "name": "Android",
            "version": "12"
        }
    },
    "github": {
        "audit_logs": {
            "_document_id": "ioehzret57biefb87",
            "blocked_user": "aaa",
            "operation_type": "create"
        }
    },
    "related": {
        "user": [
            "Admin"
        ]
    }
}
{
    "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"
        ],
        "kind": "event",
        "type": [
            "info",
            "change"
        ]
    },
    "@timestamp": "2023-06-07T15:11:23.340000Z",
    "geo": {
        "country_iso_code": "FR"
    },
    "organization": {
        "id": "123123995",
        "name": "Test-org"
    },
    "user": {
        "id": "6123123",
        "name": "Admin"
    },
    "user_agent": {
        "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",
        "device": {
            "name": "Samsung SM-S906N"
        },
        "name": "Chrome Mobile WebView",
        "version": "80.0.3987",
        "os": {
            "name": "Android",
            "version": "12"
        }
    },
    "github": {
        "audit_logs": {
            "_document_id": "w-eifejgjg877jjf",
            "operation_type": "modify"
        }
    },
    "related": {
        "user": [
            "Admin"
        ]
    }
}
{
    "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"
        ],
        "kind": "event",
        "type": [
            "info",
            "change"
        ]
    },
    "@timestamp": "2023-06-07T15:11:16.330000Z",
    "geo": {
        "country_iso_code": "FR"
    },
    "organization": {
        "id": "123123995",
        "name": "Test-org"
    },
    "user": {
        "id": "6123123",
        "name": "Admin"
    },
    "user_agent": {
        "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",
        "device": {
            "name": "Samsung SM-S906N"
        },
        "name": "Chrome Mobile WebView",
        "version": "80.0.3987",
        "os": {
            "name": "Android",
            "version": "12"
        }
    },
    "github": {
        "audit_logs": {
            "_document_id": "s-ioehzret57biefb87",
            "operation_type": "modify",
            "user": "Admin",
            "user_id": 6123123
        }
    },
    "related": {
        "user": [
            "Admin"
        ]
    }
}
{
    "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"
        ],
        "kind": "event",
        "type": [
            "info",
            "change"
        ]
    },
    "@timestamp": "2023-06-07T15:11:12.357000Z",
    "geo": {
        "country_iso_code": "FR"
    },
    "organization": {
        "id": "123123995",
        "name": "Test-org"
    },
    "user": {
        "id": "6123123",
        "name": "Admin"
    },
    "user_agent": {
        "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",
        "device": {
            "name": "Samsung SM-S906N"
        },
        "name": "Chrome Mobile WebView",
        "version": "80.0.3987",
        "os": {
            "name": "Android",
            "version": "12"
        }
    },
    "github": {
        "audit_logs": {
            "_document_id": "ioehzret57biefb87",
            "operation_type": "modify",
            "permission": "false"
        }
    },
    "related": {
        "user": [
            "Admin"
        ]
    }
}

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.kind keyword The kind of the event. The highest 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