Skip to content

SSZcreate/Pentab_server / .agents/skills/cybersecurity

cybersecurity

Flagged

FileKindSize
SKILL.mdskill md2.4 KB
skills/implementing-pam-for-database-access/LICENSEother11.0 KB
skills/implementing-pam-for-database-access/SKILL.mdmarkdown3.1 KB
skills/implementing-pam-for-database-access/references/api-reference.mdmarkdown2.8 KB
skills/implementing-pam-for-database-access/scripts/agent.pyscript3.9 KB
skills/implementing-passwordless-auth-with-microsoft-entra/LICENSEother11.0 KB
skills/implementing-passwordless-auth-with-microsoft-entra/SKILL.mdmarkdown21.1 KB
skills/implementing-passwordless-auth-with-microsoft-entra/references/api-reference.mdmarkdown2.4 KB
skills/implementing-passwordless-auth-with-microsoft-entra/scripts/agent.pyscript8.4 KB
skills/implementing-passwordless-authentication-with-fido2/LICENSEother11.0 KB
skills/implementing-passwordless-authentication-with-fido2/SKILL.mdmarkdown2.8 KB
skills/implementing-passwordless-authentication-with-fido2/references/api-reference.mdmarkdown3.0 KB
skills/implementing-passwordless-authentication-with-fido2/references/standards.mdmarkdown888 B
skills/implementing-passwordless-authentication-with-fido2/references/workflows.mdmarkdown1.5 KB
skills/implementing-passwordless-authentication-with-fido2/scripts/agent.pyscript3.6 KB
skills/implementing-patch-management-for-ot-systems/LICENSEother11.0 KB
skills/implementing-patch-management-for-ot-systems/SKILL.mdmarkdown12.4 KB
skills/implementing-patch-management-for-ot-systems/references/api-reference.mdmarkdown2.9 KB
skills/implementing-patch-management-for-ot-systems/scripts/agent.pyscript3.5 KB
skills/implementing-patch-management-workflow/LICENSEother11.0 KB
skills/implementing-patch-management-workflow/SKILL.mdmarkdown10.5 KB
skills/implementing-patch-management-workflow/assets/template.mdmarkdown1.1 KB
skills/implementing-patch-management-workflow/references/api-reference.mdmarkdown4.5 KB
skills/implementing-patch-management-workflow/references/standards.mdmarkdown1.5 KB
skills/implementing-patch-management-workflow/references/workflows.mdmarkdown2.4 KB
skills/implementing-patch-management-workflow/scripts/agent.pyscript9.6 KB
skills/implementing-patch-management-workflow/scripts/process.pyscript13.7 KB
skills/implementing-pci-dss-compliance-controls/LICENSEother11.0 KB
skills/implementing-pci-dss-compliance-controls/SKILL.mdmarkdown6.4 KB
skills/implementing-pci-dss-compliance-controls/assets/template.mdmarkdown4.2 KB
skills/implementing-pci-dss-compliance-controls/references/api-reference.mdmarkdown6.3 KB
skills/implementing-pci-dss-compliance-controls/references/standards.mdmarkdown1.1 KB
skills/implementing-pci-dss-compliance-controls/references/workflows.mdmarkdown1.6 KB
skills/implementing-pci-dss-compliance-controls/scripts/agent.pyscript12.0 KB
skills/implementing-pod-security-admission-controller/LICENSEother11.0 KB
skills/implementing-pod-security-admission-controller/SKILL.mdmarkdown9.6 KB
skills/implementing-pod-security-admission-controller/assets/template.mdmarkdown1.3 KB
skills/implementing-pod-security-admission-controller/references/api-reference.mdmarkdown5.1 KB
skills/implementing-pod-security-admission-controller/references/standards.mdmarkdown1.1 KB
skills/implementing-pod-security-admission-controller/references/workflows.mdmarkdown1.0 KB
skills/implementing-pod-security-admission-controller/scripts/agent.pyscript11.4 KB
skills/implementing-pod-security-admission-controller/scripts/process.pyscript5.1 KB
skills/implementing-policy-as-code-with-open-policy-agent/LICENSEother11.0 KB
skills/implementing-policy-as-code-with-open-policy-agent/SKILL.mdmarkdown10.1 KB
skills/implementing-policy-as-code-with-open-policy-agent/assets/template.mdmarkdown1.8 KB
skills/implementing-policy-as-code-with-open-policy-agent/references/api-reference.mdmarkdown4.0 KB
skills/implementing-policy-as-code-with-open-policy-agent/references/standards.mdmarkdown1.1 KB
skills/implementing-policy-as-code-with-open-policy-agent/references/workflows.mdmarkdown1.9 KB
skills/implementing-policy-as-code-with-open-policy-agent/scripts/agent.pyscript9.3 KB
skills/implementing-policy-as-code-with-open-policy-agent/scripts/process.pyscript5.8 KB
skills/implementing-privileged-access-management-with-cyberark/LICENSEother11.0 KB
skills/implementing-privileged-access-management-with-cyberark/SKILL.mdmarkdown7.2 KB
skills/implementing-privileged-access-management-with-cyberark/assets/template.mdmarkdown2.5 KB
skills/implementing-privileged-access-management-with-cyberark/references/api-reference.mdmarkdown4.5 KB
skills/implementing-privileged-access-management-with-cyberark/references/standards.mdmarkdown1.5 KB
skills/implementing-privileged-access-management-with-cyberark/references/workflows.mdmarkdown3.0 KB
skills/implementing-privileged-access-management-with-cyberark/scripts/agent.pyscript9.6 KB
skills/implementing-privileged-access-management-with-cyberark/scripts/process.pyscript16.5 KB
skills/implementing-privileged-access-workstation/LICENSEother11.0 KB
skills/implementing-privileged-access-workstation/SKILL.mdmarkdown2.5 KB
skills/implementing-privileged-access-workstation/references/api-reference.mdmarkdown2.0 KB
skills/implementing-privileged-access-workstation/scripts/agent.pyscript7.4 KB
skills/implementing-privileged-session-monitoring/LICENSEother11.0 KB
skills/implementing-privileged-session-monitoring/SKILL.mdmarkdown11.6 KB
skills/implementing-privileged-session-monitoring/references/api-reference.mdmarkdown2.0 KB
skills/implementing-privileged-session-monitoring/scripts/agent.pyscript8.0 KB
skills/implementing-proofpoint-email-security-gateway/LICENSEother11.0 KB
skills/implementing-proofpoint-email-security-gateway/SKILL.mdmarkdown6.9 KB
skills/implementing-proofpoint-email-security-gateway/assets/template.mdmarkdown1.7 KB
skills/implementing-proofpoint-email-security-gateway/references/api-reference.mdmarkdown5.1 KB
skills/implementing-proofpoint-email-security-gateway/references/standards.mdmarkdown1.7 KB
skills/implementing-proofpoint-email-security-gateway/references/workflows.mdmarkdown2.7 KB
skills/implementing-proofpoint-email-security-gateway/scripts/agent.pyscript8.2 KB
skills/implementing-proofpoint-email-security-gateway/scripts/process.pyscript11.1 KB
skills/implementing-purdue-model-network-segmentation/LICENSEother11.0 KB
skills/implementing-purdue-model-network-segmentation/SKILL.mdmarkdown17.1 KB
skills/implementing-purdue-model-network-segmentation/references/api-reference.mdmarkdown5.5 KB
skills/implementing-purdue-model-network-segmentation/scripts/agent.pyscript7.5 KB
skills/implementing-ransomware-backup-strategy/LICENSEother11.0 KB
skills/implementing-ransomware-backup-strategy/SKILL.mdmarkdown12.2 KB
skills/implementing-ransomware-backup-strategy/assets/template.mdmarkdown3.7 KB
skills/implementing-ransomware-backup-strategy/references/api-reference.mdmarkdown6.5 KB
skills/implementing-ransomware-backup-strategy/references/standards.mdmarkdown2.5 KB
skills/implementing-ransomware-backup-strategy/references/workflows.mdmarkdown3.7 KB
skills/implementing-ransomware-backup-strategy/scripts/agent.pyscript11.8 KB
skills/implementing-ransomware-backup-strategy/scripts/process.pyscript22.3 KB
skills/implementing-ransomware-kill-switch-detection/LICENSEother11.0 KB
skills/implementing-ransomware-kill-switch-detection/SKILL.mdmarkdown9.5 KB
skills/implementing-ransomware-kill-switch-detection/references/api-reference.mdmarkdown3.7 KB
skills/implementing-ransomware-kill-switch-detection/scripts/agent.pyscript12.0 KB
skills/implementing-rapid7-insightvm-for-scanning/LICENSEother11.0 KB
skills/implementing-rapid7-insightvm-for-scanning/SKILL.mdmarkdown12.0 KB
skills/implementing-rapid7-insightvm-for-scanning/assets/template.mdmarkdown1.4 KB
skills/implementing-rapid7-insightvm-for-scanning/references/api-reference.mdmarkdown4.6 KB
skills/implementing-rapid7-insightvm-for-scanning/references/standards.mdmarkdown1.5 KB
skills/implementing-rapid7-insightvm-for-scanning/references/workflows.mdmarkdown5.7 KB
skills/implementing-rapid7-insightvm-for-scanning/scripts/agent.pyscript9.1 KB
skills/implementing-rapid7-insightvm-for-scanning/scripts/process.pyscript11.7 KB
skills/implementing-rbac-hardening-for-kubernetes/LICENSEother11.0 KB
skills/implementing-rbac-hardening-for-kubernetes/SKILL.mdmarkdown7.8 KB
skills/implementing-rbac-hardening-for-kubernetes/assets/template.mdmarkdown741 B
skills/implementing-rbac-hardening-for-kubernetes/references/api-reference.mdmarkdown6.1 KB
skills/implementing-rbac-hardening-for-kubernetes/references/standards.mdmarkdown766 B
skills/implementing-rbac-hardening-for-kubernetes/references/workflows.mdmarkdown708 B
skills/implementing-rbac-hardening-for-kubernetes/scripts/agent.pyscript9.7 KB
skills/implementing-rbac-hardening-for-kubernetes/scripts/process.pyscript6.9 KB
skills/implementing-rsa-key-pair-management/LICENSEother11.0 KB
skills/implementing-rsa-key-pair-management/SKILL.mdmarkdown3.6 KB
skills/implementing-rsa-key-pair-management/assets/template.mdmarkdown1.6 KB
skills/implementing-rsa-key-pair-management/references/api-reference.mdmarkdown5.7 KB
skills/implementing-rsa-key-pair-management/references/standards.mdmarkdown1.8 KB
skills/implementing-rsa-key-pair-management/references/workflows.mdmarkdown1.5 KB
skills/implementing-rsa-key-pair-management/scripts/agent.pyscript9.3 KB
skills/implementing-rsa-key-pair-management/scripts/process.pyscript11.5 KB
skills/implementing-runtime-application-self-protection/LICENSEother11.0 KB
skills/implementing-runtime-application-self-protection/SKILL.mdmarkdown2.9 KB
skills/implementing-runtime-application-self-protection/references/api-reference.mdmarkdown2.6 KB
skills/implementing-runtime-application-self-protection/scripts/agent.pyscript6.7 KB
skills/implementing-runtime-security-with-tetragon/LICENSEother11.0 KB
skills/implementing-runtime-security-with-tetragon/SKILL.mdmarkdown8.3 KB
skills/implementing-runtime-security-with-tetragon/assets/template.mdmarkdown2.5 KB
skills/implementing-runtime-security-with-tetragon/references/api-reference.mdmarkdown957 B
skills/implementing-runtime-security-with-tetragon/references/standards.mdmarkdown2.0 KB
skills/implementing-runtime-security-with-tetragon/references/workflows.mdmarkdown2.7 KB
skills/implementing-runtime-security-with-tetragon/scripts/agent.pyscript4.1 KB
skills/implementing-runtime-security-with-tetragon/scripts/process.pyscript13.4 KB
skills/implementing-saml-sso-with-okta/LICENSEother11.0 KB
skills/implementing-saml-sso-with-okta/SKILL.mdmarkdown6.6 KB
skills/implementing-saml-sso-with-okta/assets/template.mdmarkdown4.1 KB
skills/implementing-saml-sso-with-okta/references/api-reference.mdmarkdown1.6 KB
skills/implementing-saml-sso-with-okta/references/standards.mdmarkdown2.1 KB
skills/implementing-saml-sso-with-okta/references/workflows.mdmarkdown3.4 KB
skills/implementing-saml-sso-with-okta/scripts/agent.pyscript7.6 KB
skills/implementing-saml-sso-with-okta/scripts/process.pyscript19.2 KB
skills/implementing-scim-provisioning-with-okta/LICENSEother11.0 KB
skills/implementing-scim-provisioning-with-okta/SKILL.mdmarkdown9.0 KB
skills/implementing-scim-provisioning-with-okta/assets/template.mdmarkdown2.5 KB
skills/implementing-scim-provisioning-with-okta/references/api-reference.mdmarkdown4.6 KB
skills/implementing-scim-provisioning-with-okta/references/standards.mdmarkdown2.3 KB
skills/implementing-scim-provisioning-with-okta/references/workflows.mdmarkdown2.8 KB
skills/implementing-scim-provisioning-with-okta/scripts/agent.pyscript9.0 KB
skills/implementing-scim-provisioning-with-okta/scripts/process.pyscript15.3 KB
skills/implementing-secret-scanning-with-gitleaks/LICENSEother11.0 KB
skills/implementing-secret-scanning-with-gitleaks/SKILL.mdmarkdown11.1 KB
skills/implementing-secret-scanning-with-gitleaks/assets/template.mdmarkdown4.7 KB
skills/implementing-secret-scanning-with-gitleaks/references/api-reference.mdmarkdown4.5 KB
skills/implementing-secret-scanning-with-gitleaks/references/standards.mdmarkdown2.2 KB
skills/implementing-secret-scanning-with-gitleaks/references/workflows.mdmarkdown5.0 KB
skills/implementing-secret-scanning-with-gitleaks/scripts/agent.pyscript7.2 KB
skills/implementing-secret-scanning-with-gitleaks/scripts/process.pyscript9.8 KB
skills/implementing-secrets-management-with-vault/LICENSEother11.0 KB
skills/implementing-secrets-management-with-vault/SKILL.mdmarkdown12.3 KB
skills/implementing-secrets-management-with-vault/references/api-reference.mdmarkdown4.1 KB
skills/implementing-secrets-management-with-vault/scripts/agent.pyscript10.7 KB
skills/implementing-secrets-scanning-in-ci-cd/LICENSEother11.0 KB
skills/implementing-secrets-scanning-in-ci-cd/SKILL.mdmarkdown3.7 KB
skills/implementing-secrets-scanning-in-ci-cd/references/api-reference.mdmarkdown3.0 KB
skills/implementing-secrets-scanning-in-ci-cd/scripts/agent.pyscript5.8 KB
skills/implementing-security-chaos-engineering/LICENSEother11.0 KB
skills/implementing-security-chaos-engineering/SKILL.mdmarkdown2.5 KB
skills/implementing-security-chaos-engineering/references/api-reference.mdmarkdown1.4 KB
skills/implementing-security-chaos-engineering/scripts/agent.pyscript8.1 KB
skills/implementing-security-information-sharing-with-stix2/LICENSEother11.0 KB
skills/implementing-security-information-sharing-with-stix2/SKILL.mdmarkdown12.8 KB
skills/implementing-security-information-sharing-with-stix2/references/api-reference.mdmarkdown2.0 KB
skills/implementing-security-information-sharing-with-stix2/scripts/agent.pyscript7.0 KB
skills/implementing-security-monitoring-with-datadog/LICENSEother11.0 KB
skills/implementing-security-monitoring-with-datadog/SKILL.mdmarkdown14.3 KB
skills/implementing-security-monitoring-with-datadog/references/api-reference.mdmarkdown3.4 KB
skills/implementing-security-monitoring-with-datadog/scripts/agent.pyscript5.8 KB
skills/implementing-semgrep-for-custom-sast-rules/LICENSEother11.0 KB
skills/implementing-semgrep-for-custom-sast-rules/SKILL.mdmarkdown7.5 KB
skills/implementing-semgrep-for-custom-sast-rules/references/api-reference.mdmarkdown5.1 KB
skills/implementing-semgrep-for-custom-sast-rules/references/standards.mdmarkdown1.1 KB
skills/implementing-semgrep-for-custom-sast-rules/scripts/agent.pyscript7.6 KB
skills/implementing-siem-correlation-rules-for-apt/LICENSEother11.0 KB
skills/implementing-siem-correlation-rules-for-apt/SKILL.mdmarkdown3.1 KB
skills/implementing-siem-correlation-rules-for-apt/references/api-reference.mdmarkdown1.7 KB
skills/implementing-siem-correlation-rules-for-apt/scripts/agent.pyscript10.4 KB
skills/implementing-siem-use-case-tuning/LICENSEother11.0 KB
skills/implementing-siem-use-case-tuning/SKILL.mdmarkdown2.6 KB
skills/implementing-siem-use-case-tuning/references/api-reference.mdmarkdown2.1 KB
skills/implementing-siem-use-case-tuning/scripts/agent.pyscript8.1 KB
skills/implementing-siem-use-cases-for-detection/LICENSEother11.0 KB
skills/implementing-siem-use-cases-for-detection/SKILL.mdmarkdown11.1 KB
skills/implementing-siem-use-cases-for-detection/references/api-reference.mdmarkdown2.1 KB
skills/implementing-siem-use-cases-for-detection/scripts/agent.pyscript8.7 KB
skills/implementing-sigstore-for-software-signing/LICENSEother11.0 KB
skills/implementing-sigstore-for-software-signing/SKILL.mdmarkdown12.6 KB
skills/implementing-sigstore-for-software-signing/references/api-reference.mdmarkdown5.1 KB
skills/implementing-sigstore-for-software-signing/scripts/agent.pyscript17.7 KB
skills/implementing-soar-automation-with-phantom/LICENSEother11.0 KB
skills/implementing-soar-automation-with-phantom/SKILL.mdmarkdown14.3 KB
skills/implementing-soar-automation-with-phantom/references/api-reference.mdmarkdown2.6 KB
skills/implementing-soar-automation-with-phantom/scripts/agent.pyscript9.4 KB
skills/implementing-soar-playbook-for-phishing/LICENSEother11.0 KB
skills/implementing-soar-playbook-for-phishing/SKILL.mdmarkdown4.8 KB
skills/implementing-soar-playbook-for-phishing/references/api-reference.mdmarkdown2.5 KB
skills/implementing-soar-playbook-for-phishing/scripts/agent.pyscript8.6 KB
skills/implementing-soar-playbook-with-palo-alto-xsoar/LICENSEother11.0 KB

