mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-08-02 00:57:42 +03:00
Initial commit - 611 cybersecurity skills across all subdomains
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
---
|
||||
name: implementing-google-workspace-phishing-protection
|
||||
description: Configure Google Workspace advanced phishing and malware protection settings including pre-delivery scanning, attachment protection, spoofing detection, and Enhanced Safe Browsing.
|
||||
domain: cybersecurity
|
||||
subdomain: phishing-defense
|
||||
tags: [google-workspace, gmail, phishing, email-security, safe-browsing, anti-spoofing, admin-console]
|
||||
version: "1.0"
|
||||
author: mahipal
|
||||
license: MIT
|
||||
---
|
||||
# Implementing Google Workspace Phishing Protection
|
||||
|
||||
## Overview
|
||||
Google Workspace provides advanced phishing and malware protection through the Admin Console under Apps > Google Workspace > Gmail > Safety. Key features include Enhanced Pre-Delivery Scanning that examines messages more thoroughly before they reach inboxes, attachment and link protection that scans for malware and checks against known malicious sites, and spoofing detection for domain and employee name impersonation. Google's Advanced Protection Program (APP) provides the strongest account security for high-privilege users.
|
||||
|
||||
## Prerequisites
|
||||
- Google Workspace Business Standard or higher license
|
||||
- Gmail Settings administrator privilege
|
||||
- Understanding of organizational email flow and third-party integrations
|
||||
- Access to Google Admin Console (admin.google.com)
|
||||
- DNS management access for SPF, DKIM, DMARC configuration
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
### Step 1: Configure Advanced Phishing Protection
|
||||
- Navigate to Admin Console > Apps > Google Workspace > Gmail > Safety
|
||||
- Enable "Protect against domain spoofing based on similar domain names"
|
||||
- Enable "Protect against spoofing of employee names"
|
||||
- Enable "Protect against inbound emails spoofing your domain"
|
||||
- Set action for detected spoofing: quarantine or move to spam with warning banner
|
||||
- Apply settings to all organizational units or specific high-risk groups
|
||||
|
||||
### Step 2: Enable Enhanced Pre-Delivery Scanning
|
||||
- In Safety settings, enable "Enhanced pre-delivery message scanning"
|
||||
- This adds additional delay (seconds) to scan messages more thoroughly
|
||||
- Configure to detect phishing attempts that evade initial filters
|
||||
- Enable "Identify links behind shortened URLs"
|
||||
- Enable "Scan linked images" for image-based phishing detection
|
||||
|
||||
### Step 3: Configure Attachment Protection
|
||||
- Enable "Protect against encrypted attachments from untrusted senders"
|
||||
- Enable "Protect against attachments with scripts from untrusted senders"
|
||||
- Enable "Protect against anomalous attachment types in emails"
|
||||
- Configure action: warn users, move to spam, or quarantine
|
||||
- Create exceptions for known legitimate encrypted file senders
|
||||
|
||||
### Step 4: Enable Enhanced Safe Browsing
|
||||
- Navigate to Admin Console > Security > Gmail Enhanced Safe Browsing
|
||||
- Enable Enhanced Safe Browsing for the organization (off by default)
|
||||
- This provides real-time protection against phishing URLs in emails
|
||||
- Configure at organizational unit level for phased rollout
|
||||
- Monitor user feedback for false positive impact
|
||||
|
||||
### Step 5: Enroll High-Risk Users in Advanced Protection Program
|
||||
- Identify high-privilege accounts: super admins, executives, finance leadership
|
||||
- Enroll users in Google's Advanced Protection Program (APP)
|
||||
- APP requires FIDO2 security keys for authentication
|
||||
- APP blocks third-party app access unless explicitly approved
|
||||
- APP provides enhanced scanning for Gmail and Drive downloads
|
||||
|
||||
### Step 6: Configure Email Authentication
|
||||
- Publish SPF record: `v=spf1 include:_spf.google.com ~all`
|
||||
- Enable DKIM signing in Admin Console > Apps > Google Workspace > Gmail > Authenticate email
|
||||
- Configure DMARC with monitoring: `v=DMARC1; p=none; rua=mailto:dmarc@company.com`
|
||||
- Progress DMARC to enforcement per organizational readiness
|
||||
|
||||
## Tools & Resources
|
||||
- **Google Admin Console**: Central management for all security settings
|
||||
- **Google Workspace Security Investigation Tool**: Threat analysis and response
|
||||
- **Google Security Center**: Security health recommendations and dashboard
|
||||
- **Gmail Security Sandbox**: Attachment detonation for enterprise licenses
|
||||
- **Google Advanced Protection Program**: Strongest account security
|
||||
|
||||
## Validation
|
||||
- Spoofing protection blocks test email with lookalike domain
|
||||
- Pre-delivery scanning catches test phishing with delayed weaponization
|
||||
- Attachment protection warns on test encrypted attachment
|
||||
- Enhanced Safe Browsing blocks known phishing URL clicked in email
|
||||
- APP-enrolled accounts reject non-FIDO2 authentication attempts
|
||||
- SPF, DKIM, DMARC all pass for outbound messages
|
||||
@@ -0,0 +1,26 @@
|
||||
# Google Workspace Phishing Protection Configuration Template
|
||||
|
||||
## Safety Settings Checklist
|
||||
- [ ] Domain spoofing protection enabled
|
||||
- [ ] Employee name spoofing protection enabled
|
||||
- [ ] Enhanced pre-delivery scanning enabled
|
||||
- [ ] Encrypted attachment protection enabled
|
||||
- [ ] Script attachment protection enabled
|
||||
- [ ] Anomalous attachment type protection enabled
|
||||
- [ ] Enhanced Safe Browsing enabled
|
||||
- [ ] Security Sandbox enabled (Enterprise)
|
||||
|
||||
## Advanced Protection Program Enrollment
|
||||
| User | Role | APP Enrolled | FIDO2 Key |
|
||||
|---|---|---|---|
|
||||
| | Super Admin | | |
|
||||
| | CEO | | |
|
||||
| | CFO | | |
|
||||
| | VP Finance | | |
|
||||
|
||||
## Authentication Configuration
|
||||
| Protocol | Status | Record |
|
||||
|---|---|---|
|
||||
| SPF | | v=spf1 include:_spf.google.com -all |
|
||||
| DKIM | | google._domainkey.{domain} |
|
||||
| DMARC | | v=DMARC1; p=reject; rua=... |
|
||||
@@ -0,0 +1,31 @@
|
||||
# Standards & References: Google Workspace Phishing Protection
|
||||
|
||||
## Google Workspace Security Settings Path
|
||||
- Admin Console > Apps > Google Workspace > Gmail > Safety
|
||||
- Admin Console > Security > Gmail Enhanced Safe Browsing
|
||||
- Admin Console > Apps > Google Workspace > Gmail > Authenticate email
|
||||
|
||||
## MITRE ATT&CK References
|
||||
- **T1566.001**: Phishing: Spearphishing Attachment
|
||||
- **T1566.002**: Phishing: Spearphishing Link
|
||||
- **T1656**: Impersonation
|
||||
- **T1586.002**: Compromise Accounts: Email Accounts
|
||||
|
||||
## Key Protection Settings
|
||||
| Setting | Location | Default | Recommended |
|
||||
|---|---|---|---|
|
||||
| Domain spoofing protection | Safety | Off | On - Quarantine |
|
||||
| Employee name spoofing | Safety | Off | On - Warning |
|
||||
| Pre-delivery scanning | Safety | On | On (enhanced) |
|
||||
| Attachment protection | Safety | Partial | Full - all options |
|
||||
| Enhanced Safe Browsing | Security | Off | On |
|
||||
| Gmail Security Sandbox | Safety | Off | On (Enterprise) |
|
||||
|
||||
## Google Workspace License Requirements
|
||||
| Feature | Business Starter | Business Standard | Enterprise |
|
||||
|---|---|---|---|
|
||||
| Basic phishing protection | Yes | Yes | Yes |
|
||||
| Enhanced pre-delivery scanning | Yes | Yes | Yes |
|
||||
| Gmail Security Sandbox | No | No | Yes |
|
||||
| Security Investigation Tool | No | Partial | Yes |
|
||||
| Advanced Protection Program | Yes | Yes | Yes |
|
||||
@@ -0,0 +1,60 @@
|
||||
# Workflows: Google Workspace Phishing Protection
|
||||
|
||||
## Workflow 1: Gmail Inbound Protection Pipeline
|
||||
|
||||
```
|
||||
Inbound email arrives at Gmail
|
||||
|
|
||||
v
|
||||
[Connection-level checks]
|
||||
+-- IP reputation
|
||||
+-- SPF validation
|
||||
+-- DKIM verification
|
||||
+-- DMARC evaluation
|
||||
|
|
||||
v
|
||||
[Enhanced Pre-Delivery Scanning]
|
||||
+-- Content analysis for phishing indicators
|
||||
+-- URL expansion (shortened URLs)
|
||||
+-- Image scanning for embedded phishing
|
||||
+-- NLP analysis for social engineering
|
||||
|
|
||||
v
|
||||
[Attachment Protection]
|
||||
+-- File type analysis
|
||||
+-- Script detection in attachments
|
||||
+-- Encrypted attachment from untrusted sender check
|
||||
+-- Security Sandbox detonation (Enterprise)
|
||||
|
|
||||
v
|
||||
[Spoofing Detection]
|
||||
+-- Domain name similarity check
|
||||
+-- Employee name impersonation check
|
||||
+-- Internal domain spoofing check
|
||||
|
|
||||
v
|
||||
[Delivery decision]
|
||||
+-- DELIVER: Clean message to inbox
|
||||
+-- WARN: Deliver with yellow warning banner
|
||||
+-- SPAM: Route to spam folder
|
||||
+-- QUARANTINE: Hold for admin review
|
||||
+-- REJECT: Block delivery entirely
|
||||
```
|
||||
|
||||
## Workflow 2: Safe Browsing URL Protection
|
||||
|
||||
```
|
||||
User clicks URL in Gmail
|
||||
|
|
||||
v
|
||||
[Enhanced Safe Browsing check]
|
||||
+-- Real-time URL reputation lookup
|
||||
+-- Check against known phishing database
|
||||
+-- Dynamic page analysis
|
||||
|
|
||||
v
|
||||
[Decision]
|
||||
+-- SAFE: Allow navigation
|
||||
+-- DANGEROUS: Display full-page warning
|
||||
+-- SUSPICIOUS: Display interstitial warning
|
||||
```
|
||||
@@ -0,0 +1,224 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Google Workspace Phishing Protection Auditor
|
||||
|
||||
Audits Google Workspace Gmail safety settings configuration
|
||||
and generates compliance recommendations.
|
||||
|
||||
Usage:
|
||||
python process.py audit --config-file gws_config.json
|
||||
python process.py check-auth --domain example.com
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
from dataclasses import dataclass, field, asdict
|
||||
|
||||
try:
|
||||
import dns.resolver
|
||||
HAS_DNS = True
|
||||
except ImportError:
|
||||
HAS_DNS = False
|
||||
|
||||
|
||||
@dataclass
|
||||
class GWSSecurityAudit:
|
||||
"""Google Workspace security configuration audit."""
|
||||
domain: str = ""
|
||||
spoofing_protection: bool = False
|
||||
employee_name_spoofing: bool = False
|
||||
enhanced_predelivery: bool = False
|
||||
attachment_protection: dict = field(default_factory=dict)
|
||||
enhanced_safe_browsing: bool = False
|
||||
security_sandbox: bool = False
|
||||
app_enrolled_users: int = 0
|
||||
spf_configured: bool = False
|
||||
dkim_configured: bool = False
|
||||
dmarc_configured: bool = False
|
||||
dmarc_policy: str = ""
|
||||
score: int = 0
|
||||
max_score: int = 100
|
||||
findings: list = field(default_factory=list)
|
||||
recommendations: list = field(default_factory=list)
|
||||
|
||||
|
||||
def audit_gws_config(config: dict) -> GWSSecurityAudit:
|
||||
"""Audit Google Workspace Gmail safety configuration."""
|
||||
audit = GWSSecurityAudit()
|
||||
audit.domain = config.get("domain", "")
|
||||
|
||||
safety = config.get("safety_settings", {})
|
||||
|
||||
# Spoofing protection
|
||||
audit.spoofing_protection = safety.get("domain_spoofing_protection", False)
|
||||
if audit.spoofing_protection:
|
||||
audit.score += 15
|
||||
else:
|
||||
audit.findings.append("Domain spoofing protection not enabled")
|
||||
audit.recommendations.append(
|
||||
"Enable 'Protect against domain spoofing based on similar domain names'"
|
||||
)
|
||||
|
||||
audit.employee_name_spoofing = safety.get("employee_name_spoofing", False)
|
||||
if audit.employee_name_spoofing:
|
||||
audit.score += 10
|
||||
else:
|
||||
audit.findings.append("Employee name spoofing protection not enabled")
|
||||
audit.recommendations.append(
|
||||
"Enable 'Protect against spoofing of employee names'"
|
||||
)
|
||||
|
||||
# Pre-delivery scanning
|
||||
audit.enhanced_predelivery = safety.get("enhanced_predelivery_scanning", False)
|
||||
if audit.enhanced_predelivery:
|
||||
audit.score += 15
|
||||
else:
|
||||
audit.findings.append("Enhanced pre-delivery scanning not enabled")
|
||||
|
||||
# Attachment protection
|
||||
att = safety.get("attachment_protection", {})
|
||||
audit.attachment_protection = att
|
||||
att_score = 0
|
||||
if att.get("encrypted_attachments", False):
|
||||
att_score += 5
|
||||
if att.get("script_attachments", False):
|
||||
att_score += 5
|
||||
if att.get("anomalous_types", False):
|
||||
att_score += 5
|
||||
audit.score += att_score
|
||||
if att_score < 15:
|
||||
audit.findings.append("Not all attachment protection options enabled")
|
||||
|
||||
# Enhanced Safe Browsing
|
||||
audit.enhanced_safe_browsing = safety.get("enhanced_safe_browsing", False)
|
||||
if audit.enhanced_safe_browsing:
|
||||
audit.score += 10
|
||||
else:
|
||||
audit.findings.append("Enhanced Safe Browsing not enabled (off by default)")
|
||||
audit.recommendations.append(
|
||||
"Enable Enhanced Safe Browsing in Admin Console > Security"
|
||||
)
|
||||
|
||||
# Security Sandbox
|
||||
audit.security_sandbox = safety.get("security_sandbox", False)
|
||||
if audit.security_sandbox:
|
||||
audit.score += 10
|
||||
else:
|
||||
audit.findings.append("Gmail Security Sandbox not enabled (requires Enterprise license)")
|
||||
|
||||
# Advanced Protection Program
|
||||
audit.app_enrolled_users = config.get("app_enrolled_users", 0)
|
||||
if audit.app_enrolled_users > 0:
|
||||
audit.score += 10
|
||||
else:
|
||||
audit.recommendations.append(
|
||||
"Enroll super admins and executives in Advanced Protection Program"
|
||||
)
|
||||
|
||||
# Authentication
|
||||
auth = config.get("authentication", {})
|
||||
audit.spf_configured = auth.get("spf", False)
|
||||
audit.dkim_configured = auth.get("dkim", False)
|
||||
audit.dmarc_configured = auth.get("dmarc", False)
|
||||
audit.dmarc_policy = auth.get("dmarc_policy", "none")
|
||||
|
||||
if audit.spf_configured:
|
||||
audit.score += 5
|
||||
if audit.dkim_configured:
|
||||
audit.score += 5
|
||||
if audit.dmarc_configured:
|
||||
audit.score += 5
|
||||
if audit.dmarc_policy == "reject":
|
||||
audit.score += 10
|
||||
elif audit.dmarc_policy == "quarantine":
|
||||
audit.score += 5
|
||||
|
||||
return audit
|
||||
|
||||
|
||||
def check_google_auth(domain: str) -> dict:
|
||||
"""Check SPF, DKIM, DMARC for Google Workspace domain."""
|
||||
result = {"domain": domain, "spf": False, "dkim": False, "dmarc": False, "issues": []}
|
||||
|
||||
if not HAS_DNS:
|
||||
result["issues"].append("dnspython not installed")
|
||||
return result
|
||||
|
||||
# SPF
|
||||
try:
|
||||
answers = dns.resolver.resolve(domain, 'TXT')
|
||||
for rdata in answers:
|
||||
txt = str(rdata).strip('"')
|
||||
if 'v=spf1' in txt and '_spf.google.com' in txt:
|
||||
result["spf"] = True
|
||||
break
|
||||
if not result["spf"]:
|
||||
result["issues"].append("SPF does not include _spf.google.com")
|
||||
except Exception:
|
||||
result["issues"].append("No SPF record found")
|
||||
|
||||
# DKIM (Google default selector)
|
||||
try:
|
||||
dns.resolver.resolve(f"google._domainkey.{domain}", 'TXT')
|
||||
result["dkim"] = True
|
||||
except Exception:
|
||||
result["issues"].append("DKIM not configured for 'google' selector")
|
||||
|
||||
# DMARC
|
||||
try:
|
||||
answers = dns.resolver.resolve(f"_dmarc.{domain}", 'TXT')
|
||||
for rdata in answers:
|
||||
txt = str(rdata).strip('"')
|
||||
if 'v=DMARC1' in txt:
|
||||
result["dmarc"] = True
|
||||
import re
|
||||
policy = re.search(r'p=(\w+)', txt)
|
||||
result["dmarc_policy"] = policy.group(1) if policy else "unknown"
|
||||
break
|
||||
except Exception:
|
||||
result["issues"].append("No DMARC record found")
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Google Workspace Phishing Protection Auditor")
|
||||
subparsers = parser.add_subparsers(dest="command")
|
||||
|
||||
audit_parser = subparsers.add_parser("audit", help="Audit GWS security config")
|
||||
audit_parser.add_argument("--config-file", required=True)
|
||||
|
||||
auth_parser = subparsers.add_parser("check-auth", help="Check email authentication")
|
||||
auth_parser.add_argument("--domain", required=True)
|
||||
|
||||
parser.add_argument("--json", action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.command == "audit":
|
||||
with open(args.config_file) as f:
|
||||
config = json.load(f)
|
||||
result = audit_gws_config(config)
|
||||
if args.json:
|
||||
print(json.dumps(asdict(result), indent=2))
|
||||
else:
|
||||
print(f"Security Score: {result.score}/{result.max_score}")
|
||||
if result.findings:
|
||||
print(f"\nFindings ({len(result.findings)}):")
|
||||
for i, f_item in enumerate(result.findings, 1):
|
||||
print(f" {i}. {f_item}")
|
||||
if result.recommendations:
|
||||
print(f"\nRecommendations ({len(result.recommendations)}):")
|
||||
for i, rec in enumerate(result.recommendations, 1):
|
||||
print(f" {i}. {rec}")
|
||||
|
||||
elif args.command == "check-auth":
|
||||
result = check_google_auth(args.domain)
|
||||
print(json.dumps(result, indent=2))
|
||||
|
||||
else:
|
||||
parser.print_help()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user