<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" >

<channel>
	<title>Kaushal Bhavsar</title>
	<atom:link href="https://kaushalbhavsar.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>https://kaushalbhavsar.com</link>
	<description></description>
	<lastBuildDate>Thu, 22 Oct 2026 11:33:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<itunes:subtitle>Kaushal Bhavsar</itunes:subtitle>
	<itunes:summary></itunes:summary>
	<itunes:explicit>clean</itunes:explicit>
	<item>
		<title>Critical PHP RCE Advisory: Patch CVE-2026-109618 and CVE-2026-109619 Now</title>
		<link>https://kaushalbhavsar.com/vulnerabilities/critical-php-rce-advisory-patch-cve-2026-109618-and-cve-2026-109619-now/</link>
					<comments>https://kaushalbhavsar.com/vulnerabilities/critical-php-rce-advisory-patch-cve-2026-109618-and-cve-2026-109619-now/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 18:34:06 +0000</pubDate>
				<category><![CDATA[Vulnerabilities]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=3612</guid>

					<description><![CDATA[PHP2Shell exposes PHP web servers to critical remote code execution risks. I explain the affected runtimes, fixed PHP versions, and the checks administrators should complete after patching.]]></description>
										<content:encoded><![CDATA[<p>If your website runs on PHP, I recommend treating this as an emergency update. On 21 October 2026, the PHP project released fixes for two critical vulnerabilities that can let an unauthenticated attacker execute code on an affected server. Both carry a CVSS v4.0 score of 9.2.</p>
<p>The vulnerabilities, also known as PHP2Shell, are tracked as <strong>CVE-2026-109618</strong> and <strong>CVE-2026-109619</strong>. <a href="https://watchtowr.com/intelligence/php-cve-2026-109618-faq/" target="_blank" rel="noopener">watchTowr reports exploitation in the wild</a>, and <a href="https://blog.cloudflare.com/php-vulnerabilities-waf-protection/" target="_blank" rel="noopener">Cloudflare reports attack traffic targeting its customers</a>. I would prioritise internet-facing PHP services immediately.</p>
<h2>Who needs to act?</h2>
<p>The <a href="https://www.php.net/archive/2026.php" target="_blank" rel="noopener">PHP project&#8217;s advisory</a> identifies all PHP installations serving web requests as at risk, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The project considers mod_php the highest-risk configuration: a demonstrated attack can reach the vulnerable path before application code starts running.</p>
<p>For WordPress owners, the important distinction is that <strong>updating WordPress, plugins or themes does not update the PHP runtime</strong>. PHP is part of the hosting environment. If your host manages it, ask the host to confirm that the PHP version serving your site has received the fix. If you manage a VPS or dedicated server yourself, check who is responsible for installing the packages and restarting the services.</p>
<h2>What goes wrong inside PHP?</h2>
<ul>
<li><strong>CVE-2026-109618: out-of-memory corruption.</strong> A memory allocation failure can interrupt PHP while internal request data is only partly initialised. Request cleanup can then use that incomplete data as if it were valid, opening a path to remote code execution.</li>
<li><strong>CVE-2026-109619: stale global state.</strong> A worker can retain references to memory that belonged to an earlier request and has already been freed. A subsequent request handled by that worker can access the stale state before normal initialisation replaces it.</li>
</ul>
<p>The exact attack conditions vary with the PHP build, configuration and request handling. Using PHP-FPM instead of mod_php is not a reason to skip the update.</p>
<h2>Fixed PHP versions</h2>
<p>Install the fixed release for your PHP branch, or a later security release:</p>
<ul><li><strong>PHP 8.5: 8.5.12</strong></li><li><strong>PHP 8.4: 8.4.27</strong></li><li><strong>PHP 8.3: 8.3.36</strong></li><li><strong>PHP 8.2: 8.2.35</strong></li></ul>
<p>PHP 8.2 reaches upstream end of life on 31 December 2026. Patch it now and plan the move to a supported branch.</p>
<p>PHP 8.1 and older no longer receive regular security releases from the PHP project. Upgrade to a supported branch or obtain a confirmed backported fix from your distribution or support vendor. The PHP security team has provided minimal source backports for PHP 7.4, 8.0 and 8.1 for people building from source; these are not ready-to-install packages or a return to normal upstream support.</p>
<p>Some Linux vendors backport security fixes without changing the upstream version shown by PHP. In that case, check the full package revision and the vendor&#8217;s advisory for these CVEs rather than judging the result from the version number alone.</p>



<p class="wp-block-paragraph">Patch every affected PHP runtime and verify the version serving each website. An interim mitigation does not complete remediation.</p>


<figure class="kb-mermaid" data-kb-mermaid-format="svg">
<div class="kb-mermaid__frame">
<pre class="mermaid">flowchart TD
 A[&quot;Inventory PHP runtimes&quot;] --&gt; B{&quot;Patched package available?&quot;}
 B --&gt;|Yes| C[&quot;Back up and install fix&quot;]
 B --&gt;|No| D[&quot;Reduce exposure using vendor guidance&quot;]
 D --&gt; E[&quot;Arrange patched package or upgrade&quot;]
 E --&gt; B
 C --&gt; F[&quot;Restart affected workers&quot;]
 F --&gt; G[&quot;Verify web and CLI runtimes&quot;]
 G --&gt; H{&quot;Every runtime patched?&quot;}
 H --&gt;|No| A
 H --&gt;|Yes| I[&quot;Test application and review logs&quot;]</pre>
</div>
</figure>


<h2>My recommended update checklist</h2>
<ol>
<li><strong>Identify every PHP runtime.</strong> Check each server, container, site and PHP version selected in your hosting panel. Different sites on one server may use different handlers or versions.</li>
<li><strong>Take a current snapshot or backup.</strong> Confirm that you have a recovery path before making the update. Keep the backup separate from the live web directory.</li>
<li><strong>Install the patched packages.</strong> Use your distribution&#8217;s supported package manager, hosting panel or established deployment process. For containers, rebuild with a patched base image and redeploy.</li>
<li><strong>Restart the affected services.</strong> Restart PHP-FPM pools, Apache or the relevant PHP-serving processes so every worker loads the patched runtime. Replacing files on disk does not replace code already loaded in running workers.</li>
<li><strong>Verify the runtime serving each site.</strong> Check the CLI with <code>php -v</code>, then check the web runtime separately. The CLI binary can differ from the version used by your website. In WordPress, review <strong>Tools → Site Health → Info → Server</strong> and confirm the handler and package details with your host. If you temporarily use <code>phpinfo()</code>, restrict access and delete the page immediately after checking it because it exposes configuration details.</li>
<li><strong>Test the application.</strong> Check important pages, logins, forms and uploads, then review PHP and web-server error logs. Record which package and runtime you verified.</li>
</ol>
<h2>Where to get the update</h2>
<p>For <strong>cPanel/WHM</strong>, check EasyApache 4 package updates and the <a href="https://docs.cpanel.net/" target="_blank" rel="noopener">cPanel documentation</a>. For <strong>Plesk</strong>, use the panel&#8217;s update process and check the <a href="https://support.plesk.com/hc/en-us/articles/44397729587351-Vulnerability-CVE-2026-109618-and-CVE-2026-109619-Remote-code-execution-in-PHP-shipped-with-Plesk" target="_blank" rel="noopener">Plesk advisory</a>. For <strong>CloudLinux Alt-PHP</strong>, check the <a href="https://blog.cloudlinux.com/php-cve-2026-109618-and-cve-2026-109619" target="_blank" rel="noopener">CloudLinux update guidance</a> and confirm coverage for every installed branch.</p>
<p>On Debian, Ubuntu, AlmaLinux, Rocky Linux, RHEL or another distribution, follow that vendor&#8217;s security advisory and package instructions. If you use a third-party repository, confirm that its packages include both fixes. I would avoid switching repositories on a production server without checking package compatibility and the rollback plan.</p>
<h2>If you cannot patch immediately</h2>
<p>The PHP project states that its interim measures only reduce exposure to specific attack paths. <strong>They do not make an unpatched installation safe.</strong> Follow the current <a href="https://www.php.net/archive/2026.php" target="_blank" rel="noopener">official PHP guidance</a> for your configuration while arranging the update.</p>
<p>I would avoid copying isolated PHP settings from social media. The advisory&#8217;s memory-limit changes have operational implications, and some settings must apply before request parsing to have any effect. Ask your administrator to apply the full guidance and restart all affected workers. If an exposed service cannot be patched or adequately restricted, consider temporarily taking it offline.</p>
<p>A web application firewall can provide an additional layer of protection against known attack patterns. It does not replace the PHP patch, and any route that reaches the origin directly also needs attention.</p>
<h2>Check for compromise as well as patching</h2>
<p>Review unexpected files in web directories, new scheduled tasks, unfamiliar processes, PHP worker crashes, unusual outbound connections and unexplained load spikes. These are investigation leads, not proof that either vulnerability was exploited.</p>
<p>If you find evidence of compromise, preserve relevant logs and isolate the affected workload while you investigate. Patching closes the vulnerability; it does not remove an existing web shell, undo data access or invalidate credentials an attacker may already have obtained.</p>
<p>After the immediate response, remove unused PHP versions and applications, review automatic security-update settings, and restrict administrative access. Keep your CMS, plugins and themes maintained alongside the underlying runtime.</p>
<h2>Technical references</h2>
<ul><li><a href="https://www.php.net/archive/2026.php" target="_blank" rel="noopener">PHP security announcement and fixed releases, 21 October 2026</a></li><li><a href="https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w" target="_blank" rel="noopener">CVE-2026-109618: PHP&#8217;s out-of-memory corruption advisory</a></li><li><a href="https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp" target="_blank" rel="noopener">CVE-2026-109619: PHP&#8217;s stale global state advisory</a></li></ul>]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/vulnerabilities/critical-php-rce-advisory-patch-cve-2026-109618-and-cve-2026-109619-now/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What “Zero Tribal Knowledge” Would Require from a Software Team</title>
		<link>https://kaushalbhavsar.com/knowledgabase/zero-tribal-knowledge-software-teams/</link>
					<comments>https://kaushalbhavsar.com/knowledgabase/zero-tribal-knowledge-software-teams/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Fri, 16 Oct 2026 02:51:00 +0000</pubDate>
				<category><![CDATA[Knowledge Base]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=3634</guid>

					<description><![CDATA[Documentation becomes useful when another engineer can make a change or recover a service with it. I explain how I would reduce reliance on knowledge held by one person.]]></description>
										<content:encoded><![CDATA[<p><em>Updated: 22 October 2026.</em></p>
<p>A system can have a long README and still depend on one person who knows which warning to ignore, which job must run first and which account actually owns the deployment.</p>
<p>My view is that “zero tribal knowledge” is a useful direction rather than a literal promise. There will always be experience that has not been written down. The priority is to stop important operations depending on information that only one person can supply.</p>
<p>I would measure that through tasks, not document length.</p>
<h2>Begin with the moments that require an interruption</h2>
<p>List the questions that repeatedly bring work back to a particular person. How do I deploy this? Why did this job fail? Which dataset does the dashboard use? What is safe to restart?</p>
<p>Those interruptions reveal the gaps more clearly than asking everybody to “improve documentation.” Each question should lead to an answer stored where the next operator will look.</p>
<p>For a fictional ingestion service, the missing information might be a dependency on a source export that finishes after midnight. A setup guide can be technically accurate while omitting that operating constraint.</p>
<h2>Capture decisions as well as commands</h2>
<p>A command tells me what to run. A decision record tells me why the system works that way and when I should reconsider it.</p>
<p>I would record the problem, the chosen approach, the important alternatives and the consequence of changing it. This can be short. The useful detail is often a constraint, such as an upstream system that cannot support a certain query pattern.</p>
<p>Without that explanation, a future engineer may “simplify” a workaround and reintroduce the original failure.</p>
<h2>Write the failure path</h2>
<p>A happy-path deployment guide is only part of a handover. I would also want the symptoms of common failures, the evidence to collect, safe containment steps and the point at which to escalate.</p>
<p>“Restart the worker” needs conditions. What state can be lost? Could work run twice? How will the operator verify recovery? What should they avoid doing while an incident is being investigated?</p>
<p>Secrets should be referenced through the approved access process, not copied into the runbook. The document should identify the role required and where access is managed.</p>



<p class="wp-block-paragraph">An independent operator reveals missing knowledge by trying a routine task and a recovery scenario.</p>


<figure class="kb-mermaid" data-kb-mermaid-format="svg">
<div class="kb-mermaid__frame">
<pre class="mermaid">flowchart TD
 A[&quot;Record recurring questions&quot;] --&gt; B[&quot;Document decisions and failure paths&quot;]
 B --&gt; C[&quot;Independent operator tries the task&quot;]
 C --&gt; D{&quot;Private help or special access required?&quot;}
 D --&gt;|Yes| E[&quot;Fix process, access or instructions&quot;]
 E --&gt; B
 D --&gt;|No| F[&quot;Verify outcome and recovery&quot;]
 F --&gt; G[&quot;Assign owner and review triggers&quot;]
 G --&gt;|System changes| B</pre>
</div>
</figure>


<h2>Test the handover with an independent operator</h2>
<p>My preferred check is to let another engineer perform a representative task in a safe environment using the documentation. The original author can observe, but every necessary verbal intervention should become an improvement to the process or its instructions.</p>
<p>I would test a routine change and a failure scenario. An independent operator should be able to establish the current state, take an appropriate action and verify the result.</p>
<p>This also reveals problems that documentation alone cannot fix. If the only deployment credential belongs to one individual, writing its existence down does not remove the dependency.</p>
<h2>Keep ownership visible</h2>
<p>Each important document needs an owner and a reason to be reviewed. A change to a dependency, permission or recovery process should trigger an update alongside the code.</p>
<p>I would track practical outcomes: successful independent deployments, fewer unresolved handover questions and recovery exercises completed without private help. The aim is to make knowledge usable at the moment somebody needs it, including when its original author is unavailable.</p>]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/knowledgabase/zero-tribal-knowledge-software-teams/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How AI Coding Sessions Can Create an Unexpected Cloud Bill</title>
		<link>https://kaushalbhavsar.com/knowledgabase/ai-coding-sessions-unexpected-cloud-costs/</link>
					<comments>https://kaushalbhavsar.com/knowledgabase/ai-coding-sessions-unexpected-cloud-costs/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Fri, 03 Jul 2026 02:49:00 +0000</pubDate>
				<category><![CDATA[Knowledge Base]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=3630</guid>

					<description><![CDATA[An AI coding task can make many billable requests while looking like one conversation. I explain the cost controls I would put around cloud-backed development agents.]]></description>
										<content:encoded><![CDATA[<p><em>Updated: 22 October 2026.</em></p>
<p>An unexpected bill from AI-assisted development made me look more closely at what a coding session actually consumes. The interface felt like one conversation. The cloud service was metering the requests behind it.</p>
<p>That difference matters when a tool uses a pay-as-you-go model endpoint. A developer can remain focused on the code while model calls, retries and growing context continue accumulating usage.</p>
<p>I would now treat cost visibility as part of the development setup, alongside credentials and permissions.</p>
<h2>Find out what the session is using</h2>
<p>Before a substantial task, I would check the provider, account, region and selected model. I would also verify whether the tool can change models or use a fallback.</p>
<p>A remembered default is not enough. Configuration can come from several places, and a session may not use the same settings as another terminal or project.</p>
<p>Then I would look at the work being sent. Repository context, terminal output and repeated file content can make a short user prompt part of a much larger request. Tool calls can lead to further model calls. The number of messages I type is therefore a poor measure of the amount of inference performed.</p>
<h2>Separate a cost estimate from a spending control</h2>
<p>For a simple illustrative model, request cost depends on the billed input and output usage and the relevant rates. Caching, model-specific features and other service charges can change the calculation. I would use current provider pricing rather than assume a flat cost per chat.</p>
<p>An estimate helps me plan. It does not stop a process that keeps making calls.</p>
<p>AWS Budgets supports notifications and configured actions, but billing information is not updated on every inference request. I would not treat a budget notification as an immediate hard cap on a running agent.</p>



<p class="wp-block-paragraph">Budget notifications provide monitoring; request-level limits and a stop condition control the running workload.</p>


<figure class="kb-mermaid" data-kb-mermaid-format="svg">
<div class="kb-mermaid__frame">
<pre class="mermaid">flowchart TD
 A[&quot;Scoped coding task&quot;] --&gt; B[&quot;Check provider, model and budget&quot;]
 B --&gt; C{&quot;Run limits permit another request?&quot;}
 C --&gt;|No| S[&quot;Stop and report usage&quot;]
 C --&gt;|Yes| D[&quot;Send model request&quot;]
 D --&gt; E[&quot;Record usage and outcome&quot;]
 E --&gt; F{&quot;Task complete?&quot;}
 F --&gt;|No| C
 F --&gt;|Yes| S
 E -.-&gt; M[&quot;Billing metrics and budget notifications&quot;]</pre>
</div>
</figure>


<h2>Put limits close to the work</h2>
<p>My starting controls would be a model appropriate to the task, a bounded test run and visible usage reporting. I would set explicit limits on iterations and elapsed time where the tool supports them, with a clear way to cancel the task.</p>
<p>For a shared service, I would consider a gateway that authorises each request against a workload budget. That design needs to account for concurrent and in-flight requests; checking only the previous completed request can still allow overspending.</p>
<p>I would also keep experiments separate from unrelated production workloads where practical. That makes ownership, attribution and the effect of a stop action easier to understand.</p>
<h2>Inspect a small run before scaling it</h2>
<p>For a new coding workflow, I would start with a limited task and compare the tool’s report with the provider’s usage data. How many requests were made? Which model handled them? Did retries occur? Was there a long sequence of unsuccessful edits?</p>
<p>The logs should help answer those questions without collecting source code, secrets or sensitive prompts unnecessarily. Token counts, request identifiers, model identifiers and execution metadata may be sufficient for much of the cost analysis.</p>
<p>If a session behaves unexpectedly, I would stop it before trying to explain the bill in detail. Investigation can follow once further consumption is controlled. The practical change is simple: a cloud-backed coding session should have an owner, a budget and a stop condition before it gets a long-running task.</p>
<h3>References</h3>
<ul>
<li><a href="https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html" target="_blank" rel="noopener">AWS: Managing costs with AWS Budgets</a></li>
<li><a href="https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-best-practices.html" target="_blank" rel="noopener">AWS: Best practices for AWS Budgets</a></li>
<li><a href="https://docs.aws.amazon.com/bedrock/latest/userguide/quotas-token-burndown.html" target="_blank" rel="noopener">AWS: Amazon Bedrock token-usage metrics</a></li>
</ul>]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/knowledgabase/ai-coding-sessions-unexpected-cloud-costs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A Suspicious Login Is Not Proof of an Insider Threat</title>
		<link>https://kaushalbhavsar.com/knowledgabase/suspicious-login-insider-threat-evidence/</link>
					<comments>https://kaushalbhavsar.com/knowledgabase/suspicious-login-insider-threat-evidence/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Sat, 21 Jun 2025 02:40:00 +0000</pubDate>
				<category><![CDATA[Knowledge Base]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=3618</guid>

					<description><![CDATA[Behavioural anomalies can help direct an investigation, but they do not establish intent. I explain how context and corroboration change an insider-risk assessment.]]></description>
										<content:encoded><![CDATA[<p><em>Updated: 22 October 2026.</em></p>
<p>An employee signs in at an unusual hour and downloads more files than usual. A detection system marks the activity as high risk. What has it established?</p>
<p>It has identified behaviour worth examining. It has not yet established who performed the activity, whether it was authorised or why it happened.</p>
<p>My interest in behavioural analysis starts with that distinction. A useful system helps an investigator ask better questions. It should not convert an unexplained event into an accusation.</p>
<h2>Begin with the activity, not a label</h2>
<p>In a hypothetical example, a user who normally works during the day downloads a large archive at night. Several explanations are possible: an approved migration, a new assignment, a compromised account, an automation job or deliberate misuse.</p>
<p>I would describe the event precisely before attaching a conclusion. “The account downloaded these files from this device during this period” is more useful than “the employee behaved maliciously.” The first statement can be checked against evidence.</p>
<p>Even the identity needs examination. An authenticated account is evidence about the credentials or session used; it is not always proof of the person at the keyboard.</p>
<h2>A baseline needs context</h2>
<p>Unusual compared with what? The person’s previous activity, other people in the same role, or the organisation as a whole?</p>
<p>Each comparison has limitations. A new employee has little personal history. A specialist may legitimately behave differently from peers. A change in duties can make last month’s baseline misleading.</p>
<p>I would look for changes in responsibility, approved maintenance, travel, time zones and the sensitivity of the accessed material. These are explanations to verify, not excuses to accept automatically.</p>



<p class="wp-block-paragraph">An anomaly starts an investigation. Context and corroboration determine whether escalation is justified.</p>


<figure class="kb-mermaid" data-kb-mermaid-format="svg">
<div class="kb-mermaid__frame">
<pre class="mermaid">flowchart TD
 A[&quot;Unusual account activity&quot;] --&gt; B[&quot;Confirm activity, device and session&quot;]
 B --&gt; C[&quot;Check role changes and legitimate tasks&quot;]
 C --&gt; D[&quot;Correlate independent evidence&quot;]
 D --&gt; E{&quot;Evidence supports escalation?&quot;}
 E --&gt;|Yes| F[&quot;Proportionate containment and review&quot;]
 E --&gt;|No| G[&quot;Document explanation or uncertainty&quot;]
 F --&gt; H[&quot;Record evidence and decision&quot;]
 G --&gt; H
 H --&gt; I[&quot;Improve detection feedback&quot;]</pre>
</div>
</figure>


<h2>Combine evidence carefully</h2>
<p>A stronger investigation connects independent observations. An unusual download becomes more concerning if it coincides with attempts to bypass permissions, unexplained external transfers or activity inconsistent with an approved task.</p>
<p>However, five alerts are not necessarily five independent pieces of evidence. A single bulk operation can trigger volume, time-of-day and access-pattern rules together. Counting correlated alerts as separate confirmations can exaggerate confidence.</p>
<p>I would also distinguish the model’s anomaly score from a probability of malicious intent. Unless a score has been calibrated and validated for that purpose, the label “90” does not mean a 90 percent chance that a person is an insider threat.</p>
<h2>Measure the investigation process</h2>
<p>My assessment of a detection system would include how often its alerts help, how much analyst time they consume and which legitimate behaviours repeatedly trigger them. Confirmed false positives are valuable feedback about the model, data or assumptions.</p>
<p>The process also needs proportionate monitoring, controlled access to investigation records and clear escalation criteria. Collecting more personal information without a defined purpose can create its own risks.</p>
<p>An analyst should be able to document what was observed, what alternative explanations were checked, what evidence supported the decision and what remains uncertain. That record gives another reviewer a way to challenge the conclusion.</p>
<p>For me, the useful output of behavioural analysis is a defensible investigation lead. Decisions affecting a person require a level of context and review that an unusual login alone cannot provide.</p>
<h3>References</h3>
<ul>
<li><a href="https://www.sei.cmu.edu/library/an-insider-threat-indicator-ontology/" target="_blank" rel="noopener">CMU SEI: An Insider Threat Indicator Ontology</a></li>
<li><a href="https://insights.sei.cmu.edu/blog/improving-insider-threat-detection-methods-through-software-engineering-principles/" target="_blank" rel="noopener">CMU SEI: Improving Insider Threat Detection Methods Through Software Engineering Principles</a></li>
</ul>]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/knowledgabase/suspicious-login-insider-threat-evidence/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WhatsApp Web Phishing Scam Exposed</title>
		<link>https://kaushalbhavsar.com/uncategorized/whatsapp-web-phishing-scam-exposed/</link>
					<comments>https://kaushalbhavsar.com/uncategorized/whatsapp-web-phishing-scam-exposed/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Thu, 07 Sep 2023 01:39:21 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=3126</guid>

					<description><![CDATA[<p>A phishing page can trick you into linking WhatsApp Web to an attacker-controlled session. The sample I examined used a rotating QR code. This abuses device linking — it does not break WhatsApp encryption by itself.</p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I looked at a WhatsApp Web phishing sample that tried to get people to scan a QR code on a fake page. The goal was not to “break” WhatsApp’s encryption. It was to trick someone into authorizing an attacker’s browser as a linked device.</p>



<h2 class="wp-block-heading">What I observed</h2>



<p class="wp-block-paragraph">In the sample I examined, the QR code on the phishing page refreshed over time. A single screenshot could therefore miss changes in the code.</p>



<h2 class="wp-block-heading">How the abuse works (high level)</h2>



<p class="wp-block-paragraph">WhatsApp Web / multi-device linking lets a phone authorize another client. Meta has described companion devices that connect independently while keeping end-to-end encryption for those sessions (<a href="https://engineering.fb.com/2021/07/14/security/whatsapp-multi-device/" target="_blank" rel="noopener">WhatsApp multi-device engineering post</a>). A phishing page abuses that product feature:</p>



<ul class="wp-block-list">
<li>The attacker hosts a page that looks like WhatsApp Web and shows a QR code under their control.</li>
<li>If you scan that code with your phone, you may authorize <em>their</em> session as a linked device.</li>
<li>Once linked, the attacker’s client can receive messages in that linked session until you remove it.</li>
</ul>



<p class="wp-block-paragraph">That is account/device-linking abuse. It is different from decrypting WhatsApp’s end-to-end encryption on the wire.</p>






<p class="wp-block-paragraph">A fake QR page can lead to an attacker-controlled linked device. Removing an unfamiliar session cuts off that linked session.</p>


<figure class="kb-mermaid" data-kb-mermaid-format="svg">
<div class="kb-mermaid__frame">
<pre class="mermaid">flowchart TD
 A[&quot;Page asks for a WhatsApp QR scan&quot;] --&gt; B{&quot;Opened official web.whatsapp.com independently?&quot;}
 B --&gt;|No| C[&quot;Do not scan; open official site&quot;]
 B --&gt;|Yes| D[&quot;Use normal linking with care&quot;]
 E[&quot;Scanned a suspicious QR code&quot;] --&gt; F[&quot;Open Linked Devices on the phone&quot;]
 F --&gt; G[&quot;Log out unfamiliar sessions&quot;]
 G --&gt; H[&quot;Review account activity&quot;]
 E -.-&gt; I[&quot;Attacker client may become linked&quot;]
 I -.-&gt; G</pre>
</div>
</figure>



<h2 class="wp-block-heading">What you should do</h2>



<ul class="wp-block-list">
<li>Open <a href="https://web.whatsapp.com/" target="_blank" rel="noopener">https://web.whatsapp.com/</a> yourself. Do not scan QR codes from unexpected websites, ads, or messages.</li>
<li>If instructions look odd, check WhatsApp’s official Help Center by navigating there independently — not through the suspicious page.</li>
<li>After an accidental scan, open <strong>Linked Devices</strong> on your phone and log out any session you do not recognize.</li>
<li>Two-step verification is still worth enabling, but it does not by itself remove a device that is already linked. Check Linked Devices after a scare.</li>
</ul>



<h2 class="wp-block-heading">For defenders and educators</h2>



<p class="wp-block-paragraph">Teach the difference between “someone stole my password” and “I authorized a linked device.” The second failure mode is easy to miss if people only look for password changes. Screenshots of QR pages go stale quickly when codes rotate, so capture video or multiple frames if you are documenting a sample for analysis.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/uncategorized/whatsapp-web-phishing-scam-exposed/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Decoding Cybersecurity Roles: Analyst vs. Engineer vs. Researcher</title>
		<link>https://kaushalbhavsar.com/career-advise/decoding-cybersecurity-roles-analyst-vs-engineer-vs-researcher/</link>
					<comments>https://kaushalbhavsar.com/career-advise/decoding-cybersecurity-roles-analyst-vs-engineer-vs-researcher/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Sat, 02 Sep 2023 04:06:36 +0000</pubDate>
				<category><![CDATA[Career Advice]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=3122</guid>

					<description><![CDATA[<p>Security analysts, engineers, and researchers overlap in real teams. Here is the practical difference in what each role produces — and where the lines blur.</p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In practice, the difference between a security analyst, a security engineer, and a security researcher is less about job titles and more about the output each role is hired to produce. Titles and boundaries also change by organization size.</p>



<figure class="kb-mermaid" data-kb-mermaid-format="svg"><div class="kb-mermaid__frame"><pre class="mermaid">flowchart LR
A[&quot;Security Analyst&lt;br/&gt;Find what is happening&quot;]
E[&quot;Security Engineer&lt;br/&gt;Build the protection&quot;]
R[&quot;Security Researcher&lt;br/&gt;Discover what is possible&quot;]

R --&gt;|&quot;New vulnerabilities&lt;br/&gt;and techniques&quot;| E
E --&gt;|&quot;Security controls&lt;br/&gt;and telemetry&quot;| A
A --&gt;|&quot;Incidents and&lt;br/&gt;observed threats&quot;| R

classDef blue fill:#E8F3FF,stroke:#357AB8,color:#173A60
classDef green fill:#E7F6EE,stroke:#349668,color:#18543A
classDef purple fill:#F2EBFF,stroke:#8261BD,color:#513783

class A blue
class E green
class R purple</pre></div></figure>



<h2 class="wp-block-heading">Security Analyst</h2>



<p class="wp-block-paragraph"><strong>Typical output:</strong> an investigation report, triage notes, or incident timeline that answers what happened and what to do next.</p>



<p class="wp-block-paragraph">Analysts monitor telemetry, investigate alerts, and coordinate response. Core skills include SIEM and log analysis, pattern recognition in noisy data, and risk assessment that prioritizes action.</p>



<p class="wp-block-paragraph"><strong>Example:</strong> an analyst at a hospital notices unauthorized access to patient records and coordinates containment with IT.</p>



<h2 class="wp-block-heading">Security Engineer</h2>



<p class="wp-block-paragraph"><strong>Typical output:</strong> a control that ships — firewall or WAF rules, identity configuration, hardening changes, or automation that reduces repeat work.</p>



<p class="wp-block-paragraph">Engineers design and operate defenses. Skills often include network and application controls, scripting for automation, and mapping technical work to requirements from laws, regulations, and standards. GDPR and HIPAA are legal/regulatory frameworks; ISO 27001 is a management standard. They are related, but they are not the same kind of document.</p>



<p class="wp-block-paragraph"><strong>Example:</strong> an engineer at a bank deploys a web application firewall and tunes rules for the applications in scope — which is web-attack defense, not a complete DDoS program by itself.</p>



<h2 class="wp-block-heading">Security Researcher</h2>



<p class="wp-block-paragraph"><strong>Typical output:</strong> a finding — vulnerability report, malware analysis note, or technique write-up — often with responsible disclosure.</p>



<p class="wp-block-paragraph">Researchers study what is possible: new weaknesses, novel malware behavior, or attack techniques. Reverse engineering and careful disclosure matter. Finding zero-days is real work for some researchers; it is not a routine weekly expectation for every research title.</p>



<p class="wp-block-paragraph"><strong>Example:</strong> a researcher finds a flaw in a common IoT device and discloses it to the vendor before public discussion.</p>



<h2 class="wp-block-heading">Where the roles overlap</h2>



<figure class="kb-mermaid" data-kb-mermaid-format="svg"><div class="kb-mermaid__frame"><pre class="mermaid">flowchart TB
START{&quot;What interests you most&lt;br/&gt;in cybersecurity?&quot;}

START --&gt;|&quot;Analyzing threats&quot;| A[&quot;SECURITY ANALYST&lt;br/&gt;Detect · Monitor · Respond&quot;]
START --&gt;|&quot;Building defenses&quot;| E[&quot;SECURITY ENGINEER&lt;br/&gt;Design · Implement · Protect&quot;]
START --&gt;|&quot;Exploring vulnerabilities&quot;| R[&quot;SECURITY RESEARCHER&lt;br/&gt;Discover · Investigate · Disclose&quot;]
START --&gt;|&quot;All three&quot;| G[&quot;SECURITY GENERALIST&lt;br/&gt;Combine multiple disciplines&quot;]

A --&gt; A1[&quot;Key Skills&lt;br/&gt;SIEM and log analysis&lt;br/&gt;Threat detection&lt;br/&gt;Risk assessment&quot;]
A1 --&gt; A2[&quot;Typical Activities&lt;br/&gt;Review security logs&lt;br/&gt;Investigate incidents&lt;br/&gt;Coordinate patches and audits&quot;]
A2 --&gt; A3[&quot;Example&lt;br/&gt;Detect unauthorized access&lt;br/&gt;to hospital patient records&quot;]

E --&gt; E1[&quot;Key Skills&lt;br/&gt;Firewall management&lt;br/&gt;Scripting and automation&lt;br/&gt;Security compliance&quot;]
E1 --&gt; E2[&quot;Typical Activities&lt;br/&gt;Deploy security tools&lt;br/&gt;Manage access controls&lt;br/&gt;Conduct security audits&quot;]
E2 --&gt; E3[&quot;Example&lt;br/&gt;Deploy a WAF to protect&lt;br/&gt;financial applications&quot;]

R --&gt; R1[&quot;Key Skills&lt;br/&gt;Vulnerability analysis&lt;br/&gt;Reverse engineering&lt;br/&gt;Responsible disclosure&quot;]
R1 --&gt; R2[&quot;Typical Activities&lt;br/&gt;Analyze malware&lt;br/&gt;Investigate vulnerabilities&lt;br/&gt;Publish findings&quot;]
R2 --&gt; R3[&quot;Example&lt;br/&gt;Discover and responsibly&lt;br/&gt;disclose an IoT vulnerability&quot;]

G --&gt; G1[&quot;Key Strengths&lt;br/&gt;Flexibility across roles&lt;br/&gt;Broader security perspective&lt;br/&gt;Continuous learning&quot;]
G1 --&gt; G2[&quot;Career Opportunities&lt;br/&gt;Cross-functional security work&lt;br/&gt;Security architecture&lt;br/&gt;Potential leadership paths&quot;]

classDef start fill:#172C45,color:#FFFFFF,stroke:#172C45,stroke-width:2px
classDef analyst fill:#E8F3FF,color:#173A60,stroke:#357AB8
classDef engineer fill:#E7F6EE,color:#18543A,stroke:#349668
classDef researcher fill:#F2EBFF,color:#513783,stroke:#8261BD
classDef generalist fill:#FFF3D9,color:#765011,stroke:#CE9B30

class START start
class A,A1,A2,A3 analyst
class E,E1,E2,E3 engineer
class R,R1,R2,R3 researcher
class G,G1,G2 generalist</pre></div></figure>



<p class="wp-block-paragraph">Smaller teams often need one person to cover more than one of these outputs. That “generalist” path is useful. It is also not an automatic pipeline to a CISO role. Leadership roles need breadth plus organizational judgment, not only curiosity across specialties.</p>



<p class="wp-block-paragraph">If you like investigating live incidents, start with analyst work. If you like building controls that stay up in production, lean engineer. If you like digging into unknowns and publishing careful findings, lean research. Many careers move between these over time.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/career-advise/decoding-cybersecurity-roles-analyst-vs-engineer-vs-researcher/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Perform Forensic Investigation on an AWS Instance without a Public Key</title>
		<link>https://kaushalbhavsar.com/knowledgabase/how-to-perform-forensic-investigation-on-an-aws-instance-without-a-public-key/</link>
					<comments>https://kaushalbhavsar.com/knowledgabase/how-to-perform-forensic-investigation-on-an-aws-instance-without-a-public-key/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Wed, 12 Jul 2023 10:43:54 +0000</pubDate>
				<category><![CDATA[Knowledge Base]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=2912</guid>

					<description><![CDATA[Introduction Performing a forensic investigation on an AWS EC2 instance can become complicated if access to the instance is lost or the SSH key is unavailable. Recently, I came upon a case where I did not have the private key to the instance. The only details I had, were the AWS portal login and password. [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">Performing a forensic investigation on an AWS EC2 instance can become complicated if access to the instance is lost or the SSH key is unavailable. Recently, I came upon a case where I did not have the private key to the instance. The only details I had, were the AWS portal login and password. </p>



<p class="wp-block-paragraph">The private key does not serve any other purpose except SSH authentication. So, if we bypass the authentication, we don&#8217;t need the key.  But the fact is, the cloud is just another computer and so, I figured out a way to make this work just like I would do it on a physical computer. </p>



<p class="wp-block-paragraph">Here&#8217;s the process: <br><br><br>Here&#8217;s a step-by-step guide on how to accomplish the same on AWS:</p>



<figure class="kb-mermaid" data-kb-mermaid-format="svg"><div class="kb-mermaid__frame"><pre class="mermaid">flowchart TD
    A[&quot;Detach hard drive from target system&quot;]
    B[&quot;Attach hard drive to another machine&quot;]
    C[&quot;Access target system&#039;s data through the new machine&quot;]

    A --&gt; B --&gt; C</pre></div></figure>



<p class="wp-block-paragraph"></p>


<h2 class="wp-block-heading kb-workflow-step" data-kb-step="1"><span class="kb-workflow-step__index" aria-hidden="true">1</span><span class="kb-workflow-step__text"><span class="kb-workflow-step__kicker">Step 1</span> Creating a Snapshot of the EBS Volume</span></h2>


<p class="wp-block-paragraph">The first step involves creating a snapshot of the EBS volume that&#8217;s attached to the EC2 instance. You can use the AWS CLI to accomplish this:</p>



<pre class="wp-block-code has-light-green-cyan-color has-ast-global-color-3-background-color has-text-color has-background has-medium-font-size"><code><code>aws ec2 create-snapshot </code><code>--volume-id vol-049df61146f12f951 </code><code>--description "Forensic snapsho<span style="background-color: initial; font-family: inherit; font-size: inherit;">t</span></code></code></pre>


<h2 class="wp-block-heading kb-workflow-step" data-kb-step="2"><span class="kb-workflow-step__index" aria-hidden="true">2</span><span class="kb-workflow-step__text"><span class="kb-workflow-step__kicker">Step 2</span> Creating a New Volume from the Snapshot</span></h2>


<p class="wp-block-paragraph">Once the snapshot is ready, you can create a new volume from it. Make sure to create it in the same availability zone as the instance you&#8217;ll be attaching it to:</p>



<pre class="wp-block-preformatted has-light-green-cyan-color has-ast-global-color-3-background-color has-text-color has-background has-medium-font-size"><code>aws ec2 create-volume </code><br><code>--availability-zone us-west-2a </code><br><code>--snapshot-id snap-01234567890abcdef0</code></pre>


<h2 class="wp-block-heading kb-workflow-step" data-kb-step="3"><span class="kb-workflow-step__index" aria-hidden="true">3</span><span class="kb-workflow-step__text"><span class="kb-workflow-step__kicker">Step 3</span> Launching a New EC2 Instance</span></h2>


<p class="wp-block-paragraph">Next, launch a new EC2 instance in the same availability zone as your volume. This instance will act as a bridge to access the data:</p>



<pre class="wp-block-preformatted has-light-green-cyan-color has-ast-global-color-3-background-color has-text-color has-background"><code>aws ec2 run-instances --image-id ami-abcd1234 --count 1 --instance-type t2.micro --key-name MyKeyPair
</code></pre>


<h2 class="wp-block-heading kb-workflow-step" data-kb-step="4"><span class="kb-workflow-step__index" aria-hidden="true">4</span><span class="kb-workflow-step__text"><span class="kb-workflow-step__kicker">Step 4</span> Attaching the New Volume to the New EC2 Instance</span></h2>


<pre class="wp-block-code has-light-green-cyan-color has-ast-global-color-3-background-color has-text-color has-background"><code><code>aws ec2 attach-volume --volume-id vol-049df61146f12f951 --instance-id i-01474ef662b89480 --device /dev/sdf<br></code></code></pre>


<h2 class="wp-block-heading kb-workflow-step" data-kb-step="5"><span class="kb-workflow-step__index" aria-hidden="true">5</span><span class="kb-workflow-step__text"><span class="kb-workflow-step__kicker">Step 5</span> SSH into the New EC2 Instance</span></h2>


<p class="wp-block-paragraph">Next, SSH into the new EC2 instance using its own key:</p>



<pre class="wp-block-preformatted has-light-green-cyan-color has-ast-global-color-3-background-color has-text-color has-background"><code>ssh -i "/path/my-key-pair.pem" ec2-user@ec2-198-51-100-1.compute-1.amazonaws.com
</code></pre>


<h2 class="wp-block-heading kb-workflow-step" data-kb-step="6"><span class="kb-workflow-step__index" aria-hidden="true">6</span><span class="kb-workflow-step__text"><span class="kb-workflow-step__kicker">Step 6</span> Mounting the New Volume in Read-Only Mode</span></h2>


<p class="wp-block-paragraph">This step involves creating a new directory and mounting the new volume in read-only mode. This ensures that the data on the volume isn&#8217;t altered during the investigation:</p>



<pre class="wp-block-code has-light-green-cyan-color has-ast-global-color-3-background-color has-text-color has-background"><code><code>sudo mkdir /my_new_volume
sudo mount -o ro /dev/xvdf /my_new_volume
</code></code></pre>


<h2 class="wp-block-heading kb-workflow-step" data-kb-step="7"><span class="kb-workflow-step__index" aria-hidden="true">7</span><span class="kb-workflow-step__text"><span class="kb-workflow-step__kicker">Step 7</span> Performing the Forensic Investigation</span></h2>


<p class="wp-block-paragraph">Finally, you can navigate to the directory where you mounted the new volume and start your forensic investigation.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Losing SSH access to an EC2 instance doesn&#8217;t mean your investigation has to come to a halt. AWS provides a workaround by creating and using snapshots of the EBS volume associated with the instance. Remember, while performing the investigation, it&#8217;s important to ensure that the data remains unaltered. Therefore, always mount your volume in read-only mode. With these steps, you should be able to continue your investigation even in challenging scenarios.</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/knowledgabase/how-to-perform-forensic-investigation-on-an-aws-instance-without-a-public-key/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Preventing Direct IP Access in CloudFlare</title>
		<link>https://kaushalbhavsar.com/updates/preventing-direct-ip-access-in-cloudflare/</link>
					<comments>https://kaushalbhavsar.com/updates/preventing-direct-ip-access-in-cloudflare/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Tue, 04 Jul 2023 07:04:28 +0000</pubDate>
				<category><![CDATA[Updates]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=2906</guid>

					<description><![CDATA[Recently, I was going through my LinkedIn feed and I found a post by Jake M. In the post, the author suggests a way to bypass Cloudflare&#8217;s protection and directly access the origin server. They propose using the &#8216;Forgot Password&#8217; feature of a web app to find the server&#8217;s IP address. If that fails, they [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Recently, I was going through my LinkedIn feed and I found <a href="https://www.linkedin.com/feed/update/urn:li:activity:7080187072707207170/" target="_blank" rel="noopener">a post by Jake M</a>. </p>



<p class="wp-block-paragraph">In the post, the author suggests a way to bypass Cloudflare&#8217;s protection and directly access the origin server. They propose using the &#8216;Forgot Password&#8217; feature of a web app to find the server&#8217;s IP address. If that fails, they recommend sending an email to a non-existent address to receive a bounce notification with the server&#8217;s IP. That will expose the server IP and it&#8217;s possible to bypass Cloudflare&#8217;s security measures unless additional restrictions are in place. </p>



<p class="wp-block-paragraph">Here&#8217;s how both scenarios can be visualized: <br></p>



<figure class="wp-block-image aligncenter size-full"><img fetchpriority="high" decoding="async" width="352" height="359" src="https://kaushalbhavsar.com/wp-content/uploads/2023/07/image.png" alt="" class="wp-image-2907" srcset="https://kaushalbhavsar.com/wp-content/uploads/2023/07/image.png 352w, https://kaushalbhavsar.com/wp-content/uploads/2023/07/image-294x300.png 294w" sizes="(max-width: 352px) 100vw, 352px" /><figcaption class="wp-element-caption">Scenario 1 &#8211; Using &#8216;Forgot Password&#8217; to expose Origin Server IP</figcaption></figure>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="622" height="153" src="https://kaushalbhavsar.com/wp-content/uploads/2023/07/image-1.png" alt="" class="wp-image-2908" srcset="https://kaushalbhavsar.com/wp-content/uploads/2023/07/image-1.png 622w, https://kaushalbhavsar.com/wp-content/uploads/2023/07/image-1-300x74.png 300w" sizes="(max-width: 622px) 100vw, 622px" /><figcaption class="wp-element-caption">Scenario 2 &#8211; Using &#8216;Bounce Email&#8217; to expose Origin Server IP</figcaption></figure>



<p class="wp-block-paragraph">The author&#8217;s research very well points out a configuration vulnerability that is really difficult to visualize. If the Origin Server IP is exposed, there is no point in having CloudFlare. And this is the same issue with any Cloud Firewall / CDN that works in Proxy mode. </p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Suggested Workaround</h2>



<p class="wp-block-paragraph">As suggested in the comments, the most popular workaround would be to use a 3rd party email server. In that way when the mail server&#8217;s IP address is exposed, the Origin Server IP is still hidden behind the proxy. </p>



<p class="wp-block-paragraph">However, what if someone wants to use the mail server on the same server? Is there no way out? </p>





<p class="wp-block-paragraph">The origin should enforce the approved proxy path even if its IP address becomes known. This illustrates the intended access boundary.</p>


<figure class="kb-mermaid" data-kb-mermaid-format="svg">
<div class="kb-mermaid__frame">
<pre class="mermaid">flowchart TD
 U[&quot;Website request&quot;] --&gt; C[&quot;Cloudflare proxy&quot;]
 C --&gt; W[&quot;Proxy security checks&quot;]
 W --&gt; O[&quot;Origin web application&quot;]
 D[&quot;Direct origin request&quot;] --&gt; F{&quot;Origin access policy permits it?&quot;}
 F --&gt;|No| X[&quot;Reject request&quot;]
 F --&gt;|Yes| B[&quot;Potential proxy bypass&quot;]
 B --&gt; O
 P[&quot;Maintain approved proxy access policy&quot;] -.-&gt; F</pre>
</div>
</figure>



<h2 class="wp-block-heading">Actual Workaround &#8211; Bypass Prevention</h2>



<p class="wp-block-paragraph">Let&#8217;s look at the situation from a different perspective. </p>



<p class="wp-block-paragraph">Our Origin Server IP is exposed via a mail server. We may circumvent this issue by moving the mail server out of our hosting infrastructure. </p>



<p class="wp-block-paragraph">But the fact is, there might be more than one way to expose the Origin Server IP! And we may not have discovered all of them, while attackers might have. So it&#8217;s best to assume that the IP will be exposed anyway, and work on a strategy that prevents any incident based on the exposure. The solution can be called &#8216;Bypass Prevention&#8217;. </p>



<p class="wp-block-paragraph">Bypass Prevention is very simple &#8211; we disable direct IP access to the web application hosted on the server. To do that, we need to simply restrict the access to IP range of CloudFlare. </p>



<p class="wp-block-paragraph">For that, we need the current Cloudflare IP ranges list. <a href="https://www.cloudflare.com/en-in/ips/" target="_blank" rel="noopener">Visit the Cloudflare IP Lists page</a> or utilize their API to obtain the latest IP range list. </p>



<p class="wp-block-paragraph">Once we have the list, we can use the .htaccess file to provide Bypass Prevention functionality. </p>



<p class="wp-block-paragraph">To configure IP restrictions in the .htaccess file, follow these steps:</p>



<ol class="wp-block-list">
<li>Create or edit your .htaccess file in the root directory of your website.</li>



<li>Add the following lines to the file:</li>
</ol>



<pre class="wp-block-code"><code># Block direct access to all files except from Cloudflare IPs
&lt;Files *>
    Order Deny,Allow
    Deny from all
    # Whitelist Cloudflare IP ranges
    Allow from 103.21.244.0/22
    Allow from 103.22.200.0/22
    # Add more IP ranges here if needed
&lt;/Files>
</code></pre>



<ol class="wp-block-list" start="3">
<li>Replace the example IP ranges (<code>103.21.244.0/22</code> and <code>103.22.200.0/22</code>) with the actual Cloudflare IP ranges you obtained from the sources mentioned earlier.</li>



<li>Save the .htaccess file.</li>
</ol>



<p class="wp-block-paragraph">These rules will deny access to all files on the website for requests from IP addresses outside the specified Cloudflare IP ranges. Only requests originating from Cloudflare IPs will be allowed.</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/updates/preventing-direct-ip-access-in-cloudflare/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>23/06/2023 &#8211; BUGSKAN Chronicles Part 1</title>
		<link>https://kaushalbhavsar.com/updates/23-06-2023-bugskan-chronicles-part-1/</link>
					<comments>https://kaushalbhavsar.com/updates/23-06-2023-bugskan-chronicles-part-1/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Fri, 23 Jun 2023 05:14:36 +0000</pubDate>
				<category><![CDATA[Updates]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=2894</guid>

					<description><![CDATA[Starting a startup is every geek&#8217;s dream. Admit it, we all want a &#8220;company&#8221; of our own. It&#8217;s like a brand we build for ourselves, just like every fashion designer dreams of their private label or every waiter dreams of his own restaurant. Dreaming isn&#8217;t bad &#8211; unless we have a dream, there&#8217;s no worth [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Starting a startup is every geek&#8217;s dream. Admit it, we all want a &#8220;company&#8221; of our own. It&#8217;s like a brand we build for ourselves, just like every fashion designer dreams of their private label or every waiter dreams of his own restaurant. </p>



<p class="wp-block-paragraph">Dreaming isn&#8217;t bad &#8211; unless we have a dream, there&#8217;s no worth living. But dreams have to be backed up with execution, and when we go to execute, we find out how naive that dream is. </p>



<h2 class="wp-block-heading">The decision to shift to cybersecurity</h2>



<p class="wp-block-paragraph">Before BUGSKAN I was running a software development company with a small team of 5. However, I was always interested in security. In fact, I started by career by &#8220;cleaning&#8221; viruses from computers while I was still at college. I also used to manage servers on AWS and Azure for our customers and I knew security was the big thing in the next decade or so. Later, I moved to software development. </p>



<p class="wp-block-paragraph">Running a software company was difficult then (and it is even more difficult at this moment, but more on this later), and honestly, I was getting bored. I wanted a new career. So, I created a poll titled &#8220;What do you think I am good at?&#8221; and messaged the link to about 20 people who knew me for the last 5-10 years. The most popular options were &#8220;Security&#8221; and &#8220;Teaching&#8221;. Since my financial calculation for running a training center did not turn out so well, I decided to go with Security &#8211; it was my passion and I was also pursuing my PhD in this area. </p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">I had previous experience</h2>



<p class="wp-block-paragraph">In 2015, when I was going through this process, I was actually working at a Deep-Tech startup as a CTO and the pay was good. But the CEO/Founder was a brute. He was a bachelor and used to eat-sleep-whatever in the office. I was &#8220;just married&#8221; and I needed family time. Plus, we had creative differences. At one point of time in the investor meeting, the investor asked when they will see ROI or even any revenue. We were building something related to storage performance optimization and the code was supposed to be done in native C/C++ but I had no clue how to get it working (in fact it still isn&#8217;t working) so I suggested that while we figure out our main product, we can start selling &#8220;optimized VPS&#8221; and get revenues coming. <br>The investor was okay with it but the CEO was not. And that created a gap between him and me. I rarely received any credit for the suggestions I made, even if they were actually implemented. One day the CEO asked me for a 1-1 and said I was too slow for the company. At that point, I knew I had to quit. </p>



<p class="wp-block-paragraph">During this short stint, I learned about product planning, management, investor relations, and many other concepts which I may have never learned in my software development consultancy. </p>



<h2 class="wp-block-heading">The return to consulting</h2>



<p class="wp-block-paragraph">Just when I had left the previous company, one of my friends, who was now a CTO of a US-based product company, had a security incident. I reached out to him and offered him some help, and did a basic security audit for free. The next thing I remember is signing an NDA and a contract with the company for a security audit. I was ready to roll! I loved talking to their developers since I was one of them, and knowledge of security made me a great combo. At that time, I was also watching Mr. Robot. The company in Mr. Robot was &#8220;All Safe Systems&#8221; and I was really inspired by the operations of the company.</p>



<p class="wp-block-paragraph">I took that as an inspiration and borrowing branding concepts from by customer, I registered &#8220;bugskan.com&#8221;. </p>



<p class="wp-block-paragraph">Soon, I started taking &#8220;Dev Sec&#8221; sessions (DevSecOps was still not a thing yet) and enjoyed the attention I received. But there was a problem &#8211; the US office of my first client stopped renewing my contract. I got to know that &#8220;periodic audits are expensive&#8221;. The fact was, they were rapidly growing and the list of endpoints were growing so they needed a &#8220;fix-price annual contract&#8221;. </p>



<p class="wp-block-paragraph">I looked at the problem &#8211; the entire security audit industry worked in &#8220;man-hour&#8221; pricing which was retrospectively priced to suit the customer budget. This made security audits for small companies unaffordable. </p>



<p class="wp-block-paragraph">I decided to put an end to this &#8211; a Security-as-a-service platform with fixed monthly cost per application. That&#8217;s what BUGSKAN was going to be!</p>



<h2 class="wp-block-heading">The launch</h2>



<p class="wp-block-paragraph">We created the first version and launched it online. Our platform allowed website owners to scan their web applications for security vulnerabilities. The basic free report checked for OWASP Top 10 vulnerabilities and a deep scan required paid service. At that time, I was competing with Tinfoil Security, Detectify, and so on.</p>



<div class="wp-block-uagb-image uagb-block-d767dbcf wp-block-uagb-image--layout-default wp-block-uagb-image--effect-static wp-block-uagb-image--align-none"><figure class="wp-block-uagb-image__figure"><img loading="lazy" decoding="async" srcset="https://kaushalbhavsar.com/wp-content/uploads/2023/06/748_10153981229051894_5284482055903158815_n.jpg " sizes="auto, (max-width: 480px) 150px" src="https://kaushalbhavsar.com/wp-content/uploads/2023/06/748_10153981229051894_5284482055903158815_n.jpg" alt="" class="uag-image-2899" width="960" height="718" title="" loading="lazy"/></figure></div>



<p class="wp-block-paragraph">The project was selected as a case study for using open-source technologies on Azure and I was invited to showcase the same at Microsoft Openness Days, Hyderabad. I got feedback from senior tech architects and developers who were also facing similar problems in their daily routines. I was excited &#8211; finally, I had the product market fit, I thought. </p>



<div class="wp-block-uagb-image uagb-block-5d8db70f wp-block-uagb-image--layout-default wp-block-uagb-image--effect-static wp-block-uagb-image--align-none"><figure class="wp-block-uagb-image__figure"><img loading="lazy" decoding="async" srcset="https://kaushalbhavsar.com/wp-content/uploads/2022/12/10399568_10153980841801894_1659058591376713968_n.jpeg " sizes="auto, (max-width: 480px) 150px" src="https://kaushalbhavsar.com/wp-content/uploads/2022/12/10399568_10153980841801894_1659058591376713968_n.jpeg" alt="" class="uag-image-2523" width="960" height="718" title="" loading="lazy"/><figcaption class="uagb-image-caption">Me with new friends at Hyderabad</figcaption></figure></div>



<p class="wp-block-paragraph">At one point, we had about 30 daily free scans. Despite that, we were not seeing any takes for the paid product and the company was surviving from my consulting revenue only. </p>





<p class="wp-block-paragraph">The product direction changed when user feedback showed that reports alone were not leading to fixes.</p>


<figure class="kb-mermaid" data-kb-mermaid-format="svg">
<div class="kb-mermaid__frame">
<pre class="mermaid">flowchart TD
 A[&quot;Consulting and periodic audits&quot;] --&gt; B[&quot;Fixed-price scanning platform&quot;]
 B --&gt; C[&quot;Free scans and paid reports&quot;]
 C --&gt; D{&quot;Reports lead to paid adoption and fixes?&quot;}
 D --&gt;|Weak response| E[&quot;Talk directly to users&quot;]
 E --&gt; F[&quot;Need for controllable automatic protection&quot;]
 F --&gt; G[&quot;WAF and virtual-patching pivot&quot;]
 G --&gt; H[&quot;More research and development effort&quot;]
 G -.-&gt; I[&quot;Application fixes still required&quot;]</pre>
</div>
</figure>



<h2 class="wp-block-heading"> The Pivot</h2>



<p class="has-text-align-left wp-block-paragraph">I was frantically looking for insights, and for some platform that does not have large user interaction, it meant I needed to reach out to my users personally instead of running an analytics script. One of the users for Mahendra Sharma, CTO of Matrubharti &#8211; India&#8217;s largest ebook platform. After training their development team I was sitting with Mahendra Sharma and he told me the golden words: </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">You send us a report but our developers will never fix each bug. I want something automatic that I can control </p>
</blockquote>



<p class="wp-block-paragraph">This got my head spinning and I went to the whiteboard AGAIN. This was December 2016, almost a year after I started BUGSKAN. If we are doing something, and not getting results, we are doing something wrong, I thought. I remembered my research on ModSecurity in 2011 while I was teaching &#8211; ModSecurity has something called &#8220;Virtual Patching&#8221; that allows a quick fix for the vulnerability. <br>The VP is not a solution, it is just a bandage to stop infection while the wound is healing, but it happens at the click of a button so &#8211; this seemed a perfect addition to our arsenal. </p>



<p class="wp-block-paragraph">So we registered bugshield.io domain and started working on a WAF-as-a-service platform with vulnerability scanning and automatic virtual patching. This meant more time in research and development. This also meant, less time for consulting. </p>



<p class="wp-block-paragraph">In all, this pivot turned out to be really expensive&#8230; but how? I will share in the next part. Thanks for reading!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/updates/23-06-2023-bugskan-chronicles-part-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>19/06/2013 &#8211; My Return to the Blogosphere</title>
		<link>https://kaushalbhavsar.com/updates/turning-a-new-page-my-return-to-the-blogosphere/</link>
					<comments>https://kaushalbhavsar.com/updates/turning-a-new-page-my-return-to-the-blogosphere/#respond</comments>
		
		<dc:creator><![CDATA[Kaushal Bhavsar]]></dc:creator>
		<pubDate>Mon, 19 Jun 2023 11:21:51 +0000</pubDate>
				<category><![CDATA[Updates]]></category>
		<guid isPermaLink="false">https://kaushalbhavsar.com/?p=2884</guid>

					<description><![CDATA[A personal account of the family, work and research commitments that kept me away from blogging, and why I decided to start writing again.]]></description>
										<content:encoded><![CDATA[

<p class="wp-block-paragraph">Hi, reader&#8230;</p>



<p class="wp-block-paragraph">You may be knowing from the past or maybe you just landed here from a search engine. Either way, I feel excited to share my journey with you. </p>



<p class="wp-block-paragraph">My name is Kaushal Bhavsar &#8211; I am a Ph.D. in Computer Science with a specialization in security. Like most geeks, I am passionate about new technology and like sharing what I learn. </p>



<p class="wp-block-paragraph">A decade ago, blogging was my passion. I used to blog about anything and everything I experienced in life. But I forgot blogging &#8211; why? </p>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading">Fast forward &gt;&gt; Present day </h3>



<p class="wp-block-paragraph">While I am thinking why my blog looks empty, it reminds me of the key events that happened in the past ten years that got me in this situation</p>



<ol class="wp-block-list">
<li><strong>I got married</strong> &#8211; Now before you frown upon me like, &#8220;How dare you use your life partner as an excuse to do something you were to lazy to do!&#8221;, let me tell you &#8211; my partner gives me sufficient time to use the computer. She knows that it&#8217;s my &#8220;second wife&#8221; and she has well accepted the fact that sometimes, tech can get too much on my head and I forget everything else around me. The problem is me &#8211; I became introverted and secretive. I probably didn&#8217;t want to share too much of my life, and the content creation became increasingly lesser from that point.  I guess, this was a behavioural change as I began a new phase in life. Even today, I would not want to share &#8220;everything&#8221; that happens around me, but at least I can share a good part of what is helpful to my readers!</li>



<li><strong>We got a child</strong> &#8211; So this is where I was busy most of the time.  We (obviously, me and my wife) were done changing his diapers a long time ago but still, the child was our focus and in fact, we even lost focus from ourselves (and that&#8217;s how we realized that we look horrible now &#8211; but that&#8217;s for another post). Our every day was centered around the child &#8211; partly because it was exciting to recollect how we might have grown up some 25-30 years ago. </li>



<li><strong>I was working on a startup</strong> &#8211; It was called BUGSKAN (more about what went wrong with it, later). We made tools and tech to automate security operations for developers. This was while we were raising a 2-year-old child. So practically, I had two children &#8211; one was genetic and another was ideological. And then, at one point I had a team of 10 people including interns while I was running a one-man show both at home and work. Believe me, it is much tougher than it sounds. </li>



<li><strong>My mother expired</strong> &#8211; This was a year before COVID-19 started. I was off for a client meeting and she just collapsed while reaching a hospital. This was just a day after I fired my entire team so it was extremely difficult to handle two major setbacks in life. I was really shocked (all of us were) and we took about two years to come over the fact.</li>



<li><strong>We were infected by COVID-19</strong> &#8211; For those of you who have been infected, you know how this feels like. Living for 14 days in the same house and being unable to talk to our child (we used to do video calls to the &#8220;ground floor&#8221;) gave me a faint picture of what an unhealthy life would look like. The experience was life-changing on a negative note. </li>



<li><strong>I finally finished my Ph.D. Thesis</strong> &#8211; Well, this deserves a separate blog post altogether so I am not going to write anything here. But I realized there&#8217;s something called &#8220;Post Ph.D. Depression&#8221; which you don&#8217;t know until you get out of it.</li>
</ol>



<h2 class="wp-block-heading">What now? </h2>



<p class="wp-block-paragraph">Well, now that I have given an update on what I have been up to for the last few years, I am going to restart blogging. In my journey till now, I have developed my interest in the wide spectrum of machine learning and the use of AI in cybersecurity, along with scientific research. I will be blogging on cybersecurity, startups, machine learning, and wellness based on what I have learned so far.</p>



<p class="wp-block-paragraph">Until the next post, this is Kaushal Bhavsar signing off <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaushalbhavsar.com/updates/turning-a-new-page-my-return-to-the-blogosphere/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