skills/implementing-proofpoint-email-security-gateway/scripts/process.py

View on GitHub
#!/usr/bin/env python3
"""
Proofpoint Email Security Gateway Configuration Validator

Validates MX records, SPF/DKIM/DMARC alignment, and Proofpoint
mail flow configuration for a given domain. Uses DNS lookups to
verify that email is routing through Proofpoint correctly.

Usage:
    python process.py check-mx --domain example.com
    python process.py check-auth --domain example.com
    python process.py validate-headers --eml-file message.eml
"""

import argparse
import json
import re
import sys
from dataclasses import dataclass, field, asdict
from typing import Optional

try:
    import dns.resolver
    HAS_DNS = True
except ImportError:
    HAS_DNS = False


@dataclass
class MXCheckResult:
    """MX record validation result."""
    domain: str = ""
    mx_records: list = field(default_factory=list)
    routes_through_proofpoint: bool = False
    proofpoint_mx: str = ""
    issues: list = field(default_factory=list)


@dataclass
class AuthCheckResult:
    """Email authentication check result."""
    domain: str = ""
    spf_record: str = ""
    spf_includes_proofpoint: bool = False
    dmarc_record: str = ""
    dmarc_policy: str = ""
    dkim_selector: str = ""
    issues: list = field(default_factory=list)


