Skip to content

[New Rule] Azure Subscription Permission Elevation #1665

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

Conversation

austinsonger
Copy link
Contributor

@austinsonger austinsonger commented Dec 15, 2021

Issues

Resolves #1630

Summary

{
  "_id": "06d60dfcfaaba0383ad312f7e1601a74033b27e83a9ff0da7435be48579e28fd",
  "_index": ".siem-signals-default-000001",
  "_score": "1",
  "_type": "_doc",
  "@timestamp": "2021-12-15T01:31:15.944Z",
  "agent": {
    "ephemeral_id": "bf4a9636-200e-4e55-ba76-e6c0729fbdc3",
    "hostname": "localhost",
    "id": "9cb9acc4-fb1f-431b-bc2b-60d8f1377bf2",
    "name": "localhost",
    "type": "filebeat",
    "version": "7.15.2"
  },
  "azure-eventhub": {
    "consumer_group": "$Default",
    "enqueued_time": "2021-12-15T01:29:58.807Z",
    "eventhub": "collection01",
    "offset": "17184500896",
    "sequence_number": "1356"
  },
  "azure": {
    "activitylogs": {
      "category": "Administrative",
      "event_category": "Administrative",
      "identity": {
        "authorization": {
          "action": "Microsoft.Authorization/classicAdministrators/write",
          "scope": "/subscriptions/82206d98-e2b8-46f5-955c-3006837acdea/providers/Microsoft.Authorization/classicAdministrators/10032001C02AAD85"
        }
      },
      "jobId": "SubscriptionUserInfoProvisioningJob-Immediate",
      "jobType": "SubscriptionUserProvisioningJob",
      "operation_name": "MICROSOFT.AUTHORIZATION/CLASSICADMINISTRATORS/WRITE",
      "properties": {
        "adminEmail": "[email protected]",
        "adminType": "CoAdmin",
        "entity": "/subscriptions/82206d98-e2b8-46f5-955c-3006837acdea/providers/Microsoft.Authorization/classicAdministrators/10032001C02AAD85",
        "hierarchy": "",
        "message": "Microsoft.Authorization/classicAdministrators/write"
      },
      "ReleaseVersion": "6.2021.49.4+156e160.release_2021w49",
      "result_signature": "Succeeded.",
      "result_type": "Success",
      "RoleLocation": "North Central US"
    },
    "correlation_id": "81b6e1d1-da0b-4a0a-9f25-cd91112420f2",
    "resource": {
      "id": "/SUBSCRIPTIONS/82206D98-E2B8-46F5-955C-3006837ACDEA/PROVIDERS/MICROSOFT.AUTHORIZATION/CLASSICADMINISTRATORS/10032001C02AAD85",
      "provider": "MICROSOFT.AUTHORIZATION/CLASSICADMINISTRATORS"
    },
    "subscription_id": "82206D98-E2B8-46F5-955C-3006837ACDEA"
  },
  "client": {
    "ip": "23.102.135.247"
  },
  "cloud": {
    "provider": "azure"
  },
  "data_stream": {
    "dataset": "azure.activitylogs",
    "namespace": "default",
    "type": "logs"
  },
  "ecs": {
    "version": "1.11.0"
  },
  "elastic_agent": {
    "id": "9cb9acc4-fb1f-431b-bc2b-60d8f1377bf2",
    "snapshot": "false",
    "version": "7.15.2"
  },
  "event": {
    "action": "MICROSOFT.AUTHORIZATION/CLASSICADMINISTRATORS/WRITE",
    "agent_id_status": "verified",
    "dataset": "azure.activitylogs",
    "duration": "0",
    "ingested": "2021-12-15T01:29:59.000Z",
    "kind": "signal",
    "module": "azure",
    "outcome": "success"
  },
  "geo": {
    "city_name": "San Antonio",
    "continent_name": "North America",
    "country_iso_code": "US",
    "country_name": "United States",
    "location": "{\"lon\":-98.4927,\"lat\":29.4227}",
    "region_iso_code": "US-TX",
    "region_name": "Texas"
  },
  "host": {
    "architecture": "x86_64",
    "containerized": "false",
    "hostname": "localhost",
    "id": "d3d879bac36a47e5b0dec3c22e451c66",
    "ip": "74.207.237.102,2600:3c02::f03c:92ff:fe5f:82a5,fe80::f03c:92ff:fe5f:82a5",
    "mac": "f2:3c:92:5f:82:a5",
    "name": "localhost",
    "os": {
      "codename": "buster",
      "family": "debian",
      "kernel": "4.19.0-18-amd64",
      "name": "Debian GNU/Linux",
      "platform": "debian",
      "type": "linux",
      "version": "10 (buster)"
    }
  },
  "input": {
    "type": "azure-eventhub"
  },
  "kibana": {
    "alert": {
      "ancestors": {
        "depth": "0",
        "id": "nwK1u30BG-c0K3YA5ZAe",
        "index": ".ds-logs-azure.activitylogs-default-2021.12.11-000001",
        "type": "event"
      },
      "depth": "1",
      "original_event": {
        "action": "MICROSOFT.AUTHORIZATION/CLASSICADMINISTRATORS/WRITE",
        "dataset": "azure.activitylogs",
        "duration": "0",
        "kind": "event",
        "module": "azure",
        "outcome": "success"
      },
      "original_time": "2021-12-15T01:20:23.092Z",
      "reason": "event on localhost created medium alert Azure Subscription Permissions Elevation.",
      "risk_score": "47",
      "rule": {
        "author": "Austin Songer",
        "created_at": "2021-12-15T00:05:22.302Z",
        "created_by": "1366449198",
        "description": "Identifies when a user has been elevated to manage all Azure Subscriptions. This setting could allow an attacker access to Azure subscriptions in your environment.",
        "enabled": "true",
        "from": "now-1800s",
        "immutable": "false",
        "index": "filebeat-*,logs-azure*",
        "interval": "5m",
        "language": "kuery",
        "license": "",
        "max_signals": "100",
        "name": "Azure Subscription Permissions Elevation",
        "query": "event.dataset:azure.activitylogs and azure.activitylogs.operation_name:*/ROLEASSIGNMENTS/WRITE and azure.activitylogs.properties:*18d7d88d-d35e-4fb5-a5c3-7773c20a72d9* or \nazure.activitylogs.operation_name: (MICROSOFT.AUTHORIZATION/ELEVATEACCESS/ACTION or MICROSOFT.AUTHORIZATION/CLASSICADMINISTRATORS/WRITE)",
        "rule_id": "86522dce-6179-4c86-92ce-e1387efd23d8",
        "tags": "Azure",
        "to": "now",
        "type": "query",
        "updated_at": "2021-12-15T01:30:49.126Z",
        "updated_by": "1366449198",
        "uuid": "b1ee8d10-5d3a-11ec-9afd-51a00f4042ed",
        "version": "7"
      },
      "severity": "medium",
      "workflow_status": "open"
    }
  },
  "log": {
    "level": "Information"
  },
  "related": {
    "ip": "23.102.135.247"
  },
  "signal": {
    "_meta": {
      "version": "57"
    },
    "ancestors": "{\"id\":\"nwK1u30BG-c0K3YA5ZAe\",\"type\":\"event\",\"index\":\".ds-logs-azure.activitylogs-default-2021.12.11-000001\",\"depth\":0}",
    "depth": "1",
    "original_event": {
      "action": "MICROSOFT.AUTHORIZATION/CLASSICADMINISTRATORS/WRITE",
      "agent_id_status": "verified",
      "dataset": "azure.activitylogs",
      "duration": "0",
      "ingested": "2021-12-15T01:29:59Z",
      "kind": "event",
      "module": "azure",
      "outcome": "success"
    },
    "original_time": "2021-12-15T01:20:23.092Z",
    "parent": {
      "depth": "0",
      "id": "nwK1u30BG-c0K3YA5ZAe",
      "index": ".ds-logs-azure.activitylogs-default-2021.12.11-000001",
      "type": "event"
    },
    "parents": "{\"id\":\"nwK1u30BG-c0K3YA5ZAe\",\"type\":\"event\",\"index\":\".ds-logs-azure.activitylogs-default-2021.12.11-000001\",\"depth\":0}",
    "reason": "event on localhost created medium alert Azure Subscription Permissions Elevation.",
    "rule": {
      "actions": "",
      "author": "Austin Songer",
      "created_at": "2021-12-15T00:05:22.302Z",
      "created_by": "1366449198",
      "description": "Identifies when a user has been elevated to manage all Azure Subscriptions. This setting could allow an attacker access to Azure subscriptions in your environment.",
      "enabled": "true",
      "exceptions_list": "",
      "false_positives": "",
      "filters": "",
      "from": "now-1800s",
      "id": "b1ee8d10-5d3a-11ec-9afd-51a00f4042ed",
      "immutable": "false",
      "index": "filebeat-*,logs-azure*",
      "interval": "5m",
      "language": "kuery",
      "license": "",
      "max_signals": "100",
      "meta": {
        "from": "25m",
        "kibana_siem_app_url": ""
      },
      "name": "Azure Subscription Permissions Elevation",
      "output_index": ".siem-signals-default",
      "query": "event.dataset:azure.activitylogs and azure.activitylogs.operation_name:*/ROLEASSIGNMENTS/WRITE and azure.activitylogs.properties:*18d7d88d-d35e-4fb5-a5c3-7773c20a72d9* or \nazure.activitylogs.operation_name: (MICROSOFT.AUTHORIZATION/ELEVATEACCESS/ACTION or MICROSOFT.AUTHORIZATION/CLASSICADMINISTRATORS/WRITE)",
      "references": "",
      "risk_score": "47",
      "risk_score_mapping": "",
      "rule_id": "86522dce-6179-4c86-92ce-e1387efd23d8",
      "severity": "medium",
      "severity_mapping": "",
      "tags": "Azure",
      "threat": "",
      "timestamp_override": "event.ingested",
      "to": "now",
      "type": "query",
      "updated_at": "2021-12-15T01:30:49.126Z",
      "updated_by": "1366449198",
      "version": "7"
    },
    "status": "open"
  },
  "source": {
    "as": {
      "number": "8075",
      "organization": {
        "name": "MICROSOFT-CORP-MSN-AS-BLOCK"
      }
    },
    "geo": {
      "city_name": "San Antonio",
      "continent_name": "North America",
      "country_iso_code": "US",
      "country_name": "United States",
      "location": "{\"lon\":-98.4927,\"lat\":29.4227}",
      "region_iso_code": "US-TX",
      "region_name": "Texas"
    },
    "ip": ""
  },
  "tags": "azure-activitylogs"
}

Contributor checklist

@austinsonger austinsonger marked this pull request as ready for review December 15, 2021 01:44
@w0rk3r w0rk3r self-assigned this Dec 29, 2021
@w0rk3r
Copy link
Contributor

w0rk3r commented Dec 29, 2021

@austinsonger can you replace the alert JSON with the original event? Thanks!

@brokensound77 brokensound77 added the Rule: New Proposal for new rule label Jan 26, 2022
@terrancedejesus terrancedejesus self-requested a review April 28, 2022 15:18
Copy link
Contributor

@Mikaayenson Mikaayenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@w0rk3r w0rk3r closed this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Rule] Azure Subscription Permission Elevation
6 participants