Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
3ec8a3c
feat: add containment Logic App ARM template (block IP, disable accou…
TFT444 May 31, 2026
5843987
feat: add threat-intel enrichment Logic App ARM template (AbuseIPDB +…
TFT444 May 31, 2026
1954732
feat: add triage-classify Logic App ARM template
TFT444 May 31, 2026
41112c8
docs: add Logic Apps deployment guide (DEPLOYMENT.md)
TFT444 May 31, 2026
22e572d
fix: update README feature status to match implemented playbooks and …
TFT444 May 31, 2026
63b80d5
Merge pull request #35 from TFT444/feat/containment-logic-app
TFT444 Jun 1, 2026
3c81284
Merge pull request #36 from TFT444/feat/threat-intel-enrichment-logic…
TFT444 Jun 1, 2026
ae7d2e7
Merge pull request #37 from TFT444/feat/triage-classify-logic-app
TFT444 Jun 1, 2026
6d97532
Merge pull request #38 from TFT444/feat/logic-apps-deployment-docs
TFT444 Jun 1, 2026
d3b8754
Merge pull request #39 from TFT444/fix/update-automated-response-claims
TFT444 Jun 1, 2026
68c62f7
feat(detection-rules): credential_stuffing.kql + after_hours_access.k…
TFT444 Jun 1, 2026
beeabb3
feat(detection-rules): data_exfiltration.kql — T1048 critical detection
TFT444 Jun 1, 2026
6c6a393
chore: remove ransomware-indicator.kql stub
TFT444 Jun 1, 2026
02cf61a
feat(detection-rules): mfa_fatigue.kql — T1621 MFA push bombing (RS-S…
TFT444 Jun 1, 2026
f8fd170
feat(detection-rules): privileged_role_addition.kql — T1098/T1078 (RS…
TFT444 Jun 1, 2026
3f49b8f
feat(detection-rules): supplier_impossible_travel.kql — T1199/T1078 (…
TFT444 Jun 1, 2026
97b459f
feat(detection-rules): pos_void_refund.kql — POS off-hours void/refun…
TFT444 Jun 1, 2026
c350b48
feat(detection-rules): gift_card_fraud.kql — T1657 gift-card fraud (R…
TFT444 Jun 1, 2026
b4b9d0d
feat: move KQL rules into retail/ and generic/ subfolders, rewrite RE…
TFT444 Jun 1, 2026
bae7e5e
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
1166bcd
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
3a96a8b
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
86f87e9
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
2cca625
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
ff5bdf0
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
8882697
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
3f6178e
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
60027b6
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
c862441
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
54a4efb
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
9bd5800
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
eba31ea
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
df9e395
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
0cda6e4
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
b635397
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
ddeed9e
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
2d2ecbf
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
9252c1b
chore: remove flat KQL files after moving to retail/ and generic/ sub…
TFT444 Jun 1, 2026
48ef997
docs: reposition README — RetailShield as a Microsoft Sentinel conten…
TFT444 Jun 1, 2026
535f312
docs: add CONTENT_PACK.md explaining Sentinel Solution structure
TFT444 Jun 1, 2026
0e6e98e
docs: add issue audit summary to docs/
TFT444 Jun 1, 2026
77caee3
Fix CI: update test paths to retail/ and add RetailShield_POS_CL to v…
TFT444 Jun 2, 2026
3d6b094
Fix CI: add RetailShield_POS_CL to KQL validator known tables
TFT444 Jun 2, 2026
2ed68d6
Fix CI: add RetailShield_POS_CL to KQL validator known tables
TFT444 Jun 2, 2026
c802891
Fix CI: add RetailShield_POS_CL to KQL validator known tables
TFT444 Jun 2, 2026
9c01972
Merge pull request #60 from TFT444/feature/reorganise-detection-rules
TFT444 Jun 2, 2026
1ac4442
Add updated MITRE ATT&CK mapping table for retail/ and generic/ rules
TFT444 Jun 2, 2026
474978f
Merge pull request #61 from TFT444/feature/reposition-readme
TFT444 Jun 2, 2026
5d6d89c
Merge pull request #62 from TFT444/feature/add-content-pack-doc
TFT444 Jun 2, 2026
93a28c3
Merge pull request #63 from TFT444/feature/audit-open-issues
TFT444 Jun 2, 2026
557593b
Fix README references to non-existent files
TFT444 Jun 2, 2026
7f453a6
Merge pull request #65 from TFT444/feature/fix-readme-broken-refs
TFT444 Jun 3, 2026
6debd76
Expand KQL test suite to cover all 13 retail detection rules
TFT444 Jun 3, 2026
4f8dda0
Add Sentinel deployment guide
TFT444 Jun 3, 2026
e76784d
Add Logic App ARM templates for all four Sentinel playbooks
TFT444 Jun 3, 2026
979b762
feat(playbooks): add UK incident reporting compliance assistant Logic…
TFT444 Jun 4, 2026
010509e
Add 13 Sentinel analytics rule ARM templates for all retail detection…
TFT444 Jun 4, 2026
ef1dc95
Add RetailShield custom table definitions as data connector ARM template
TFT444 Jun 4, 2026
949683f
Add Sentinel analytics rule field mapping validator and CI job
TFT444 Jun 4, 2026
84a3842
Fix corrupted test file and remove unused import in validator
TFT444 Jun 5, 2026
aac3277
Fix corrupted test file: restore proper newlines in test_kql_rules.py
TFT444 Jun 5, 2026
3821a38
Fix corrupted test file: restore proper newlines in test_kql_rules.py
TFT444 Jun 5, 2026
d43e258
Fix corrupted test file: restore proper newlines in test_kql_rules.py
TFT444 Jun 5, 2026
1ae5cb4
Fix E127 flake8 in test_kql_rules.py (continuation line indent)
TFT444 Jun 5, 2026
bb803b3
Fix E127 flake8 in test_kql_rules.py (continuation line indent)
TFT444 Jun 5, 2026
17ffc42
Fix E127 flake8 in test_kql_rules.py (continuation line indent)
TFT444 Jun 5, 2026
744bf68
Fix E127 flake8 in test_kql_rules.py (continuation line indent)
TFT444 Jun 5, 2026
91a9c4f
Merge pull request #75 from TFT444/feature/incident-reporting-playbook
TFT444 Jun 6, 2026
ced0b1a
Merge pull request #76 from TFT444/feature/sentinel-analytics-rules
TFT444 Jun 6, 2026
2a282fc
Merge pull request #77 from TFT444/feature/data-connector-definition
TFT444 Jun 6, 2026
9f537ba
Merge pull request #78 from TFT444/feature/field-mapping-validation
TFT444 Jun 6, 2026
ba75a76
Fix corrupted test file: restore proper newlines in test_kql_rules.py
TFT444 Jun 6, 2026
5339a2c
Add Sentinel Solution deployment package (mainTemplate + createUiDefi…
TFT444 Jun 6, 2026
16ab34b
Add RetailShield capability matrix
TFT444 Jun 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,27 @@ jobs:
exit 0
fi

# ── 6. All checks gate ──────────────────────────────────────────────────────
# ── 6. Sentinel Field Mapping Validation ────────────────────────────────────
field-mapping-validation:
name: Sentinel Field Mapping Validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip

- name: Install dependencies
run: pip install -r requirements.txt

- name: Validate Sentinel analytics rule field mappings
run: python scripts/validate_field_mapping.py

# ── 7. All checks gate ──────────────────────────────────────────────────────
ci-success:
name: All Checks Passed
runs-on: ubuntu-latest
Expand All @@ -151,6 +171,7 @@ jobs:
- python-tests
- python-lint
- logicapp-validation
- field-mapping-validation
steps:
- name: CI green
run: echo "All RetailShield CI checks passed ✅"
193 changes: 193 additions & 0 deletions CONTENT_PACK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# RetailShield — Sentinel Content Pack

This document explains how RetailShield is structured as a Microsoft Sentinel Solution, how each component maps to a Sentinel content type, and what is required to publish it to the Microsoft Sentinel Content Hub.

---

## What is a Microsoft Sentinel Solution?

A **Microsoft Sentinel Solution** is a packaged collection of Sentinel content (analytics rules, playbooks, workbooks, watchlists, hunting queries, data connectors) distributed as a single deployable unit through the **Microsoft Sentinel Content Hub**.

When an organisation installs a Solution from Content Hub, all included content is deployed into their Sentinel workspace in one operation. Solutions are the standard way Microsoft and its partners distribute pre-built detection and response content.

RetailShield is structured to be publishable as a Solution. It can also be deployed component by component without going through Content Hub.

---

## Component mapping

Each RetailShield component maps to a specific Sentinel content type:

### Analytics Rules (KQL)

Sentinel content type: `Microsoft.SecurityInsights/alertRules`

Location in this repo: `detection-rules/retail/` and `detection-rules/generic/`

| Rule ID | File | Sentinel Rule Type |
|---|---|---|
| RS-PHI-001 | `retail/phishing_detection.kql` | Scheduled |
| RS-POS-001 | `retail/pos_anomaly.kql` | Scheduled |
| RS-POS-002 | `retail/pos_void_refund.kql` | Scheduled |
| RS-GCF-001 | `retail/gift_card_fraud.kql` | Scheduled |
| RS-VOI-001 | `retail/ai_voice_fraud.kql` | Scheduled |
| RS-MFA-001 | `retail/mfa_fatigue.kql` | Scheduled |
| RS-CRD-001 | `retail/credential_stuffing.kql` | Scheduled |
| RS-AHA-001 | `retail/after_hours_access.kql` | Scheduled |
| RS-EXF-001 | `retail/data_exfiltration.kql` | Scheduled |
| RS-RAN-001 | `retail/ransomware_indicator.kql` | Scheduled |
| RS-SUP-001 | `retail/supply_chain_anomaly.kql` | Scheduled |
| RS-SUP-002 | `retail/supplier_impossible_travel.kql` | Scheduled |
| RS-PRA-001 | `retail/privileged_role_addition.kql` | Scheduled |
| GEN-001–006 | `generic/*.kql` | Scheduled (placeholder) |

Each KQL file must be wrapped in a Sentinel ARM template (`Microsoft.SecurityInsights/alertRules`) to be included in a Solution. The ARM template defines the rule name, description, severity, frequency, lookback, and embeds the KQL query.

### Automation Playbooks (Logic Apps)

Sentinel content type: `Microsoft.Logic/workflows`

Location in this repo: `logic-apps/`

| Playbook | Trigger | Action |
|---|---|---|
| `triage-classify` | Sentinel incident created | Tags incident by retail category, sets severity |
| `threat-intel-enrich` | Sentinel incident created | Queries AbuseIPDB and VirusTotal for IP entities, raises severity on hits |
| `containment` | Sentinel incident created | Blocks IP in NSG, disables Azure AD account, isolates host via Defender for Endpoint |

Playbooks are Azure Logic Apps stored as ARM templates. For Content Hub packaging, each `workflow.json` must be wrapped in a Solution ARM template with the correct `Microsoft.Logic/workflows` resource type and a Sentinel `Microsoft.SecurityInsights/automationRules` trigger binding.

### Workbook

Sentinel content type: `Microsoft.Insights/workbooks`

Location in this repo: `sentinel/workbooks/retailshield-workbook.json`

The RetailShield workbook provides:
- Live incident feed filtered to RetailShield alert IDs
- TTP heatmap across MITRE ATT&CK tactics
- Analyst KPIs (MTTD, MTTR, alert-to-incident ratio)
- Per-rule alert volume over time

For Content Hub packaging, the workbook ARM template must include the `serializedData` field containing the full workbook JSON.

### Watchlists

Sentinel content type: `Microsoft.SecurityInsights/watchlists`

Location in this repo: `sentinel/watchlists/`

| Watchlist | Referenced by | Purpose |
|---|---|---|
| `RetailIOCWatchlist` | RS-POS-001, RS-EXF-001, RS-RAN-001 | Known malicious IPs, domains, hashes from retail sector threat intelligence |
| `RetailApprovedSenders` | RS-PHI-001 | Approved sender domains for phishing false-positive reduction |
| `AbuseIPDBWatchlist` | RS-CRD-001 | Known credential-stuffing infrastructure IPs |
| `RetailSupplierAccounts` | RS-SUP-002 | Supplier UPNs for impossible travel monitoring |
| `RetailServiceAccounts` | RS-AHA-001 | Service account UPNs excluded from after-hours alerts |

Watchlists must be populated with real data before the rules that reference them produce meaningful results. Sample CSV templates are in `sentinel/watchlists/`.

---

## Solution packaging structure

A Sentinel Solution ready for Content Hub submission has the following structure:

```
RetailShield-Solution/
├── createUiDefinition.json # Azure Marketplace UI definition
├── mainTemplate.json # Master ARM template referencing all resources
├── Package/
│ ├── analytic-rules/
│ │ ├── RS-PHI-001-PhishingDetection.json
│ │ ├── RS-POS-001-POSAnomaly.json
│ │ └── ... (one JSON per rule)
│ ├── playbooks/
│ │ ├── RetailShield-TriageClassify.json
│ │ ├── RetailShield-ThreatIntelEnrich.json
│ │ └── RetailShield-Containment.json
│ ├── workbooks/
│ │ └── RetailShield-Workbook.json
│ └── watchlists/
│ ├── RetailIOCWatchlist.json
│ └── ... (one JSON per watchlist)
└── SolutionMetadata.json # Solution name, version, publisher, categories
```

### Key files

**`SolutionMetadata.json`** declares the solution identity:

```json
{
"publisherId": "shieldtech",
"offerId": "retailshield",
"firstPublishDate": "2025-01-01",
"lastPublishDate": "2025-06-01",
"providers": ["ShieldTech Ltd"],
"categories": {
"domains": ["Security - Threat Protection"],
"verticals": ["Retail"]
}
}
```

**`createUiDefinition.json`** defines the deployment wizard shown to the customer in the Azure Portal when they click "Install" from Content Hub.

**`mainTemplate.json`** is the master ARM template that deploys all content resources into the customer’s workspace in a single `az deployment group create` call.

---

## Deployment options

### Option 1: Manual deployment (development / testing)

Deploy rules individually to a Sentinel workspace using the deployment script:

```bash
python scripts/deploy_rules.py \
--workspace-name "<SENTINEL_WORKSPACE>" \
--resource-group "<RESOURCE_GROUP>"
```

Or paste KQL directly into the Sentinel Analytics blade (New Scheduled Rule).

### Option 2: ARM template deployment

Deploy all content in one operation using the solution ARM template:

```bash
az deployment group create \
--resource-group "<RESOURCE_GROUP>" \
--template-file RetailShield-Solution/mainTemplate.json \
--parameters workspaceName="<SENTINEL_WORKSPACE>"
```

### Option 3: Content Hub (future)

Once the Solution is submitted and approved by Microsoft, customers can discover and install RetailShield directly from the **Microsoft Sentinel Content Hub** in the Azure Portal, with no manual ARM deployment required.

---

## Content Hub submission requirements

To publish to the official Microsoft Sentinel Content Hub, a Solution must meet these requirements:

1. All content passes the [MSTIC validation pipeline](https://github.com/Azure/Azure-Sentinel/blob/master/docs/Solution_Validation.md)
2. `SolutionMetadata.json` is complete and valid
3. All ARM templates pass `az bicep build` (or ARM template validation)
4. All KQL queries are validated against real Log Analytics table schemas
5. PR submitted to the [Azure/Azure-Sentinel](https://github.com/Azure/Azure-Sentinel) repository under `Solutions/RetailShield/`
6. Microsoft content review and approval (typically 2–4 weeks)

> RetailShield is not yet submitted to Content Hub. The current repo is the development version. Content Hub packaging is planned for a future release.

---

## Related

- [Microsoft Sentinel Content Hub documentation](https://learn.microsoft.com/en-us/azure/sentinel/sentinel-solutions-catalog)
- [Build a Sentinel Solution](https://learn.microsoft.com/en-us/azure/sentinel/sentinel-solutions-create)
- [Azure/Azure-Sentinel GitHub repository](https://github.com/Azure/Azure-Sentinel)
- [detection-rules/README.md](detection-rules/README.md) — full rule index with MITRE mapping
- [logic-apps/DEPLOYMENT.md](logic-apps/DEPLOYMENT.md) — Logic App deployment guide
Loading
Loading