@dataclass
class HeaderAnalysis:
    """Email header forensic analysis."""
    from_address: str = ""
    return_path: str = ""
    received_chain: list = field(default_factory=list)
    spf_result: str = ""
    dkim_result: str = ""
    dmarc_result: str = ""
    proofpoint_headers: list = field(default_factory=list)
    x_proofpoint_spam_details: str = ""
    x_proofpoint_virus_version: str = ""
    passed_through_proofpoint: bool = False
    issues: list = field(default_factory=list)


PROOFPOINT_MX_PATTERNS = [
    r'\.pphosted\.com$',
    r'\.proofpoint\.com$',
    r'mail\.protection\.proofpoint\.com$',
]

PROOFPOINT_SPF_INCLUDES = [
    'spf-a.proofpoint.com',
    'spf-b.proofpoint.com',
    'spf.proofpoint.com',
    'pphosted.com',
]

PROOFPOINT_HEADER_MARKERS = [
    'X-Proofpoint-Spam-Details',
    'X-Proofpoint-Virus-Version',
    'X-Proofpoint-GUID',
    'X-Proofpoint-ORIG-GUID',
]


def check_mx_records(domain: str) -> MXCheckResult:
    """Check if domain MX records route through Proofpoint."""
    result = MXCheckResult(domain=domain)

    if not HAS_DNS:
        result.issues.append("dnspython not installed. Install with: pip install dnspython")
        return result

    try:
        answers = dns.resolver.resolve(domain, 'MX')
        for rdata in sorted(answers, key=lambda r: r.preference):
            mx_host = str(rdata.exchange).rstrip('.')
            result.mx_records.append({
                "priority": rdata.preference,
                "host": mx_host
            })
            for pattern in PROOFPOINT_MX_PATTERNS:
                if re.search(pattern, mx_host, re.IGNORECASE):
                    result.routes_through_proofpoint = True
                    result.proofpoint_mx = mx_host
                    break
    except dns.resolver.NXDOMAIN:
        result.issues.append(f"Domain {domain} does not exist")
    except dns.resolver.NoAnswer:
        result.issues.append(f"No MX records found for {domain}")
    except Exception as e:
        result.issues.append(f"DNS query failed: {str(e)}")

    if not result.routes_through_proofpoint and result.mx_records:
        result.issues.append(
            "MX records do not point to Proofpoint. "
            "Expected pattern: *.pphosted.com or *.proofpoint.com"
        )

    return result


