ScriptSentry: Detect Sensitive Information in JavaScript https://n8nworkflows.xyz/workflows/scriptsentry--detect-sensitive-information-in-javascript-5497 # ScriptSentry: Detect Sensitive Information in JavaScript ### 1. Workflow Overview **Purpose:** "ScriptSentry: Detect Sensitive Information in JavaScript" is an automated security assessment workflow designed to scan a user-specified website for JavaScript files that may contain sensitive information such as API keys, email addresses, and personally identifiable information (PII). It extracts JavaScript URLs from the landing page, analyzes their content using AI, summarizes findings, and sends a formatted email report to designated recipients. **Target Use Cases:** - Ethical hackers or security analysts performing automated scans for exposed secrets in JavaScript files of client websites. - Website owners or developers wanting a quick check of their public-facing JavaScript for accidental credential exposure or PII leaks. - Security operations teams integrating AI-driven static resource inspection into their vulnerability management workflows. **Logical Blocks:** - **1.1 Input Reception** Captures the target website URL via a form interface. - **1.2 JavaScript Retrieval and Extraction** Uses Puppeteer to load the target page and extracts JavaScript file URLs from its HTML content. - **1.3 Data Aggregation and Preparation** Aggregates extracted URLs into a unified data structure and prepares it for AI analysis. - **1.4 AI-Powered Sensitive Data Analysis & Email Composition** Invokes a Langchain agent powered by OpenAI to analyze JavaScript content for sensitive data and generate a detailed email report. - **1.5 Email Formatting and Sending** Formats the AI output into an HTML report and sends it via Gmail. - **Supplementary:** Sticky notes provide contextual instructions, prerequisites, and usage guidance throughout the workflow. --- ### 2. Block-by-Block Analysis #### 1.1 Input Reception - **Overview:** Collects the target landing page URL from the user via a web form, triggering the workflow execution. - **Nodes Involved:** - Landing Page Url1 - **Node Details:** - **Landing Page Url1** - *Type:* Form Trigger - *Configuration:* - Form titled "Website Security Scanner" with a required field labeled "Landing Page Url" (placeholder: https://example.com) - Description prompts user to submit a URL for security assessment - *Input/Output:* Entry point; outputs form data JSON with the URL string - *Edge Cases:* - Missing or malformed URL input may cause downstream Puppeteer failure - Requires user to access and submit the form via the provided webhook URL - *Version:* 2.2 - **Sticky Notes:** - "Target URL" explains how to execute and use the form trigger URL. --- #### 1.2 JavaScript Retrieval and Extraction - **Overview:** Loads the specified webpage using Puppeteer headless browser, then extracts all JavaScript `