Open Engineering Proof | SIEM, Terraform & Cloud Guardrails

Security Engineering Reference Templates

Sanitised reference starter templates published directly by Principal Security Architect Muzammil Sher. Adapt these patterns for BindPlane OP telemetry reduction, Google SecOps YARA-L detections, Sentinel DCR filters, DORA immutable S3 WORM storage, and Kubernetes OPA guardrails.

Discuss Custom Implementation
Engineering Usage Note

Test every collector filter, YARA-L detection, SCP, and Rego rule inside non-production staging pipelines against representative sample payloads prior to production enforcement. All client IP created during M.Sher engagements remains 100% client-owned.

01 | Telemetry Pipeline (BindPlane OP / OpenTelemetry)

BindPlane OP Edge Noise Filter & Dual-Shipping Processor

Strips repetitive internal load-balancer HTTP 200 health checks and loopback probes prior to Google SecOps / Sentinel ingestion, cutting verbose bytes at the collector tier while preserving immutable archive copies.

# Sanitised BindPlane OP / OTel Collector Processor Reference processors: filter/drop_lb_healthchecks: error_mode: ignore logs: log_record: - 'IsMatch(body, "(?i)ELB-HealthChecker|kube-probe|HTTP/1\.1\" 200") and attributes["severity"] == "INFO"' - 'attributes["net.peer.port"] == 5353 or attributes["net.peer.port"] == 1900' transform/trim_bloat_fields: log_statements: - context: log statements: - delete_key(attributes, "raw_debug_stack") - delete_key(attributes, "redundant_agent_metadata") exporters: chronicle/secops_hot: endpoint: "malachiteingestion-pa.googleapis.com" log_type: "AWS_WAF" aws_s3/worm_compliance_archive: s3_bucket: "org-central-worm-log-archive" compression: "gzip" marshaler: "otlp_json"
Explore SIEM Cost Optimisation

02 | Detection-as-Code (Google SecOps UDM)

YARA-L 2.0 Multi-Event Identity + Cloud Persistence Rule

Correlates Identity Provider MFA tampering (Okta / Entra ID) with subsequent AWS IAM privilege escalation within a 30-minute sliding UDM entity window, eliminating noisy single-event alert storms.

rule multi_cloud_mfa_bypass_followed_by_iam_persistence { meta: author = "M.Sher Security Engineering" description = "Detects MFA policy modification or factor removal paired with AWS IAM policy attachment or access key creation for the same identity." severity = "HIGH" priority = "HIGH" mitre_tactic = "TA0003 Persistence, TA0006 Credential Access" events: $idp.metadata.event_type = "USER_CHANGE_PERMISSIONS" $idp.security_result.summary = /MFA.*disabled|Factor.*Removed|StrongAuth.*Bypass/i $idp.target.user.email_addresses = $user $cloud.metadata.vendor_name = "AMAZON" $cloud.metadata.product_event_type = /AttachUserPolicy|AttachRolePolicy|CreateAccessKey/ $cloud.principal.user.email_addresses = $user $cloud.metadata.event_timestamp.seconds >= $idp.metadata.event_timestamp.seconds match: $user over 30m outcome: $risk_score = max(85) $target_identity = array_distinct($user) $cloud_actions = array_distinct($cloud.metadata.product_event_type) condition: $idp and $cloud }
Explore Google SecOps Consulting

03 | Microsoft Sentinel Cost Control (Azure Monitor DCR)

Azure Monitor Data Collection Rule (KQL Ingestion Filter)

Filters noisy perimeter ALLOW sessions, mDNS/SSDP broadcast ports, and empty attribute payloads at ingestion time before hitting expensive Microsoft Sentinel Analytics tables.

// Azure Monitor DCR Ingestion-Time KQL Transformation // Apply on streams: Microsoft-CommonSecurityLog source | where DeviceAction !in~ ("allow", "accept", "keepalive", "close") | where DestinationPort !in (5353, 1900, 137, 138) | where not(SourceIP startswith "10." and DestinationIP startswith "10." and DeviceSeverity == "Low") | project TimeGenerated, DeviceVendor, DeviceProduct, DeviceEventClassID, SourceIP, SourcePort, DestinationIP, DestinationPort, DeviceAction, ThreatSeverity, ApplicationProtocol, RequestURL
Explore Microsoft Sentinel Consulting

04 | Multi-Cloud Guardrails & DORA Art. 11 (Terraform)

Terraform AWS Preventive SCP & 5-Year S3 Object Lock WORM Archive

Combines a non-bypassable AWS Organizations SCP preventing CloudTrail/GuardDuty tampering with a COMPLIANCE/GOVERNANCE Object-Locked S3 audit bucket aligned to DORA Article 11 & UK FCA retention.

# 1. Prevent CloudTrail / GuardDuty Tampering at Organization Root resource "aws_organizations_policy" "protect_security_telemetry" { name = "msher-protect-security-audit-logs" description = "Prevents disabling central security logging or GuardDuty detectors outside break-glass role." content = jsonencode({ Version = "2012-10-17" Statement = [{ Sid = "DenyAuditLogTampering" Effect = "Deny" Action = [ "cloudtrail:StopLogging", "cloudtrail:DeleteTrail", "guardduty:DeleteDetector", "s3:DeleteBucketObjectLockConfiguration" ] Resource = "*" Condition = { ArnNotLike = { "aws:PrincipalArn" = "arn:aws:iam::*:role/PlatformSecurityBreakGlass" } } }] }) } # 2. DORA Article 11 5-Year Immutable WORM Log Archive Bucket resource "aws_s3_bucket" "dora_worm_archive" { bucket = "enterprise-dora-immutable-audit-logs" object_lock_enabled = true } resource "aws_s3_bucket_object_lock_configuration" "dora_5yr_lock" { bucket = aws_s3_bucket.dora_worm_archive.id rule { default_retention { mode = "GOVERNANCE" years = 5 } } } resource "aws_s3_bucket_public_access_block" "dora_archive_private" { bucket = aws_s3_bucket.dora_worm_archive.id block_public_acls = true block_public_policy = true ignore_public_acls = true restrict_public_buckets = true }
Explore DORA & NIS2 Advisory

05 | Cloud-Native Kubernetes Posture (OPA / Gatekeeper)

OPA Rego Admission Policy Blocking Privileged Pods

Enforces container immutability inside EKS, AKS, and GKE clusters by rejecting pods requesting privileged security contexts or unrestricted host network access prior to cluster scheduling.

package kubernetes.admission.security deny[msg] { input.request.kind.kind == "Pod" container := input.request.object.spec.containers[_] container.securityContext.privileged == true msg := sprintf("Denied container '%s': privileged securityContext is prohibited in production namespaces.", [container.name]) } deny[msg] { input.request.kind.kind == "Pod" input.request.object.spec.hostNetwork == true msg := "Denied Pod specification: hostNetwork access violates cluster Zero Trust segmentation policy." } deny[msg] { input.request.kind.kind == "Pod" container := input.request.object.spec.containers[_] not startswith(container.image, "123456789012.dkr.ecr.") not startswith(container.image, "ghcr.io/approved-org/") msg := sprintf("Denied unverified container registry for image '%s'.", [container.image]) }
Explore Cloud Security Architecture

Adapt These Patterns to Your Multi-Cloud & SOC Estate

Book a 30-minute peer-to-peer architecture call to scope custom YARA-L migration, BindPlane telemetry savings, or Terraform guardrail modules.