def check_authentication(domain: str) -> AuthCheckResult:
    """Check SPF, DKIM, and DMARC records for Proofpoint alignment."""
    result = AuthCheckResult(domain=domain)

    if not HAS_DNS:
        result.issues.append("dnspython not installed. Install with: pip install dnspython")
        return result

    # Check SPF
    try:
        answers = dns.resolver.resolve(domain, 'TXT')
        for rdata in answers:
            txt = str(rdata).strip('"')
            if txt.startswith('v=spf1'):
                result.spf_record = txt
                for include in PROOFPOINT_SPF_INCLUDES:
                    if include in txt:
                        result.spf_includes_proofpoint = True
                        break
                break
    except Exception:
        result.issues.append("Could not retrieve SPF record")

    if result.spf_record and not result.spf_includes_proofpoint:
        result.issues.append(
            "SPF record does not include Proofpoint. "
            "Add: include:spf-a.proofpoint.com"
        )

    # Check DMARC
    try:
        dmarc_domain = f"_dmarc.{domain}"
        answers = dns.resolver.resolve(dmarc_domain, 'TXT')
        for rdata in answers:
            txt = str(rdata).strip('"')
            if txt.startswith('v=DMARC1'):
                result.dmarc_record = txt
                policy_match = re.search(r'p=(\w+)', txt)
                if policy_match:
                    result.dmarc_policy = policy_match.group(1)
                break
    except Exception:
        result.issues.append("No DMARC record found")

    if result.dmarc_policy == "none":
        result.issues.append(
            "DMARC policy is set to 'none' (monitoring only). "
            "Plan rollout to 'quarantine' then 'reject'"
        )

    # Check Proofpoint DKIM selector
    try:
        dkim_domain = f"proofpoint._domainkey.{domain}"
        answers = dns.resolver.resolve(dkim_domain, 'TXT')
        for rdata in answers:
            result.dkim_selector = "proofpoint"
            break
    except Exception:
        pass

    return result


def analyze_headers(eml_content: str) -> HeaderAnalysis:
    """Analyze email headers for Proofpoint routing and authentication."""
    analysis = HeaderAnalysis()

    # Extract From header
    from_match = re.search(r'^From:\s*(.+)$', eml_content, re.MULTILINE | re.IGNORECASE)
    if from_match:
        analysis.from_address = from_match.group(1).strip()

    # Extract Return-Path
    rp_match = re.search(r'^Return-Path:\s*(.+)$', eml_content, re.MULTILINE | re.IGNORECASE)
    if rp_match:
        analysis.return_path = rp_match.group(1).strip()

    # Extract Received chain
    received_headers = re.findall(
        r'^Received:\s*(.*?)(?=\n\S|\nReceived:|\n\n)',
        eml_content, re.MULTILINE | re.DOTALL | re.IGNORECASE
    )
    for hdr in received_headers:
        clean = ' '.join(hdr.split())
        analysis.received_chain.append(clean)
        if any(p.replace(r'$', '').replace(r'\.', '.') in clean.lower()
               for p in ['pphosted.com', 'proofpoint.com']):
            analysis.passed_through_proofpoint = True

    # Extract Authentication-Results
    auth_match = re.search(
        r'^Authentication-Results:\s*(.*?)(?=\n\S)',
        eml_content, re.MULTILINE | re.DOTALL | re.IGNORECASE
    )
    if auth_match:
        auth_text = auth_match.group(1)
        spf_match = re.search(r'spf=(\w+)', auth_text)
        if spf_match:
            analysis.spf_result = spf_match.group(1)
        dkim_match = re.search(r'dkim=(\w+)', auth_text)
        if dkim_match:
            analysis.dkim_result = dkim_match.group(1)
        dmarc_match = re.search(r'dmarc=(\w+)', auth_text)
        if dmarc_match:
            analysis.dmarc_result = dmarc_match.group(1)

    # Check for Proofpoint-specific headers
    for marker in PROOFPOINT_HEADER_MARKERS:
        marker_match = re.search(
            rf'^{re.escape(marker)}:\s*(.+)$',
            eml_content, re.MULTILINE | re.IGNORECASE
        )
        if marker_match:
            analysis.proofpoint_headers.append({
                "header": marker,
                "value": marker_match.group(1).strip()
            })
            if marker == 'X-Proofpoint-Spam-Details':
                analysis.x_proofpoint_spam_details = marker_match.group(1).strip()
            elif marker == 'X-Proofpoint-Virus-Version':
                analysis.x_proofpoint_virus_version = marker_match.group(1).strip()

    if not analysis.passed_through_proofpoint and not analysis.proofpoint_headers:
        analysis.issues.append("Email does not appear to have routed through Proofpoint")

    if analysis.spf_result and analysis.spf_result != 'pass':
        analysis.issues.append(f"SPF check failed: {analysis.spf_result}")
    if analysis.dkim_result and analysis.dkim_result != 'pass':
        analysis.issues.append(f"DKIM check failed: {analysis.dkim_result}")
    if analysis.dmarc_result and analysis.dmarc_result != 'pass':
        analysis.issues.append(f"DMARC check failed: {analysis.dmarc_result}")

    return analysis


def format_report(title: str, data: dict) -> str:
    """Format check results as a readable report."""
    lines = []
    lines.append("=" * 60)
    lines.append(f"  {title}")
    lines.append("=" * 60)

    for key, value in data.items():
        if key == 'issues':
            if value:
                lines.append(f"\n  [ISSUES]")
                for i, issue in enumerate(value, 1):
                    lines.append(f"    {i}. {issue}")
        elif isinstance(value, list):
            lines.append(f"\n  {key}:")
            for item in value:
                if isinstance(item, dict):
                    lines.append(f"    - {json.dumps(item)}")
                else:
                    lines.append(f"    - {item}")
        elif isinstance(value, bool):
            status = "YES" if value else "NO"
            lines.append(f"  {key}: {status}")
        else:
            lines.append(f"  {key}: {value}")

    lines.append("=" * 60)
    return "\n".join(lines)


def main():
    parser = argparse.ArgumentParser(description="Proofpoint Email Gateway Validator")
    subparsers = parser.add_subparsers(dest="command")

    mx_parser = subparsers.add_parser("check-mx", help="Check MX records for Proofpoint routing")
    mx_parser.add_argument("--domain", required=True, help="Domain to check")

    auth_parser = subparsers.add_parser("check-auth", help="Check email authentication records")
    auth_parser.add_argument("--domain", required=True, help="Domain to check")

    hdr_parser = subparsers.add_parser("validate-headers", help="Analyze email headers")
    hdr_parser.add_argument("--eml-file", required=True, help="Path to .eml file")

    parser.add_argument("--json", action="store_true", help="Output as JSON")

    args = parser.parse_args()

    if args.command == "check-mx":
        result = check_mx_records(args.domain)
        if args.json:
            print(json.dumps(asdict(result), indent=2))
        else:
            print(format_report("PROOFPOINT MX RECORD CHECK", asdict(result)))

    elif args.command == "check-auth":
        result = check_authentication(args.domain)
        if args.json:
            print(json.dumps(asdict(result), indent=2))
        else:
            print(format_report("EMAIL AUTHENTICATION CHECK", asdict(result)))

    elif args.command == "validate-headers":
        with open(args.eml_file, 'r', errors='replace') as f:
            content = f.read()
        result = analyze_headers(content)
        if args.json:
            print(json.dumps(asdict(result), indent=2))
        else:
            print(format_report("EMAIL HEADER ANALYSIS", asdict(result)))

    else:
        parser.print_help()


if __name__ == "__main__":
    main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall