<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>from the keyboard. on Bhavya Tiwary</title>
    <link>https://bhavyatiwary.com/posts/</link>
    <description>Recent content in from the keyboard. on Bhavya Tiwary</description>
    <image>
      <title>Bhavya Tiwary</title>
      <url>https://bhavyatiwary.com/og.png</url>
      <link>https://bhavyatiwary.com/og.png</link>
    </image>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Fri, 30 Oct 2026 00:00:00 +0530</lastBuildDate>
    <atom:link href="https://bhavyatiwary.com/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Monitoring AI Systems: 6 Challenges for SOC Teams</title>
      <link>https://bhavyatiwary.com/posts/agenticlogging/</link>
      <pubDate>Sun, 20 Sep 2026 04:25:25 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/agenticlogging/</guid>
      <description>Why monitoring AI agents breaks SIEM: log volume, what to alert on, payload privacy, multimodal inputs, and whether chain-of-thought logs can be trusted.</description>
      <content:encoded><![CDATA[<p>When a traditional web service fails, the incident response playbook is mechanical: grep the access logs for <code>500</code> status codes, isolate the stack trace, and patch the null pointer. The path from trigger to failure is deterministic.
A deterministic path basically means that traditional SIEM systems rely heavily on using static rules to match specific log patterns, which ensures consistency and auditability but often struggles with detecting novel or unknown threats.</p>
<p>Autonomous agentic systems break this paradigm entirely.
An agent does not follow hardcoded logic; it interprets, plans, loops, and acts. Faced with an identical prompt, an agent may react completely differently; it might query a database today, call a shell script tomorrow, or hallucinate an entirely nonexistent API endpoint next week. To improve explainability and also, to pretend to know what the hell is going on, we have the agent&rsquo;s chain-of-thought thrown into this mix too. Basically CoT means the model/agent documents exactly how it reached the result. To fully understand what&rsquo;s going on we have to use logs for our agent, what it accesses, how it thinks, how it&rsquo;s authenticating and finally what is it doing.</p>
<p>This also increases the attack surface of an agent as now it isn&rsquo;t just limited to the assets and data it has access to but also it&rsquo;s own Chain-of-Thought and Memory.</p>
<p>Some challenges faced in SOC due to the new attack surface:</p>
<h2 id="the-sheer-volume-of-data">The sheer volume of data</h2>
<p>Just think about it, we have AI Assistants like Claude, AI-enabled Browsers like Perplexity, AI-enabled software like Harvey AI or even Jira and SNOW, MCPs, LLM Endpoints etc. If each person in a 50 person company runs 5 sessions/day it&rsquo;s almost 250 log events to be monitored across each software, so increasing the amount of logs generated and ingested by almost 150%. By the way, we haven&rsquo;t even considered OT and IoT devices running manufacturing AI algos or BMS in the mix yet for Enterprise monitoring.</p>
<h2 id="the-most-difficult-question-what-to-monitor">The most difficult question: What to monitor?</h2>
<p>OWASP Top 10 for Agentic and LLM covers different vulnerabilities across different Responsible AI tenants.
Alerts related to bias or cascading bias, hallucination or agent goal hijack related alerts are required to be sent to the dev team for remediation. If these alerts, reach a SOC team, it&rsquo;s practically useless because a SOC team manages the incidents for the enterprise and hallucination, bias is specific to the use case only. The dev team responsible for the use case or app can only fix the performance based vulnerabilities.
Any prompts where PII data wasn&rsquo;t properly obfuscated or the outputs show PII/PHI data that it shouldn&rsquo;t, need Data Privacy Office to review. They determine how to handle the incident.<br>
Prompt Injection and Privilege Escalation etc need the security team to intervene and stop.</p>
<p>At the same time non GenAI or LLM related algos running may have different criteria for monitoring. For example: a team working on an self-driving car, they don&rsquo;t need to monitor for privacy and security in the traditional sense. The monitoring parameters would be with the perspective of the environment, visibility, detection, control, driving etc. Thus, for general consulting companies or manufacturing companies, the monitoring of an AI system for safety and security is totally different.</p>
<p>Thus, the segregation of events and alerts require a thoughtful framework to be created with each team requiring different data parameters for their review and analysis. Currently no products or even guidelines from any orgs are available in the market to help companies differentiate between log collection and actionable alerting.</p>
<h2 id="the-payload-paradox-and-legal-challenges">The Payload Paradox and Legal challenges</h2>
<p>Following up from the previous point we have the payload paradox brought to you by the non-deterministic autonomy of an agent.</p>
<p>Since the agent can take actions on it&rsquo;s own and their actions may differ for each case, to detect adversarial goal hijacking, developers and security analysts need total forensic visibility into the agent’s chain-of-thought traces, prompt templates, and intermediate tool arguments. Yet indiscriminately dumping all raw execution spans into telemetry pipelines turns the observability stack into a high-risk data liability, aggregating unredacted PII, enterprise secrets, and compliance violations into single, queryable buckets.</p>
<p>Not only does logging everything increase risk but also not logging everything raises several issues in cases of legal hold or court/gov inquiries, once litigation is reasonably anticipated, the duty to preserve potentially relevant evidence extends to AI interaction logs the same way it extends to any other record so &ldquo;we didn&rsquo;t think to keep it&rdquo; is not a defense.</p>
<h2 id="multimodal-inputs">Multimodal inputs</h2>
<p>For certain models like LLMs or object-detection (YOLO), the input and payload format received are varied. An LLM accepts video, audio, text, image inputs which requires subsequent calibration for the alert rule. For images, we need to keep in mind about steganography. For audio, we have to consider privacy declarations before even considering ingestion of logs. Other systems with YOLO models will have sensor input which will be processed completely differently from user facing apps providing text or so  responses.  This overall increases the complexity as there is no common baseline to go from and  most integrations requires further nuances to set up credible alerts.</p>
<h2 id="legitimate-vs-malicious-events-for-general-purpose-apps">Legitimate vs Malicious events for General Purpose apps</h2>
<p>For general purpose AI apps like Claude ort ChatGPT, the use cases that a user can do are countless. One can generate essays, analysis website UI or even do gene computation. Now, how do you determine at a very large scale with just logs what is malicious activity? If a user is leveraging Claude Cowork for editing a video, the agent might create multiple temp image files during processing in the folder and then delete them all. In the logs, it may come across as mass deletion which needs further review on account of it being insider threat. With such general purpose apps, determining use cases that are truly malicious are difficult and may need to be regularly updated.</p>
<h2 id="trust-in-cot">Trust in CoT</h2>
<p>As mentioned earlier in the article, we depend on Chain-of-Though to understand the agent behavior. However, as the agent documents it&rsquo;s own actions, it raises a questions that if the logs are actually accurate.</p>
<p>Referencing specifically the model system card published by OpenAI for Astra, we see that chain-of-thought faithfulness and accuracy has been chipping away and the picture in 2025–2026 is not encouraging. Models can produce a plausible, coherent-looking rationale that has little to do with the actual computation behind an answer. The stated reasoning and the real decision process can come apart, especially under biased or leading prompts, as Turpin et al.&rsquo;s original work demonstrated and later studies have replicated. A 2025 study from Anthropic researchers found that reasoning traces verbalize a hint the model actually relied on in fewer than one case in five where the hint was used at all. Anthropic&rsquo;s own paper on chain-of-thought monitorability is candid about this: CoT is a genuinely valuable safety signal, but a fragile one, subject to exactly the same pressure to look helpful and harmless as any other model output.</p>
<p>There&rsquo;s a term for the failure mode that&rsquo;s started circulating in the literature: reasoning theater. A model can already &ldquo;know&rdquo; the answer and still generate tokens that perform the appearance of working it out.</p>
<p>This matters enormously for the audit-trail pitch, because an audit log that doesn&rsquo;t reliably reflect what happened isn&rsquo;t an audit log. It&rsquo;s a transcript of a performance. Worse, a security researcher pointed out that the failure mode is exploitable in the other direction too: an adversary can craft prompts that produce a coherent-looking reasoning trace that steers toward an attacker&rsquo;s preferred conclusion, without ever triggering the safety classifiers built to inspect reasoning for red flags. The very layer you&rsquo;re trusting to catch misbehavior can be dressed up to pass inspection.</p>


<style type="text/css">
    .box-shortcode {
      padding: 1.6em;
      padding-top: 1.4em;
      line-height: 1.4em;
      margin-top: 1em;
      margin-bottom: 2em;
      border-radius: 4px;
      color: #444;
      background: #f3ebe850;
    }

    .box-title {
      margin: -18px -18px 12px;
      padding: 4px 18px;
      border-radius: 4px 4px 0 0;
      font-weight: 700;
      color: var(--content);
      background: #6ab0de;
    }
    .box-shortcode.warning .box-title {
      background: #ff6b6b;
      color: var(--content);
    }
    .box-shortcode.warning {
      background: #ff6b6b4f;
      color: var(--content);
    }
    .box-shortcode.info .box-title {
      background: #0089e488;
      color: var(--content);
    }
    .box-shortcode.info {
      background: #0089e41c;
      box-shadow: 3px 3px 5px #0089e410;
      color: var(--content);
    }
    .box-shortcode.important .box-title {
      background: #f7ec2c;
    }
    .box-shortcode.important {
      background: #f7ec2c7d;
    }
    .box-shortcode.tip .box-title {
      background: #a3ffa34d;
    }
    .box-shortcode.tip {
      background: #a3ffa34d;
      box-shadow: 3px 3px 5px #0089e410;
    }
    .icon-box {
      display: inline-flex;
      align-self: center;
      margin-right: 8px;
    }
    .icon-box img,
    .icon-box svg {
      height: 1em;
      width: 1em;
      fill: currentColor;
    }
    .icon-box img,
    .icon-box.baseline svg {
      top: 0.125em;
      position: relative;
    }
    .box-shortcode p {
      margin-bottom: 0.6em;
    }
    .box-shortcode p:first-of-type {
      display: inline;
    }
    .box-shortcode p:nth-of-type(2) {
      margin-top: 0.6em;
    }
    .box-shortcode p:last-child {
      margin-bottom: 0;
    }
  </style>

  
  <svg width="0" height="0" display="none" xmlns="http://www.w3.org/2000/svg">
    <symbol id="tip-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/>
    </symbol>
    <symbol id="important-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>
    </symbol>
    <symbol id="warning-box" viewBox="0 0 576 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>
    </symbol>
    <symbol id="info-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"/>
    </symbol>
  </svg><div class="box box-shortcode info" >
    <span class="icon-box baseline">
      <svg><use href="#info-box"></use></svg>
    </span>
    <p>PS: Other points were more from my observation during my work at my org to setup the AI Security framework This point is derivation of my study of research on AI Safety so do read the papers from <a href="https://www-cdn.anthropic.com/b9ca6db27f02a9ddf0d4fdb51b26432c99a27be0.pdf">Anthropic</a> and <a href="https://arxiv.org/abs/2305.04388">Turpin et al</a></p>
  </div>

<p>This concludes the challenges a SOC team may face when they try to setup effective monitoring and alerting for AI and agentic systems. Everytime you think of AI systems, make sure it&rsquo;s not just boxed to GenAI/LLM systems but also systems leveraging other algos like Building Mangement Systems that run ML models or Face scan systems that use Object-detection algos (YOLO).</p>
]]></content:encoded>
    </item>
    <item>
      <title>AI Security Agents in the SOC: Co-Worker or Co-Risk?</title>
      <link>https://bhavyatiwary.com/posts/ai-in-soc/</link>
      <pubDate>Fri, 01 May 2026 05:09:15 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/ai-in-soc/</guid>
      <description>How AI security agents differ from plain automation, and the challenges SOC teams face when they hand agents access, credentials and decisions.</description>
      <content:encoded><![CDATA[<p>As the number of AI agents increase in corporations, we can&rsquo;t expect that cybersecurity would be the only domain left behind. Many VC-backed startups like Simbian have been launched, and Google also announced a partnership with Wiz for cybersec agents, etc.</p>
<h2 id="ai-agents-vs-automation-what-is-the-difference">AI Agents vs Automation: What is the difference</h2>
<p>Firstly, what is an AI agent, and why is it different from our plain ol&rsquo; automation?
Automation follows a set of predefined rules to complete tasks—fast, consistent, and predictable. AI agents, on the other hand, operate with autonomy: they can reason, adapt, and make decisions based on dynamic inputs. For eg: if the goal is to parse a document and then send a mail with the extracted data. If we create an automation script, we would need to first use a parsing algo and then define words that need to be extracted using key-value pairs or regular expressions. After that, we also need the exact template with substitutions defined for the mail to be sent. Whereas if we create an AI agent, we need to use an algo focused on extraction and just define the expectations, like write a mail with a formal tone or make sure the mail is concise. The agent will use its autonomy to draft the mail and send it.
Both the AI agent and automation script would still need access to the mailbox, permission to read the doc, permission to send the mail and authentication credentials. Pretty cool to see how far NLP algos have come but also a bit terrifying.</p>
<h2 id="challenges-we-may-see-if-we-use-soc-ai-agents">Challenges we may see if we use SOC-AI agents:</h2>
<ol>
<li>One of the key challenges AI researchers are working on is Explainability. According to ISO/IEC TR 29119-11:2020, it means the level of understanding how the AI-based system came up with a given result. Let me elaborate with an example: If we consider a decision tree algo or K-means, as a researcher/developer, one can look at the input and give a reasonable guess why a certain output was derived. But what about LLMs or Facial Recognition algos like FaceNet, at any given point a researcher or expert cannot say with certainty why a certain output was derived. You can try it yourself if you ask Claude to write 5 sentences on any topic, like &ldquo;Tell me about the movie Jurassic Park.&rdquo; Now, how can you say with certainty what 5 points it will cover? It can talk about actors, directors, movie reviews, CGI or anything.</li>
</ol>
<p>This is different from interpretability, which is basically the level of understanding how the underlying (AI) technology works, which we can explain, like Claude is an LLM which is based on Transformer architecture. Or FaceNet uses a deep convolutional neural network to learn a mapping/embedding from a set of face images to a 128-dimensional Euclidean space and assesses the similarity between faces based on the square of the Euclidean distance between the images&rsquo; corresponding normalized vectors.</p>
<p>So in the context of SOC agents who have more autonomy, tool access, LLM access, etc., how do we account for explainability in a way that is accessible to all the analysts?</p>
<ol start="2">
<li>
<p>The idea that the system responsible for monitoring everything and generating alerts uses a mix of probabilistic and deterministic algos to derive answers is a bit scary. The probabilistic algos come into play during the first half, where the agent tries to assess the telemetry for context. They apply behavioral baselines and knowledge graphs to assign risk scores and dynamically select response paths based on asset criticality, rather than following fixed &ldquo;if X, then Y&rdquo; rules. As you may know, any system is not 100% accurate, and a probabilistic system may lead to errors that have a huge impact on business. Not a big deal in the grand scheme of things, but has anyone noticed that since we started using AI agents for coding in corps like AWS and Microsoft, there have been more outages? Big organizations may be able to absorb the impact, but smaller orgs will face more challenges.</p>
</li>
<li>
<p>With AI being the IT-girl of the industry, it is also the prime target of hackers. The constant attempt to use AI agents or shared LLMs for attacks and malware propagation is very real. Imagine the system you depend on for alerting you of these incidents and exploits and attacks itself gets compromised because of a shared model or Agent-to-Agent sprawl or even a sci-fi-style rebellion.</p>
</li>
<li>
<p>Lastly, since AI agents have more autonomy, their mistakes are also unpredictable. As per many experts across domains, note that the agent is generally reliable and doesn&rsquo;t make errors, but when it does, it&rsquo;s pretty hard to trace the error because the steps taken aren&rsquo;t logged. In a controlled environment, with limited variables or just 2-3 use cases, it is still manageable, but in prod, where the SOC system handles 1000s of use cases and logs, attack signatures, etc., things become challenging. Also, the butterfly effect, where a small mistake is insignificant in itself, may lead to business outages or legal repercussions.</p>
</li>
</ol>
<p>Then what is the solution? Because analyst fatigue is real, and with fixed security budgets, any help is appreciated. The solution is human-in-the-loop, where the analyst uses SOC for summarization, data extraction, references, and alert generation, but at the end of the day, the analyst makes the final call to dismiss or act on the alert.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How I Run a Cloud Security Assessment (A Security Architect&#39;s Checklist)</title>
      <link>https://bhavyatiwary.com/posts/cloud-security-assessment/</link>
      <pubDate>Fri, 30 Oct 2026 00:00:00 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/cloud-security-assessment/</guid>
      <description>The cloud security assessment checklist I use as a security architect: identity, network, data, logging, resilience and the shared responsibility gaps.</description>
      <content:encoded><![CDATA[<p>Approximately 50–54% of all enterprise workloads now run in the public cloud, while roughly 80% of total enterprise workloads reside in cloud environments (including private and hybrid clouds).  A cloud workload is basically any computational task, application, service, or process that consumes cloud resources (compute, memory, storage, and networking) to perform operations.
Securing more than half of enterprise apps, platforms etc become imperative. In the age of AI, breaches and vulnerabilities have become more common than ever. Funny enough most cloud breaches aren&rsquo;t clever or very sophisticated. They come from a setting nobody reviewed or accidentally pushing API keys to prod (oops). Here&rsquo;s a guide albeit simple, would be helpful to figure out the foundations of security for your cloud workloads.</p>
<h2 id="before-you-start-scope-and-the-shared-responsibility-model">Before you start: scope and the shared responsibility model</h2>
<p>Choosing a reliable Cloud Service Provider (CSP) with a proven track record of good service and customer support is the first step. AWS, Azure and GCP are the top picks for most teams. For China, Alibaba Cloud, Huawei Cloud and Tencent Cloud are the top picks. For startups and people deploying hobby projects, you can look into DigitalOcean and Vultr (40-50% cheaper for small and mid workloads) or companies like Vercel, Supabase, Cloudflare that offer IaaS (read about it in the next few para). OVHcloud, Hetzner and Scaleway offer European data sovereignty, cheap, reliable, secure but customer support is pretty questionable.</p>
<p>Before onboarding any vendor, do your due diligence: check their certs and third-party audit reports (SOC 2, ISO 27001, 27701 etc), review their SLAs and support promises, and most importantly compliance to any regional laws (think GDPR for EU, California&rsquo;s CCPA/CPRA, India&rsquo;s DPDPA China&rsquo;s PDPL etc).</p>
<p>Now let&rsquo;s discuss the 4Ws: Who&rsquo;s paying, what does the provider own, what do you own, and what&rsquo;s pros/cons. Seriously nothing is 100% reliable and safe so writing what works and what doesn&rsquo;t really helps to understand who is left with the bill and heavy luggage if things go south.</p>
<p>Let&rsquo;s answer the remaining 2Ws: what does the provider own and what do you own. The simple answer is IaaS vs PaaS vs SaaS.  Simply put cloud works on a shared responsibility model which means the provider and you both take care of certain aspects. This image will help you:</p>
<p><img loading="lazy" src="sharedmodel.png" alt="Shared responsibility model across IaaS, PaaS and SaaS: you always own your data, and the provider takes on more of the stack as you move toward SaaS."  />
</p>
<p>Use IaaS model with PaaS services (this is not either or so you can choose and mix match yaaay! the best of both worlds), when you&rsquo;re setting up your own ap or creating a SaaS to sell and what we&rsquo;ll discuss here.</p>
<p>Phew, now to the actual app review. The three things to ask for first: an architecture diagram, a data flow, and a list of who has admin access.</p>
<ul>
<li>An architecture diagram should help you understand the components of the app and how they connect with each other. For cloud, usually each service has a separate icon based on the provider. Check out <a href="https://aws.amazon.com/architecture/">AWS refrences</a> for examples.</li>
<li>A dataflow diagram shows how the data flows through the app. If there is a logic of user logging into their account, the dataflow would denote: User entering creds -&gt; the creds are sent to IdP or DB -&gt; If creds match an auth token is generated -&gt; token used to access user&rsquo;s data stored in DB -&gt; final user console visible to user.</li>
<li>Admin access should be very restricted. Ideally not even one user, once project goes live. Next section gives the details.</li>
</ul>
<h2 id="identity-and-access">Identity and access</h2>
<p>In cloud, there are broadly 4 access types: Root, Admin, Contributor and User.</p>
<ul>
<li>
<p>Root Access is god-tier/full access. Think super admin. You can create subscription, change billing etc. It&rsquo;s recommended by everyone that this access should only be used for initial setup, billing, new sub-tenant creation or closing the account etc basically very big stuff. If you use it for everything and somehow lose it or attackers get this access, you&rsquo;re cooked and would need a miracle to save your money and app. So use lower access for 90% of the things.</p>
</li>
<li>
<p>Then we have Admin Access, which allows you to do any action on any services or resources. Just not the account level stuff like billing change etc. You can use it for day-to-day operations.</p>
</li>
<li>
<p>Contributor is like a Delegated Administrator for a specific role that manages certain services like Security Hub. Usually the best practice is the IT team or 1-2 people have the Admin access for operations and if any dev/project teams need elevated access Contributor access can be given for that specific subscription or a few services in the account.</p>
</li>
<li>
<p>User level access is the basic read-write access. You can gives this primarily for dev teams that don&rsquo;t handle infra.</p>
</li>
</ul>
<p>We know the access levels broadly, so to give them? The answer is IAM User ( not to be confused with user level access). IAM User is the identity created within IAM to represent a person or application. By default, an IAM User has no permissions and must be explicitly granted access via attached policies. The idea is when a user or app is setup on cloud, an ID is created for them which allows them to work and take action on cloud. It&rsquo;s not your company or personal ID like gmail.com but a specific ID only for your cloud tenant. You can decide what and how much access to be given for user. Single user accounts are used for apps, automations etc and for devs, IT login corporates can enable SSO using SAML 2.0 for user auth on portal.</p>
<h3 id="securing-the-iam">Securing the IAM</h3>
<p><em>(order: the console, service accounts, cloud service-to-service communication, devs connecting to infra, end user login)</em></p>
<ul>
<li>Set up SSO+MFA for user auth to resource console.</li>
<li>Make sure service accounts/app accounts have bare minimum permissions to complete tasks essentially least privilege principle.</li>
<li>Also, make sure each service account has someone responsible for managing it like updating password, storing the password properly so app can call the account etc.</li>
<li>For authentication of services, try to use managed identities (platform manages the credentials.) or temp cred which are sent straight to compute resource based on role.</li>
<li>In some cases long-lived keys are unavoidable if that is the case make sure the keys are stored securely in a vault.</li>
<li>Token based auth (OAuth 2.0 or JWT) is generally used for API.  Access tokens should be short-lived. A shorter life shrinks the window in which a stolen token is usable. Also, configure policies for refresh tokens for public clients (SPAs, mobile) like periodic rotation or sender constrained and ensure tokens are out of browser storage.</li>
<li>For devs to login to connect to the EC2/VM etc usually people use SSH keys (store in a encrypted file on PC). For environments, that need more security go for Session Manager.</li>
<li>For end users of the app (not devs and IT but actual users), set up SSO or username/password with MFA. Now, just a single username/password isn&rsquo;t sufficient so MFA, password complexity, max retry attempts need to be setup.</li>
<li>Lastly but most importantly, give access sparingly. Diligently and religiously follow <em>least privilege principle</em>. When in doubt just give user level access only. This goes for the console, services <strong>and</strong> the app. For app, implement role-based-access-control (RBAC), check out free software to help with it: <a href="https://github.com/apache/casbin">Casbin</a> and <a href="https://github.com/casdoor/casdoor">Casdoor</a> for AI/LLM agents.</li>
</ul>
<h2 id="network-exposure">Network exposure</h2>
<p>Since cloud follows a shared responsibility split, the provider manages the infra but you manage the access. In cloud, networking is based on using virtualized technologies rather than physical hardware. Software-Defined Wide Area Network (SD-WAN), Virtual Private Network (VPN), and Virtual Private Cloud (VPC) are the major technologies that help us secure cloud infra.</p>
<ul>
<li>VPN is something you would probably have heard of. VPN is basically encrypted tunnels to secure communication between devices or networks over the internet. In an eg: if a letter is the data, the envelope is the tunnel and the stamp is the auth key. Corporates usually setup their own VPN because it allows them to host and expose internal apps, platforms etc only to their employees. When you have an app that should be only accessed by employees of the company, one of the simplest way to reduce the attack surface is to IP lock the app to the IP range of the VPN. It basically means that employees would have to connect to the corporate VPN to be able to connect to the app. If we follow the letter example, basically IP Range is the postal code by mentioning that we ensure only letters of a certain area come to that post office.</li>
<li>Virtual Private Cloud ( VPC) is the isolated network environment within a public cloud with it&rsquo;s own subnet, IP range and route tables. When you request any resources like servers or databases, they&rsquo;re automatically given to you in a VPC. All your requested resources will be in the same VPC. If you request a new service, you can decide to add it to a existing VPC or a new VPC. Some services are PaaS and when you request the services they come in a separate VPC with it&rsquo;s own DB, LB, vault etc.  To connect a PaaS service with your other resources you have to use VPC peering.</li>
<li>Consider VPC your app&rsquo;s home and you need to secure it properly using Network Security Groups (NSGs) and private endpoints. You need to lock it down.
<ul>
<li>Make sure that the app is not accessible to anyone and everyone over the internet (0.0.0.0/0).</li>
<li>Open only ports that you actually use like 443 for (HTTPS) or 5432 (PostgreSQL DB).</li>
<li>For SSH (22) or RDP (3389) connectivity for devs, use a bastion host or jump box. <em>Never expose these ports directly to the public internet as these protocols allow us to connect to VMs/systems etc remotely.</em></li>
<li>Block access from known malicious IPs. Use <a href="https://www.abuseipdb.com/">AbuseIPDB</a> and <a href="https://www.projecthoneypot.org/list_of_ips.php">Project Honeypot</a> for the list.</li>
</ul>
</li>
<li>If you&rsquo;re app is exposed to the internet use a load balancer with WAF. This way the load balancer&rsquo;s public IP is exposed and not your app. Add an APIM as well, if you have a huge app with loads of APIs.</li>
<li>Use public endpoints with public IP for public internet facing traffic and private endpoints with private IPs (uses the provider&rsquo;s backbone network) for all resource/internal traffic.</li>
<li>What if the frontend of the app is on cloud but the DB is on-prem? In that case, we use the vendor provided direct cloud connectivity service. Think AWS Direct Connect, Azure ExpressRoute and GCP Interconnect. Basically these are network connections managed by the provider that uses a combo of MPLS, IPSec, broadband for good connectivity with SD-WAN for management. Very secure and very expensive so use it with a pinch of salt.</li>
</ul>
<h2 id="data-protection">Data protection</h2>
<p>Easiest to execute but most important section especially from compliance.</p>
<ul>
<li>Encryption at rest and in transit, everywhere data lives and moves. Server-side encryption is enabled by default by major cloud providers. For data in transit use TLS 1.2+ and for data at rest use AES 256 (industry best practice).</li>
<li>Encryption options based on service:
<ul>
<li>Full-Disk Encryption (FDE) and Encryption at Host:  Use for VMs and VDIs.
FDE encrypts the entire storage device (e.g., BitLocker, LUKS). Encryption at Host provides end-to-end encryption from the VM host to the storage service.</li>
<li>Transparent Data Encryption (TDE): Use for DBs and provider managed DBs.
Automatically encrypts database files in real-time without application changes.</li>
<li>File/Column-Level Encryption: Use for DBs and provider managed DBs storing PII/PHI data.
Targets specific sensitive fields or files for granular control.</li>
</ul>
</li>
<li>Make sure the keys, certificates and creds for service-to-service auth are stored in a vault or HSM. You can use the CSP&rsquo;s native vault service or checkout HashiCorp&rsquo;s free tier license (not opensource so check the license). Also, make sure the whole key lifecycle: creation, usage, rotation, deletion has a policy to be followed.</li>
<li>The keys can be generated by the provider or you or the client but store it in a vault.</li>
<li>Passwords, API keys, tokens and connection strings shouldn&rsquo;t be written directly into source files, config files, Docker images or CI scripts. Inject the passwords etc from the CI platform&rsquo;s storage directly at runtime.</li>
<li>If you use GitHub, use their push protection and secret scanning to intercept a push before the secret enters the repository.</li>
<li>You can use scanners like <a href="https://github.com/gitleaks/gitleaks">gitleaks</a> as pre-commit hooks or CI checks.</li>
<li>Make sure your storage buckets are private and accessible only to authorized members (think devs maintaining the content and app to update records) via DLs . Crosscheck even if public access is disabled by default. If a bucket must be public (static website assets, say), keep it separate and confirm nothing sensitive is in it.</li>
</ul>
<h2 id="logging-and-detection">Logging and detection</h2>
<ul>
<li>If you have a corporate SIEM, make sure all relevant logs are integrated. If you don&rsquo;t have a SIEM, you can use the provider&rsquo;s native monitoring service like AWS CloudTrail and Azure Sentinel or free-tier/cheaper vendor options like New Relic, Grafana Cloud , Datadog or open-source solutions (needs some underlying infra)like Grafana Loki and the Elastic Stack (ELK).</li>
<li>Figure out the logs needed to be monitored like user access logs, admin activity logs, audit logs etc and push it to SIEM.</li>
<li>Make sure retention is long enough to investigate something that happened months ago.</li>
<li>Alerts should go to a real person who will see them, not a mailbox nobody checks.</li>
</ul>
<h2 id="resilience">Resilience</h2>
<ul>
<li>Figure out RTO and RPO for the app. Recovery Time Objective (RTO) is the max acceptable downtime for a system or service after a disruption, basically how quickly operations must be restored. Recovery Point Objective (RPO) is the max acceptable amount of data loss basically the time between the last successful backup and the failure event.</li>
<li>Once you have this, decide your backup strategy. Eg: backup the DB once a day and VM image once a week etc.</li>
<li>Backups should be isolated from production, so one bad day can&rsquo;t take out both.</li>
<li>A backup you&rsquo;ve never restored is a rumor. Test your backup copies for successful restoration.</li>
<li>If your app is very critical, make sure there are at least 2 backups and in two different geographic regions.</li>
</ul>
<h2 id="turning-findings-into-fixes">Turning findings into fixes</h2>
<p>Finally, we&rsquo;re winding down. Run compliance scans and vulnerability scans on your cloud workloads. Categorize the findings business impact, not just CVSS. Make sure each finding has an owner, a date for closure and someone to check it (who&rsquo;s not responsible for fixing it).</p>
<p>You don&rsquo;t need to fix everything in week one. Get the map, follow the data, find the keyholders, then work through the five areas and rank what you find by how much damage it could do. Start with the things that are both easy to exploit and painful to lose.</p>
<p>And if someone says &ldquo;it&rsquo;s all fine&rdquo; without a diagram to back it up, smile politely and ask for the diagram.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Cyber-resilience in the Age of AI </title>
      <link>https://bhavyatiwary.com/posts/cyberresilience_and_ai/</link>
      <pubDate>Fri, 05 Jun 2026 23:10:06 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/cyberresilience_and_ai/</guid>
      <description>How AI agents cause irreversible damage through bad prompts, hallucinations or prompt injection, and how to build backups and recovery that survive it.</description>
      <content:encoded><![CDATA[<p>AI Agents and assistants help us countless number of times to automate boring tasks, complete tasks for us when we&rsquo;re over-loaded etc. But, expecting that they never falter or have the capability to fix bad instructions is a bit much isn&rsquo;t it? Agents mess up even if the percentage may be &gt;1% but what then? And what if the consequence of the mistake are too extreme? It&rsquo;s always best to have a backup or fallback option and that&rsquo;s what we&rsquo;ll discuss.</p>
<h2 id="the-core-problem">The core problem</h2>
<p>AI is deeply embedded in our lives They can read files, call APIs, write to databases, send emails, and execute shell commands. This power comes with a category of risk that didn&rsquo;t exist before: <strong>AI-initiated irreversible damage</strong>, triggered not by a human attacker, but by your own tool acting on bad instructions, misconfiguration, or plain ol&rsquo; manipulation.</p>
<p>I&rsquo;m broadly categorizing the source or what may cause this damage into three distinct origins:</p>
<ul>
<li>Wrong prompts / misconfiguration — the user or operator creates conditions where the AI acts destructively with good intent. This also includes unintended consequences. Think The Streisand Effect or Macquarie Island (rabbits introduced for lost sailors to hunt when stranded ended destabilizing the island ecosystem).</li>
<li>Hallucination in action — the model fabricates a confident but wrong plan and executes it. Happens to the best of us and models are no exception.</li>
<li>Adversarial manipulation — prompt injection, supply chain poisoning, or MCP exploitation causes the agent to act against the user&rsquo;s interests.</li>
</ul>
<h4 id="pocketos-the-9-second-production-wipe-april-2026">PocketOS: The 9-Second Production Wipe (April 2026)</h4>
<p>One of the latest incidents which prompted me to write this article finally. PocketOS, a SaaS platform serving car rental businesses, was using Cursor powered by Anthropic&rsquo;s Claude Opus 4.6 to work on a routine task in the staging environment. The agent encountered a credential mismatch and entirely on its own initiative decided to fix the problem by deleting a Railway volume. The deletion took 9 seconds. The agent had found an API token in an unrelated file; that token was created for managing custom domains via the Railway CLI, but its permissions weren&rsquo;t scoped to those actions. Railway&rsquo;s API allowed the destructive call without a confirmation step, and the platform stored volume-level backups on the same volume as the source data — so everything went at once. <a href="https://www.techradar.com/pro/it-took-9-seconds-tech-founder-outlines-how-rogue-claude-powered-ai-tool-wiped-entire-company-database-and-backups-but-says-theres-no-such-thing-as-bad-publicity">Link for an TechRadar deep-dive</a> on this incident for anyone curious.</p>
<h4 id="user-looses-data--6657449328">User looses data  (#6657449328)</h4>
<p>Some instances of people loosing their data due to mishaps and no backups:</p>
<ul>
<li>A user watched their dissertation, operating system, applications, and personal data get deleted while asking Cursor to find duplicate articles. <a href="https://quasa.io/media/when-cursor-wiped-a-user-s-pc-a-cautionary-tale-of-ai-overreach">Link</a></li>
<li>Summer Yu, Meta’s Director of AI Alignment and Safety, went viral in Feb 2026 for tweeting that the AI agent OpenClaw deleted her entire Gmail inbox despite her explicit instructions to confirm actions first. <a href="https://www.hindustantimes.com/trending/meta-ai-safety-researcher-recalls-moment-openclaw-agent-deleted-her-emails-101771907169972.html">Link</a></li>
<li>Nick Davidov, a VC, tweeted that Claude Cowork accidentally deleted 15 years of family photos from his wife’s computer while attempting to organize her desktop. <a href="https://economictimes.indiatimes.com/news/new-updates/venture-capitalist-nearly-had-a-heart-attack-after-he-asked-ai-agent-claude-cowork-to-organise-his-wifes-desktop-its-next-step-was-unbelievable/articleshow/128104917.cms?from=mdr">Link</a>
Yeah yeah, my initial source were the tweets but I can&rsquo;t find them so here are some articles.<br>
Also, I don&rsquo;t believe it&rsquo;s the</li>
</ul>
<h2 id="why-this-may-happen">Why this may happen?</h2>
<p>I believe this is not an AI/LLM issue but a design flaw. The general setup of agents/AI tools is that it works in sessions. At the end of each session, the context is lost akin to our LLMs true nature of being stateless which basically just means that each inference call starts with a fresh context window, and the model retains no memory of prior interactions or intermediate computations once the call ends. So technically speaking our agents make a locally-coherent decision based on incomplete information for each prompt/iteration. Also, I feel we can not provide the optimum context anyways.  If we take an example of deleting marketing mails from mailbox, banks send marketing mails and policy updates about credit cards etc so it is plausible for the agent to accidentally delete policy update or awareness mails or in case of e-commerce, delete the purchase receipts. As a user, I had not specified what is considered spam etc just to delete unimportant mails.</p>
<p>Let&rsquo;s delve deeper into this based on each category:</p>
<ol>
<li><strong>Misconfiguration</strong>:
The key structural difference: traditional systems fail according to their configuration. AI agents fail according to their reasoning about their configuration.</li>
</ol>
<p>A misconfigured permission in a traditional system is dormant until exploited. A misconfigured permission in an AI agent&rsquo;s context is a capability the agent may discover and apply autonomously in ways the operator never anticipated. The agent is, in a sense, doing creative problem-solving with whatever tools it can find — which is exactly what makes it useful, and exactly what makes misconfiguration so dangerous.</p>
<p>Secondly implicit vs. explicit scope. When you configure a traditional tool, you specify what it does. When you configure an AI agent, you specify constraints — and the agent operates in the space <em>between</em> them. That space is never fully specified, which means your configuration is always incomplete by design. Any gap in your constraints is potential autonomous action the agent may fill in with its own judgment. You&rsquo;re not writing a program; you&rsquo;re drawing a fence around a reasoning system, and the fence will always have gaps you didn&rsquo;t see.</p>
<ol start="2">
<li><strong>Hallucination</strong>
By the way, researches have called it a feature not a bug so do with this info whatever you want. Hallucination is often described as &ldquo;the model getting facts wrong,&rdquo; which makes it sound like a reliability problem — similar to a buggy function returning the wrong value. That framing misses what makes it dangerous in agentic systems.</li>
</ol>
<p>The structural difference is this: traditional software fails silently or noisily, but predictably. Hallucinating agents fail confidently and act on the failure.</p>
<p>A buggy function returns a wrong value. The system either catches it (error handling), surfaces it (wrong output), or crashes. In none of these cases does the function also <em>decide what to do next based on its wrong answer</em>.</p>
<p>An AI agent that hallucinates doesn&rsquo;t just produce wrong output — it produces a wrong internal model of the world, and then plans and executes against that wrong model. The hallucination isn&rsquo;t just an output artifact; it&rsquo;s the premise for subsequent actions. If the agent incorrectly believes it&rsquo;s operating in the staging environment (when it&rsquo;s actually in prod), every correct action it takes against that false belief is destructive.</p>
<p>There&rsquo;s also a confidence symmetry problem that has no analogue in traditional software. A function that returns a wrong value typically doesn&rsquo;t also assert that it&rsquo;s confident in the result. LLMs produce outputs with uniform fluency and apparent certainty regardless of whether they&rsquo;re correct or hallucinating. There&rsquo;s no native hesitation signal, no error state, no stack trace. The model that correctly identifies the database schema looks and sounds identical to the model that&rsquo;s confabulating one.</p>
<p>This is compounded by what you might call hallucination in chain: in a multi-step agentic workflow, a hallucinated premise in step 2 propagates as ground truth into step 3, 4, and 5. Each subsequent step is locally coherent — the agent is reasoning correctly from its (wrong) premises. By the time the damage is done, the chain of reasoning looks internally consistent and intentional. There&rsquo;s no obvious point of failure to trace back to; the entire workflow ran &ldquo;correctly&rdquo; against a false model of the world.</p>
<p>The final structural issue is irreversibility asymmetry. Hallucination in a chatbot produces wrong text — you read it, notice it&rsquo;s wrong, discard it. The cost is negligible. Hallucination in an agent that has write access to infrastructure produces wrong <em>actions</em>, and those actions may not be reversible. The asymmetry between the cost of the mistake and the ability to recover from it grows dramatically as agents gain more capability. The same model behavior that&rsquo;s a minor nuisance in a Q&amp;A context is catastrophic in an agentic one.</p>
<ol start="3">
<li><strong>Prompt Injection</strong>:
Traditional threat: attacker needs access → privilege escalation → executes payload.</li>
</ol>
<p>AI agent threat: the agent already has access, and it makes judgment calls. Prompt injection, hallucination, or misconfiguration simply redirects its existing permissions toward destruction.</p>
<p>Prompt injection exploits an architectural property of how LLMs process language — one that can be mitigated but not patched away. LLMs process both trusted system instructions and untrusted user inputs as identical text sequences. The model receives system prompts, conversation history, user input, and retrieved documents as a single continuous stream of tokens. You cannot parameterize natural language, so there&rsquo;s no structural separation to tell the model which instructions to trust.</p>
<h2 id="what-to-do">What to do?</h2>
<p>The design or architecture flaws are really unfixable in LLMs at individual level right? So what now?
Here are some things you need to figure out before giving AI full access- <strong>BACKUP AND ROLLBACK</strong> is the gist
<em>For businesses:</em></p>
<ol>
<li><strong>DO NOT BELIEVE VENDOR PROMISES THAT YOU CAN&rsquo;T VERIFY</strong> (why am I shouting because this needs to register in everyone&rsquo;s head)
If someone says that they have implemented guardrails, ask them how were these created and tested. A lot of times people believe it&rsquo;s a big corp like Google, Microsoft and Palo Alto so whatever they say must be right. Not true, anyone and everyone can make mistakes so verify before you trust. Everything may be nice 99.9% of the time but the 0.01% can really cause damage. Check for benchmarks, red-team reports, user reviews etc during vendor eval.
If your business is small/medium sized, just have someone from IT/Dev go through a vendor&rsquo;s trust portal and verify industry certifications and if it&rsquo;s a startup ask for pentest reports, backup plans etc.</li>
</ol>
<p>2.<strong>Principle of Least Privilege</strong>
Every token, credential, or API key an AI agent can access must be scoped to exactly what it needs. The Cursor agent found an API token in an unrelated file whose permissions were far broader than the task required. Railway&rsquo;s API allowed destructive actions without any confirmation check. This is a configuration problem that exists regardless of AI — AI just executes it faster. <a href="https://www.techradar.com/pro/it-took-9-seconds-tech-founder-outlines-how-rogue-claude-powered-ai-tool-wiped-entire-company-database-and-backups-but-says-theres-no-such-thing-as-bad-publicity">TechRadar</a></p>
<ul>
<li>Scope all tokens to specific actions, not resource-level access</li>
<li>Use separate credentials for read vs. write vs. destructive operations</li>
<li>Rotate and audit tokens agents can reach</li>
<li>Store the creds in a vault or secrets manager.</li>
</ul>
<ol start="3">
<li><strong>Backups That Agents Can&rsquo;t Reach</strong>
The PocketOS disaster was compounded because Railway stored backups on the same volume as data. This is also an S3/cloud bucket misconfiguration pattern: if your agent has credentials that can write to prod, check whether those same credentials can delete the backup.</li>
</ol>
<ul>
<li>Offsite, immutable backups (S3 Object Lock, Azure Immutable Blob Storage)</li>
<li>Cross-region replication that is <em>write-only from prod</em> — no delete rights/soft delete</li>
<li>Determine criticality of the apps etc and establish BC/DR Plan. It will help no matter how inconvenient.</li>
</ul>
<ol>
<li><strong>Human-in-the-Loop for Important Actions</strong>
Deleting anything? Take user consent. Overwriting an old file? Take user consent. Approving a big transaction? Take user constent.
You get it right? Basically the human will review everything and take accountability of the agent/workflow they created. Capabilities cover every tool added, every Skill installed. The discipline of allowlists that&rsquo;s the key. Pinning MCP server versions so they don&rsquo;t silently update to a poisoned release, and reviewing which skill may actually be necessary.</li>
</ol>
<ul>
<li>Never give agents write/delete access to prod in automated flows without a human approval gate</li>
<li>Use normal mode instead of auto-approve modes. Annoying but not costly.</li>
<li>For irreversible operations (volume deletion, mass email, financial transfers), require explicit confirmation with a description of what will be destroyed. If it&rsquo;s that important, take approval twice.</li>
</ul>
<p><strong>5. MCP Server Hygiene</strong></p>
<ul>
<li>Hundreds of MCP servers on the web are misconfigured, unnecessarily exposing users to cyberattacks. Around 7,000 MCP servers are open on the web, approximately half the total. Thus, only connect MCP servers you&rsquo;ve reviewed. Pin versions. Don&rsquo;t use archived/unmaintained servers.</li>
<li>Treat third-party MCP servers like third-party npm packages.</li>
<li>Create MCP Registry for allowing approved servers that way each new version and each new servers needs to be validated. Use InvariantLabs/Snyk&rsquo;s Agent scan to detect issues and vulnerabilities.</li>
</ul>
<p><strong>6. AI Governance Before Deployment</strong>
Before deploying agents into production workflows, document: what can this agent access, what&rsquo;s the blast radius if it acts incorrectly, and who reviews its actions. Have a dedicated team (can be one person for small companies) to review the workflows, review compliance, cross-check safety controls before prod deployment. For small or similar usecases, you may automate some scans etc but still human review is important because LLM can&rsquo;t come out of the screen and smack the developer for not following guidelines. PS: Workplace violence is wrong, beat them out side the campus where there are no camera./s</p>
<p><strong>6. Monitoring and Audit Trails</strong>
Agents should log every action they take — every API call, every file write, every tool invocation. Without this you can&rsquo;t reconstruct what happened or demonstrate compliance. This is the foundation. Use ELK Stack and OpenTelemetry for performance benchmarks etc.</p>
<p><em>For Individuals / Personal Users:</em>
<strong>1. Never run AI agents with admin/root</strong> Don&rsquo;t give coding agents or MCP tools elevated OS permissions. Run them as a limited user. If an agent needs to install something, it should ask you — not execute as root.</p>
<p><strong>2. Version control everything you care about</strong> If you&rsquo;re using AI to edit code, documents, or configuration files, those files should be in git (or at minimum, have Time Machine / VSS snapshots on). An AI that refactors your codebase incorrectly is recoverable if you have a commit history. Without it, you have whatever the agent left behind.</p>
<p><strong>3. Treat AI-suggested commands with the same skepticism as Stack Overflow answers</strong> A model that confidently tells you to run <code>rm -rf node_modules &amp;&amp; npm install</code> is not wrong — until it autocompletes a broader path due to a hallucination or context confusion. Review destructive commands before executing them.</p>
<p><strong>4. Don&rsquo;t paste credentials into AI chat windows</strong> Even if you trust the model, MCP servers, browser extensions, and third-party tools in the pipeline may log or leak context. Hundreds of misconfigured MCP servers have been found exposing AI models to remote code execution and other cyberattacks, acting as bridges between AI tools and private data.</p>
<p><strong>5. Compartmentalize what AI can touch</strong> Don&rsquo;t give your AI assistant access to your email, calendar, GitHub, and cloud storage simultaneously unless you understand the full chain. Each integration multiplies what can go wrong.</p>
<p><strong>6. Backup your Data</strong>
Use OneDrive, ProtonDrive, pCloud etc so that you can get back important data. Easiest and most convenient way.
Use USBs, hard disks or NAS for a offline copy of very important data like dissertation, research, lawyer files etc.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to setup a Dev Container on VS Code?</title>
      <link>https://bhavyatiwary.com/posts/dev_container/</link>
      <pubDate>Fri, 07 Nov 2025 23:53:04 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/dev_container/</guid>
      <description>A beginner&amp;#39;s guide to setting up a Dev Container in VS Code on Windows with WSL 2, so each project gets its own isolated toolchain.</description>
      <content:encoded><![CDATA[<p>This is a beginner guide to set up a dev container. A development container (or dev container for short) basically is an isolated environment with it&rsquo;s own set of tool that you can use for development. It is especially helpful for languages like Python where they have complex environment management setups (thanks but no thanks pip, anaconda, venv!) or if you do too many projects and don&rsquo;t want to setup all the components from scratch every time.
As I am using Windows currently and it&rsquo;s easier to use a linux container, this guide will be for dev container on VS Code using WSL.</p>
<h2 id="prerequisites-before-we-can-start-setting-up">Prerequisites before we can start setting up</h2>
<h4 id="setting-up-wsl-windows-1011">Setting up WSL (Windows 10/11)</h4>
<p>Windows Subsystem for Linux(WSL) is a component of Microsoft Windows that allows the use of a Linux environment from within Windows without using a VM or dual booting. There are 2 versions- WSL 1 and 2. Both are very different from each other. You can check out their Wikipedia for more details. In this setup, I&rsquo;m using WSL 2 which is a default in the recent versions of Windows (post 2019). WSL 2 uses a Linux kernel– a managed virtual machine via Hyper-V that implements the full Linux kernel. As a result, WSL 2 is compatible with more Linux binaries.</p>
<ul>
<li>
<p>Open a new PowerShell terminal as an admin and run the below command.</p>
<p>wsl &ndash;install<br>
For a specific default distro:
wsl &ndash;install &ndash;d &lt; name&gt;</p>
</li>
</ul>
<p>This will enable WSL2 and install the default distro- Ubuntu which works well for this tutorial but you may go with other distros as well.
If you&rsquo;re facing issues, you can checkout this <a href="https://learn.microsoft.com/en-us/windows/wsl/troubleshooting">link</a>. You may have to enable certain settings.</p>
<ul>
<li>Set up the username and password for the distro. PS- Don&rsquo;t use the default credentials like admin/admin as it&rsquo;s widely available in user manuals/guides and people are aware of it thus making it more vulnerable.</li>
</ul>
<h3 id="install-vs-code-and-docker-desktop">Install VS Code and Docker Desktop</h3>
<p>It&rsquo;s very simple. Just download from the official sources and run the GUI installer.
VSCode is the IDE we&rsquo;re using and Docker Desktop basically is an app that allows users to create, run, update and use docker containers. It let&rsquo;s us interact with the image repos, local images, volumes etc.
For Docker Desktop, remember to check the option to start docker at startup, unless you want to explicitly start the docker service every time manually.</p>
<p>Also, for simplicity sake, we will be using <a href="https://www.docker.com/products/docker-desktop/">Docker Desktop</a>. In the future, you may want to install Docker directly on your linux distro if the need arises.</p>
<h3 id="enable-plugins-on-vs-code">Enable plugins on VS Code</h3>
<p>On VS Code enable the plugins:</p>
<ul>
<li>Remote Development- WSL
This plugin lets us use VS Code to build Linux applications that run on the Windows Subsystem for Linux (WSL)</li>
<li>Remote Development- Dev Containers
The extension lets us use a Docker container as a full-featured development environment.</li>
<li>Docker
The Docker Extension Pack makes it easy to build, manage, and deploy containerized applications from Visual Studio Code.</li>
</ul>


<style type="text/css">
    .box-shortcode {
      padding: 1.6em;
      padding-top: 1.4em;
      line-height: 1.4em;
      margin-top: 1em;
      margin-bottom: 2em;
      border-radius: 4px;
      color: #444;
      background: #f3ebe850;
    }

    .box-title {
      margin: -18px -18px 12px;
      padding: 4px 18px;
      border-radius: 4px 4px 0 0;
      font-weight: 700;
      color: var(--content);
      background: #6ab0de;
    }
    .box-shortcode.warning .box-title {
      background: #ff6b6b;
      color: var(--content);
    }
    .box-shortcode.warning {
      background: #ff6b6b4f;
      color: var(--content);
    }
    .box-shortcode.info .box-title {
      background: #0089e488;
      color: var(--content);
    }
    .box-shortcode.info {
      background: #0089e41c;
      box-shadow: 3px 3px 5px #0089e410;
      color: var(--content);
    }
    .box-shortcode.important .box-title {
      background: #f7ec2c;
    }
    .box-shortcode.important {
      background: #f7ec2c7d;
    }
    .box-shortcode.tip .box-title {
      background: #a3ffa34d;
    }
    .box-shortcode.tip {
      background: #a3ffa34d;
      box-shadow: 3px 3px 5px #0089e410;
    }
    .icon-box {
      display: inline-flex;
      align-self: center;
      margin-right: 8px;
    }
    .icon-box img,
    .icon-box svg {
      height: 1em;
      width: 1em;
      fill: currentColor;
    }
    .icon-box img,
    .icon-box.baseline svg {
      top: 0.125em;
      position: relative;
    }
    .box-shortcode p {
      margin-bottom: 0.6em;
    }
    .box-shortcode p:first-of-type {
      display: inline;
    }
    .box-shortcode p:nth-of-type(2) {
      margin-top: 0.6em;
    }
    .box-shortcode p:last-child {
      margin-bottom: 0;
    }
  </style>

  
  <svg width="0" height="0" display="none" xmlns="http://www.w3.org/2000/svg">
    <symbol id="tip-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/>
    </symbol>
    <symbol id="important-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>
    </symbol>
    <symbol id="warning-box" viewBox="0 0 576 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>
    </symbol>
    <symbol id="info-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"/>
    </symbol>
  </svg><div class="box box-shortcode info" >
    <span class="icon-box baseline">
      <svg><use href="#info-box"></use></svg>
    </span>
    <p>Always enable plugins from trusted and verified sources as some plugins may have backdoors, cryptojacking malwares etc that will compromise your whole system. In this case, all the three plugins are published by Microsoft so will have the blue tick.</p>
  </div>

<p><img loading="lazy" src="extensions.png" alt="Extensions"  />
</p>
<h2 id="configuring-and-setting-up-the-container">Configuring and setting up the container</h2>
<p>Now that we&rsquo;re done with the prerequsites open a new WSL window by clicking the blue button at the bottom left side corner and choose the first option- New WSL Window.
PS- I have already set up the connection hence it shows as Connect to WSL but if it&rsquo;s the first time you&rsquo;re setting it up it should show as New WSL Window
<img loading="lazy" src="connect.png" alt="The red row points to the button which when clicked shows the options for remote features."  />
</p>
<p>From here onwards we&rsquo;ll be working on Linux.
We want to create a folder to store our project in the WSL Filesystem. In this case, I have created it in the home directory. Run this in your terminal to create the a new directory (mkdir name) and open the directory (cd name) in the terminal.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">mkdir dev-container-test <span class="o">&amp;&amp;</span> <span class="nb">cd</span> dev-container-test
</span></span></code></pre></div><p>I&rsquo;m manually creating the necessary files to configure the container but you can also use templates by going to the Command Palette and  selecting the “Add Dev Container Configuration Files” option.</p>
<p>Create a new directory with the name <strong>.devcontainer</strong> with the <strong>.</strong>  and under this directory create <strong>devcontainer.json</strong> ,  <strong>Dockerfile</strong> and <strong>requirements.txt</strong> files.
<img loading="lazy" src="folderstruct.png" alt="This is the how the folder should look like."  />
</p>
<p>Now let&rsquo;s update the files we just created!</p>
<h3 id="devcontainerjson">devcontainer.json</h3>
<p>This file tells VSCode how to build our ebvironment.
Open devcontainer.json and paste this code:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="c1">// This gives the dev container a name and let&#39;s the machine know to
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>  <span class="c1">// build the container following the Dockerfile instructions.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>  <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;dev-container-test&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;build&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;dockerfile&#34;</span><span class="p">:</span> <span class="s2">&#34;Dockerfile&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">},</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;customizations&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="c1">// Configure properties specific to VS Code.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>    <span class="nt">&#34;vscode&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">      <span class="c1">// Add extensions you want installed when the container is created.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>      <span class="nt">&#34;extensions&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;ms-python.python&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;ms-python.vscode-pylance&#34;</span>
</span></span><span class="line"><span class="cl">      <span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="p">}</span>
</span></span><span class="line"><span class="cl">  <span class="p">},</span>
</span></span><span class="line"><span class="cl">  <span class="c1">// All ports listed here will also be available outside your development
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>  <span class="c1">// container i.e. in your machine’s localhost. By default, Docker
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>  <span class="c1">// encapsulates your application in a box with no contact to the outside
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>  <span class="c1">// world.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>  <span class="nt">&#34;forwardPorts&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mi">5000</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><h3 id="dockerfile">Dockerfile:</h3>
<p>I’m going to use the container as a virtual development environment. So I want to write a <strong>Dockerfile</strong> to build a container image, beginning with the version of Python that I want, and then add all of my dependencies into it.
Open Docker file and paste the below code:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-dockerfile" data-lang="dockerfile"><span class="line"><span class="cl">    <span class="c1">#The base image for the container that I have taken from DockerHub (it is hardened and secure to some extent already) </span><span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    FROM python:3.11-slim<span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    <span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    <span class="c1"># Disable buffering for Python&#39;s standard output (stdout) and standard error (stderr) streams so that output from Python app, such as Django logs, is sent directly to the container&#39;s logs in real time.      </span><span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    ENV <span class="nv">PYTHONUNBUFFERED</span><span class="o">=</span><span class="m">1</span>  <span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>     <span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    <span class="c1"># Copy python requirements to the docker container and install. Here we&#39;re going to install all our libraries and depndencies. </span><span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    <span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    COPY requirements.txt .<span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    <span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>    RUN python -m pip install -r requirements.txt<span class="err">
</span></span></span></code></pre></div><h3 id="requirements">Requirements</h3>
<p>In this file we&rsquo;ll mention all the dependencies that needs to be downloaded and their versions (optional).  Keeping this very simple with only Pylint which checks for programming errors, style issues, and potential bugs</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">pylint
</span></span></code></pre></div><p>Now we should be good to build and run the docker container. Open the command palette and choose <strong>“Dev Containers: Reopen in Container”</strong>. (If you have already built a container, choose <strong>“Rebuilt and Reopen in Container</strong>” instead.)</p>
<p>Once the container build is over it will open a new workspace where you can start your development. At any point, you can update your config and rebuild the container.<br>
Happy Coding!</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to disable Co-pilot in Windows 11?</title>
      <link>https://bhavyatiwary.com/posts/disable-copilot/</link>
      <pubDate>Sat, 25 May 2024 23:53:04 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/disable-copilot/</guid>
      <description>Why you might want to turn off Copilot in Windows 11 for privacy, and the steps to disable it.</description>
      <content:encoded><![CDATA[

<style type="text/css">
    .box-shortcode {
      padding: 1.6em;
      padding-top: 1.4em;
      line-height: 1.4em;
      margin-top: 1em;
      margin-bottom: 2em;
      border-radius: 4px;
      color: #444;
      background: #f3ebe850;
    }

    .box-title {
      margin: -18px -18px 12px;
      padding: 4px 18px;
      border-radius: 4px 4px 0 0;
      font-weight: 700;
      color: var(--content);
      background: #6ab0de;
    }
    .box-shortcode.warning .box-title {
      background: #ff6b6b;
      color: var(--content);
    }
    .box-shortcode.warning {
      background: #ff6b6b4f;
      color: var(--content);
    }
    .box-shortcode.info .box-title {
      background: #0089e488;
      color: var(--content);
    }
    .box-shortcode.info {
      background: #0089e41c;
      box-shadow: 3px 3px 5px #0089e410;
      color: var(--content);
    }
    .box-shortcode.important .box-title {
      background: #f7ec2c;
    }
    .box-shortcode.important {
      background: #f7ec2c7d;
    }
    .box-shortcode.tip .box-title {
      background: #a3ffa34d;
    }
    .box-shortcode.tip {
      background: #a3ffa34d;
      box-shadow: 3px 3px 5px #0089e410;
    }
    .icon-box {
      display: inline-flex;
      align-self: center;
      margin-right: 8px;
    }
    .icon-box img,
    .icon-box svg {
      height: 1em;
      width: 1em;
      fill: currentColor;
    }
    .icon-box img,
    .icon-box.baseline svg {
      top: 0.125em;
      position: relative;
    }
    .box-shortcode p {
      margin-bottom: 0.6em;
    }
    .box-shortcode p:first-of-type {
      display: inline;
    }
    .box-shortcode p:nth-of-type(2) {
      margin-top: 0.6em;
    }
    .box-shortcode p:last-child {
      margin-bottom: 0;
    }
  </style>

  
  <svg width="0" height="0" display="none" xmlns="http://www.w3.org/2000/svg">
    <symbol id="tip-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/>
    </symbol>
    <symbol id="important-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>
    </symbol>
    <symbol id="warning-box" viewBox="0 0 576 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>
    </symbol>
    <symbol id="info-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
      <path
        d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"/>
    </symbol>
  </svg><div class="box box-shortcode info" >
    <span class="icon-box baseline">
      <svg><use href="#info-box"></use></svg>
    </span>
    <p>This article is not updated and may include outdated stuff. I&rsquo;ll update it when I can.</p>
  </div>

<p>Microsoft has released a couple of AI-based features/functionalities in Windows 11 and 10. Currently, it is available as &ldquo;Preview&rdquo; with limited capabilities in select regions. Some more context about Copilot for those who are not aware about it:</p>
<h2 id="what-is-windows-co-pilot">What is Windows Co-pilot?</h2>
<p>Let&rsquo;s understand this first with some history.
Microsoft is one of the major shareholder in OpenAI- the creator of ChatGPT models. Post the fame of LLM, chatbots and Gen-AI, Microsoft decided to set up it&rsquo;s own GPT instances and infuse AI in some of it&rsquo;s functionalities and products like in Bing Search or in Quick Search. It let&rsquo;s you give text based commands like turn on dark mode or search for flight details etc.</p>
<h2 id="why-you-should-disable-co-pilot">Why you should disable Co-pilot?</h2>
<p>There is one big reason, you may want to not use these products, till countries/governments release some laws to protect individual rights and IP (intellectual property) and that is <strong>PRIVACY</strong>. According to Microsoft&rsquo;s Terms of Service and Privacy Policy, it not only captures your data but also may sell it to third-parties or use it for development of their services.</p>
<blockquote>
<p><strong>Use of Your Content.</strong> As part of providing the AI services, Microsoft will process and store your inputs to the service as well as output from the service, for purposes of monitoring for and preventing abusive or harmful uses or outputs of the service.
~ <a href="https://www.microsoft.com/en-us/servicesagreement#14q_AIServices">Terms of Service </a> under AI services (iv)</p>
</blockquote>
<p><a href="https://privacy.microsoft.com/en-gb/privacystatement">Privacy Policy </a> is a bit long because it covers all products under Micrsoft but TL;DR or key points can be found <a href="https://edit.tosdr.org/services/331">here</a></p>
<p>If you do have time, I would recommend going through atleast the AI section (Search, Microsoft Edge, and artificial intelligence) since Microsoft is coming up with new AI features.</p>
<h2 id="why-does-it-matter-that-some-data-they-may-collect">Why does it matter that some data they may collect?</h2>
<p>A lot of people believe their information is not that important enough because they may not be famous or may not have anything to hide so it&rsquo;s not an issue if any company accesses their data. But it matters and some day-to day examples of why:</p>
<ul>
<li>
<p>your data is used by companies usually to market their product in a way that it appeals to you. Instead of ensuring quality and good products, it&rsquo;s more about trying to trying to generate sales and profit. They may also sell the different types of data from your devices, networks and devices to other companies leading to exploitation. Some Facebook/Meta related examples:</p>
<ul>
<li>Recently, court documents were unsealed as part of a major anti-trust lawsuit filed in U.S.  claim Netflix and Facebook &ldquo;enjoyed a special relationship&rdquo; so that Netflix could better tailor its ads with Facebook involving millions of dollars.</li>
<li>In 2018, the New York Times published a report citing hundreds of pages of <a href="https://www.foxbusiness.com/technology/facebook-let-netflix-peek-user-dms-explosive-court-docs-claim">Facebook documents</a>, alleging Facebook had authorized Spotify and Netflix to access users&rsquo; DMs.
<em>PS: Microsoft did say they may sell/share your data with third-parties.</em></li>
</ul>
</li>
<li>
<p>in some AI apps, such as self-driving cars, have the ability to track your location and driving habits to help the car understand its surroundings and act accordingly. While this technology may help make cars safer and smarter, it also opens more opportunities for your personal information to become part of a larger data set that can be tracked across different devices in your home, work, or public spaces.</p>
</li>
<li>
<p>your images (even just a selfie in which you&rsquo;re fully clothed) may be used to generate porn or for revenge porn without your knowledge or permission.</p>
</li>
<li>
<p>data scraped from the internet using tools may memorize personal information about people, as well as relational data about their family and friends. This data helps enable spear-phishing—the deliberate targeting of people for purposes of identity theft or fraud. Already, bad actors are using AI voice cloning to impersonate people and then extort them over good old-fashioned phones.</p>
</li>
</ul>
<h2 id="how-do-i-disable-co-pilot">How do I disable Co-pilot?</h2>
<p>I would have to admit, Microsoft has not made this easy with not providing an option to opt-out of this preview or even by not being transparent regarding removal options. Also, enabling features that collect personal data in an update without letting users explicitly know about the same. But fortunately, the steps to follow are easy:</p>
<ul>
<li>Remove it from the Taskbar (doesn&rsquo;t remove Copilot completely)
Go to Setting -&gt; Personalization -&gt; Taskbar -&gt; Toggle of Copilot</li>
</ul>
<ol start="2">
<li>
<p>Use Registry Editor to disable it for all users (again doesn&rsquo;t disable Copilot completely, it will still run as background process)</p>
<ul>
<li>Go to Registry Editor</li>
<li>Using <strong>Ctrl + F</strong> find the <code>TurnOffWindowsCopilot</code> section.</li>
<li>We need to update the REG_DWORD from 0 to 1 to run this function. To do that you can either manually change the values or create a text file and add this code from Shawn Brink:</li>
</ul>
</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsCopilot]
</span></span><span class="line"><span class="cl">&#34;TurnOffWindowsCopilot&#34;=dword:0000001
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot]
</span></span><span class="line"><span class="cl">&#34;TurnOffWindowsCopilot&#34;=dword:0000000
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
</span></span><span class="line"><span class="cl">&#34;HubsSidebarEnabled&#34;=dword:0000001
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer]
</span></span><span class="line"><span class="cl">&#34;DisableSearchBoxSuggestions&#34;=dword:0000001
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer]
</span></span><span class="line"><span class="cl">&#34;DisableSearchBoxSuggestions&#34;=dword:0000001
</span></span></code></pre></div><p>What does this code do ? Well essentially we&rsquo;re updating the configuration information that the OS has. The HKEY_CURRENT_USER (HKCU) registry hive stores configuration information specific to the current/logged-in user. The HKEY_LOCAL_MACHINE (HKLM) registry hive holds most of the configuration data for Windows OS itself and it&rsquo;s software.</p>
<ol start="3">
<li>Finally, we can use gedit or Group Policy Editor to remove the Co-Pilot Bundle. This completely removes Co-Pilot from your system.
<ul>
<li>Search <code>gedit</code> or run <code>gedit.msc</code> file to open Group Policy Editor.</li>
<li>Follow the path: <strong>User Configuration &gt; Administrative Templates &gt; Windows Components &gt; Windows Copilot</strong></li>
<li>In the Windows Copilot folder, double click <code>Turn Off Windows Copilot</code>. In the pop-up, choose the <code>Enabled</code> button and apply the changes.</li>
</ul>
</li>
</ol>
<h2 id="references">References:</h2>
<ol>
<li><a href="https://www.elevenforum.com/t/completely-disable-and-remove-copilot-in-windows-11.23264/">https://www.elevenforum.com/t/completely-disable-and-remove-copilot-in-windows-11.23264/</a></li>
<li><a href="https://www.laptopmag.com/software/how-to-turn-off-copilot-in-windows-11-keep-it-ai-free">https://www.laptopmag.com/software/how-to-turn-off-copilot-in-windows-11-keep-it-ai-free</a></li>
<li><a href="https://www.tomsguide.com/computing/software/how-disable-copilot-in-windows-11">https://www.tomsguide.com/computing/software/how-disable-copilot-in-windows-11</a></li>
</ol>
]]></content:encoded>
    </item>
    <item>
      <title>What to do after installing Arch? </title>
      <link>https://bhavyatiwary.com/posts/checklist/</link>
      <pubDate>Tue, 30 Apr 2024 09:37:58 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/checklist/</guid>
      <description>A post-install checklist for Arch Linux: mirrors, sound, desktop environment, user directories, backups and the other setup steps worth doing next.</description>
      <content:encoded><![CDATA[<p>Wondering what to do next after installing the basic version of Arch? Here&rsquo;s a checklist!</p>
<p><em>PS:</em> Somethings are already covered in my previous post (Arch installation guide), I&rsquo;ll add a * to those items</p>
<h2 id="general-edition">General Edition:</h2>
<ul>
<li><input checked="" disabled="" type="checkbox"> Sorting the <a href="https://wiki.archlinux.org/index.php/Mirrors#Sorting_mirrors">mirrors</a>*- follow the instructions to re-order your mirrors by fastest speed. I have used Reflector.</li>
<li><input checked="" disabled="" type="checkbox"> Install <a href="https://wiki.archlinux.org/index.php/Sound_system">Sound system</a> and Display Server (<a href="https://www.x.org/wiki/">Xorg </a> or <a href="https://wiki.archlinux.org/title/Wayland" title="Wayland">Wayland</a>)*</li>
<li><input checked="" disabled="" type="checkbox"> Set up <a href="https://wiki.archlinux.org/index.php/Window_manager">Window manager</a>  or  <a href="https://wiki.archlinux.org/index.php/Desktop_environment">Desktop environment</a> like GNOME, Plasma, Xfce etc*</li>
<li><input disabled="" type="checkbox"> Create user directory files</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo pacman -S xdg-user-dirs
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">xdg-user-dirs-update
</span></span></code></pre></div><ul>
<li><input disabled="" type="checkbox"> Configure Pacman
Using the below command, you can open the pacman configuration file and uncomment the necessary lines:
-allow <code>ParallelDownloads</code> under <code>[options]</code>
-add <code>colors</code>
-enable <code>VerbosePkgLists</code> to view name, version and size of target packages formatted
-<code>CleanMethod</code> = KeepCurrent under<code>[options]</code> to  clean up the cache so that only <em>outdated</em> tarballs are deleted
-<code>NoExtract</code> (<a href="https://wiki.archlinux.org/title/Pacman/Tips_and_tricks#Installing_only_content_in_required_languages">Guidelines with examples</a>)</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo nano /etc/pacman.conf
</span></span></code></pre></div><ul>
<li>Set up <code>paccache</code> to clean package cache</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo pacman -S pacman-contrib
</span></span><span class="line"><span class="cl"><span class="c1">#activate the paccache timer:</span>
</span></span><span class="line"><span class="cl">sudo systemctl <span class="nb">enable</span> paccache.timer
</span></span></code></pre></div><p>You can automate the process by creating a hook using package <a href="https://aur.archlinux.org/packages/paccache-hook/">paccache-hook</a> under path /etc/pacman.d/hooks/ with a .hook file (eg: remove_old_cache.hook)
Sample script</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="o">[</span>Trigger<span class="o">]</span>
</span></span><span class="line"><span class="cl"><span class="nv">Operation</span> <span class="o">=</span> Remove
</span></span><span class="line"><span class="cl"><span class="nv">Operation</span> <span class="o">=</span> Install
</span></span><span class="line"><span class="cl"><span class="nv">Operation</span> <span class="o">=</span> Upgrade
</span></span><span class="line"><span class="cl"><span class="nv">Type</span> <span class="o">=</span> Package
</span></span><span class="line"><span class="cl"><span class="nv">Target</span> <span class="o">=</span> *
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="o">[</span>Action<span class="o">]</span>
</span></span><span class="line"><span class="cl"><span class="nv">Description</span> <span class="o">=</span> Keep the last cache and the currently installed.
</span></span><span class="line"><span class="cl"><span class="nv">When</span> <span class="o">=</span> PostTransaction
</span></span><span class="line"><span class="cl"><span class="nv">Exec</span> <span class="o">=</span> /usr/bin/paccache -rvk2
</span></span></code></pre></div><ul>
<li><input disabled="" type="checkbox"> Install essential packages:</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo pacman -S --needed firefox nemo leafpad evince ksnip lximage-qt libreoffice-fresh vlc
</span></span></code></pre></div><ul>
<li><input disabled="" type="checkbox"> Setting up an AUR helper like yay, pacaur, paru etc:
AUR helpers automate usage of the <a href="https://wiki.archlinux.org/title/Arch_User_Repository" title="Arch User Repository">Arch User Repository</a>.</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo pacman -S --needed base-devel git
</span></span><span class="line"><span class="cl">mkdir Programs
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> Programs
</span></span><span class="line"><span class="cl">git clone https://aur.archlinux.org/yay.git
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> yay
</span></span><span class="line"><span class="cl">makepkg -si
</span></span></code></pre></div><h2 id="security-edition">Security Edition:</h2>
<ul>
<li>
<p><input checked="" disabled="" type="checkbox"> Creating a <a href="https://wiki.archlinux.org/index.php/Users_and_groups#Example_adding_a_user">non-root user</a> with <a href="https://wiki.archlinux.org/index.php/Sudo#Using_visudo">sudo</a> permissions*
A new installation leaves you with only the <a href="https://en.wikipedia.org/wiki/Superuser" title="wikipedia:Superuser">superuser</a> account, better known as &ldquo;root&rdquo;. Logging in as root for prolonged periods of time, possibly even exposing it via <a href="https://wiki.archlinux.org/title/SSH" title="SSH">SSH</a> on a server, <a href="https://apple.stackexchange.com/questions/192365/is-it-ok-to-use-the-root-user-as-a-normal-user/192422#192422">is insecure</a>. Instead, you should create and use unprivileged user account(s) for most tasks, only using the root account for system administration. How to do that? Add a user and set a password. Add them to the  <code>wheel</code>  group and use  <code>visudo</code>  command to edit the sudoers file. Uncomment the command that allows members of <code>wheel</code> group to use sudo.</p>
</li>
<li>
<p><input disabled="" type="checkbox"> Set up <a href="https://wiki.archlinux.org/title/List_of_applications/Security#Password_managers">password managers</a> and install <code>libpwquality</code>
Note: Desktop environments have their own password managers apps available as part of the package.</p>
</li>
<li>
<p><input disabled="" type="checkbox"> Install the microcode*
Processor manufacturers release stability and security updates to the processor <a href="https://en.wikipedia.org/wiki/Microcode" title="wikipedia:Microcode">microcode</a>. These updates provide bug fixes that can be critical to the stability of your system. Without them, you may experience spurious crashes or unexpected system halts that can be difficult to track down.</p>
</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#for AMD:</span>
</span></span><span class="line"><span class="cl">sudo pacman -S amd-ucode
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#for Intel:</span>
</span></span><span class="line"><span class="cl">sudo pacman -Sy intel-ucode 
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Check the kernel messages with _journalctl_ to see if the microcode has been updated:</span>
</span></span><span class="line"><span class="cl">journalctl -k --grep<span class="o">=</span><span class="s1">&#39;microcode:&#39;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#One should see something similar to the following on every boot, indicating that microcode is updated very early on:</span>
</span></span><span class="line"><span class="cl"><span class="c1">#kernel: microcode: Current revision: 0x00000012</span>
</span></span><span class="line"><span class="cl"><span class="c1">#kernel: microcode: Updated early from: 0x0000000e</span>
</span></span></code></pre></div><ul>
<li><input disabled="" type="checkbox"> Enforce a delay after a failed login attempt</li>
</ul>
<p>Add the following line to  <code>/etc/pam.d/system-login</code>  to add a delay of at least 4 seconds between failed login attempts:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">auth optional pam_faildelay.so <span class="nv">delay</span><span class="o">=</span><span class="m">4000000</span>
</span></span><span class="line"><span class="cl"><span class="c1">#`4000000` is the time in microseconds to delay.</span>
</span></span></code></pre></div><ul>
<li><input disabled="" type="checkbox"> Restricting root login
Once  <a href="https://wiki.archlinux.org/title/Sudo" title="Sudo">sudo</a>  is properly configured, full root access can be heavily restricted or denied without losing much usability. To disable root, but still allowing to use  <a href="https://wiki.archlinux.org/title/Sudo" title="Sudo">sudo</a>, you can use</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">passwd --lock root
</span></span></code></pre></div><ul>
<li><input disabled="" type="checkbox"> Configure SSH
SSH is a protocol used to securely log onto remote systems. Modifying the SSH daemon configuration file, typically found at &lsquo;/etc/ssh/sshd_config&rsquo; to customize the configs:</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Disable root login </span>
</span></span><span class="line"><span class="cl">PermitRootLogin no 
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Enable public key authentication </span>
</span></span><span class="line"><span class="cl">PubkeyAuthentication yes  
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Specify the allowed users (add your sudo user in place of user1 and user 2)</span>
</span></span><span class="line"><span class="cl">AllowUsers user1 user2 
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Change the default port </span>
</span></span><span class="line"><span class="cl">Port <span class="m">2222</span> 
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Limit the number of authentication attempts </span>
</span></span><span class="line"><span class="cl">MaxAuthTries <span class="m">3</span>
</span></span><span class="line"><span class="cl"> 
</span></span><span class="line"><span class="cl"><span class="c1"># Enable two-factor authentication</span>
</span></span><span class="line"><span class="cl">AuthenticationMethods publickey,password 
</span></span><span class="line"><span class="cl">publickey,keyboard-interactive
</span></span></code></pre></div><p>After making these changes, don&rsquo;t forget to restart the SSH service for the changes to take effect.</p>
<ul>
<li><input disabled="" type="checkbox"> Configure firewall.
By default firewall is not enabled on Arch. You can configure firewall rules via <a href="https://wiki.archlinux.org/title/Iptables">iptables</a> and <a href="https://wiki.archlinux.org/title/Nftables">nftables</a> and implement them.
UFW (Uncomplicated Firewall) can also be used. It is a program for managing a netfilter <a href="https://wiki.archlinux.org/title/Firewall" title="Firewall">firewall</a>. It provides a command line interface and aims to be uncomplicated and easy to use.</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#Install UFW:</span>
</span></span><span class="line"><span class="cl">sudo pacman -S ufw
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Enable UFW:</span>
</span></span><span class="line"><span class="cl">sudo ufw <span class="nb">enable</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Check its status:</span>
</span></span><span class="line"><span class="cl">sudo ufw status numbered
</span></span></code></pre></div><p>The default settings are good enough for most users.</p>
<ul>
<li><input disabled="" type="checkbox"> Setup backups
To be able to restore your machine and data back to it&rsquo;s original state in case of any errors or issues is important.</li>
</ul>
<p>Pre-requisites to create a backup:  external hard drive or server for storing your backup. You can get cloud storage via <a href="https://www.rsync.net/products/borg.html">rsync.net</a>, <a href="https://koofr.eu/">koofr</a> or <a href="https://www.borgbase.com/">BorgBase</a>.</p>
<p>For backup I recommend and use <code>Borg</code>  which is opensource and supports a lot of features like compression, duplicity etc. It also has a GUI interface <code>Vorta</code>.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#For Vorta:</span>
</span></span><span class="line"><span class="cl">yay -S vorta 
</span></span><span class="line"><span class="cl"><span class="c1"># FYI- Maintained by https://github.com/bjo81 </span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#For Borg CLI:</span>
</span></span><span class="line"><span class="cl">sudo pacman -S borg
</span></span></code></pre></div><ul>
<li>
<p>For Vorta, checkout- <a href="https://www.youtube.com/watch?v=asZX2YbTaNE">this video</a> by Sun Knudsen or <a href="https://ostechnix.com/vorta-graphical-frontend-for-borgbackup/">this step-by-step tutorial</a> by Karthick from OSTechNix</p>
</li>
<li>
<p>For Borg CLI, checkout the <a href="https://borgbackup.readthedocs.io/en/stable/quickstart.html">official guide</a> or <a href="https://ostechnix.com/backup-restore-files-borg-linux/">tutorial</a> by Karthick from OSTechNix</p>
</li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>How to set up Arch Linux</title>
      <link>https://bhavyatiwary.com/posts/guide_arch/</link>
      <pubDate>Mon, 01 Apr 2024 22:03:20 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/guide_arch/</guid>
      <description>A step-by-step Arch Linux install guide in VirtualBox: partitioning with fdisk and cfdisk, locale, users, GRUB bootloader, networking and a GNOME desktop.</description>
      <content:encoded><![CDATA[<p>This is a basic installation and set up guide for Arch.
Before we getting in to the setup, her&rsquo;s a simple intro. Arch  is a DIY GNU/Linux distro which allows you to customize the system as you wish! It supports the x86-64 architecture. Below is a general architecture diagram for the base linux subsystem setup (this will help visualize the setup steps ): <img loading="lazy" src="https://linux-kernel-labs.github.io/refs/heads/master/_images/ditaa-b9ffae65be16d30be11b5eca188a7a143b1b8227.png" alt="https://linux-kernel-labs.github.io/refs/heads/master/_images/ditaa-b9ffae65be16d30be11b5eca188a7a143b1b8227.png"  />
</p>
<h2 id="installation-methods">Installation Methods</h2>
<p>We can set up Arch Linux:</p>
<ol>
<li>
<p>With a guided installer like <a href="%28https://man.archlinux.org/man/extra/archinstall/archinstall.1.en">archinstall</a> (tried by me)
The installer is released as a part of the official ISO images since 2021. This is a python library can be downloaded via pip or ran using git.
Other guided installers: <a href="https://github.com/MatMoul/archfi">archfi</a>, and <a href="https://anarchyinstaller.gitlab.io/">Anarchy</a></p>
</li>
<li>
<p>Without the guided installer
This is the default installation method and requires you 	to manually configure all the components as per the official guide.</p>
</li>
</ol>
<h2 id="arch-modes">Arch Modes</h2>
<p>As I understand, based on the firmware and disk partitioning - Master Boot Record (partition table) and GUID Partition Table, we have different modes to set up Arch.
Here&rsquo;s a quick overview below:</p>
<ol>
<li>Legacy/BIOS Mode</li>
</ol>
<ul>
<li>BIOS is short for Basic Input-Output system. It&rsquo;s low-level software that resides in a chip on your computer&rsquo;s motherboard.</li>
<li>The BIOS loads when your computer starts up. The BIOS goes through a POST, or Power-On Self Test, before booting your operating system. It checks to ensure your hardware configuration is valid and working properly. If something is wrong, you&rsquo;ll see an error message or hear a cryptic series of beep codes.
When your computer boots—and after the POST finishes—the BIOS looks for a  Master Boot Record or MBR, stored on the boot device and uses it to launch the bootloader
<em>TLDR;</em> BIOS is responsible for waking up your computer&rsquo;s hardware components, ensures they&rsquo;re functioning properly, and then runs the bootloader that boots Windows or whatever other operating system you have installed.</li>
<li>The traditional BIOS still has serious limitations. It can only boot from drives of 2.1 TB or less. 8 TB drives are now common, and a computer with a BIOS can&rsquo;t boot from them. That limitation is due to the way the BIOS&rsquo;s Master Boot Record system works.The BIOS must run in 16-bit processor mode, and only has 1 MB of space to execute in. It has trouble initializing multiple hardware devices at once, which leads to a slower boot process when initializing all the hardware interfaces and devices on a modern PC.</li>
</ul>
<ol start="2">
<li>UEFI Mode</li>
</ol>
<ul>
<li>The <a href="https://www.uefi.org/">Unified Extensible Firmware Interface</a> (UEFI, successor of the EFI) is an interface between operating systems and firmware. It provides a standard environment for booting an operating system and running pre-boot applications. Developed in 2007, UEFI replaces the traditional BIOS on PCs.</li>
<li>This new standard avoids the limitations of the BIOS. The UEFI firmware can boot from drives of 2.2TB or larger—in fact, the theoretical limit is 9.4 zettabytes. UEFI uses the GPT partitioning scheme instead of MBR. It also boots in a more standardized way, launching EFI executables rather than running code from a drive&rsquo;s master boot record.</li>
<li>UEFI can run in 32-bit or 64-bit mode and has more addressable address space than BIOS, which means your boot process is faster.</li>
<li>UEFI is packed with other features. It supports Secure Boot, which means the operating system can be checked for validity to ensure no malware has tampered with the boot process. It can support networking features right in the UEFI firmware itself, which can aid in remote troubleshooting and configuration. With a traditional BIOS, you have to be sitting in front of a physical computer to configure it.</li>
<li>Check this out if you want to know the specifics regarding UEFI mode in Linux: <a href="https://www.happyassassin.net/posts/2014/01/25/uefi-boot-how-does-that-actually-work-then/">https://www.happyassassin.net/posts/2014/01/25/uefi-boot-how-does-that-actually-work-then/</a></li>
</ul>
<p><em>Note:</em> The official installation image does not support Secure Boot (<a href="https://bugs.archlinux.org/task/53864">FS#53864</a>). Secure Boot support was initially added in  <code>archlinux-2013.07.01-dual.iso</code>  and later removed in  <code>archlinux-2016.06.01-dual.iso</code>. At that time  <em>prebootloader</em>  was replaced with  <a href="https://archlinux.org/packages/?name=efitools">efitools</a>, even though the latter uses unsigned EFI binaries. There has been no support for Secure Boot in the official installation medium ever since.
In order to boot an installation medium in a Secure Boot system, you will need to either disable Secure Boot or modify the image in order to add a signed boot loader. <a href="https://archboot.com/">Archboot</a>  images provide a way to use secure boot on installation media.</p>
<p>In this article, I&rsquo;ll go over the setting up Arch Linux without the guided installer on Virtual Box.</p>
<p>FYI- <strong>I&rsquo;m setting Arch on a VirtualBox VM in UEFI mode with GUID Partition Table (GPT)  partition.</strong> I will add details regarding setting up for BIOS/legacy mode and MBR partition details but may not have the screenshots.</p>
<p>If you&rsquo;re setting it up on your machine:</p>
<ul>
<li>Please create a live USB of Arch Linux to set up and then follow the guide from #6.</li>
<li>Disable Secure Boot or modify the official ISO image accordingly.</li>
</ul>
<h2 id="pre--installation-steps">Pre- Installation Steps</h2>
<ol>
<li>Download and setup VirtualBox from the <a href="https://www.virtualbox.org/wiki/Downloads">official site</a></li>
<li>Download the official ISO image and the ISO PGP signature from Arch Linux <a href="https://archlinux.org/download/">official site</a></li>
<li>Before the installation we&rsquo;ll verify the acquired ISO image using GnuPG. Digital signatures are used to ensure that you get an exact copy from the original packager and not a malicious version from a compromised site. OpenPGP programs such as GPG/GnuPG are used to sign and verify those packages.</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">gpg --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig
</span></span></code></pre></div><p>Substitute &lsquo;archlinux-version-x86_64.iso.sig&rsquo; with the name of the ISO PGP Signature file.</p>
<p>The output should have <strong>Good Signature</strong> mentioned similar to the below screenshot:</p>
<p><img loading="lazy" src="sign.png" alt="sign"  />
</p>
<ol start="4">
<li>Create the VM on VirtualBox with the below specifications:</li>
</ol>
<ul>
<li>Create a new machine and name it Arch Linux.</li>
<li>Specify the path to the downloaded Arch Linux ISO.</li>
<li>Choose base memory as 1024 MB (default)</li>
<li>Assign 1GB of RAM (default). If you have the RAM, you can allocate 2GB.</li>
<li>Enable the UEFI mode.</li>
<li>Create a virtual hadisk (VDI) and allocate20GB.</li>
<li>Click Create.</li>
</ul>
<p><img loading="lazy" src="vm.png" alt="VM"  />
</p>
<ol start="5">
<li>Click start to  run the VM and press enter to choose Arch Linux Install Medium (x86_64, x64 UEFI). This is the first option. If you&rsquo;re setting up Arch in legacy/BIOS mode, it should show as Arch Linux Install Medium (x86_64, x64 BIOS)
<img loading="lazy" src="gnugrub.png" alt="GNU Grub"  />
</li>
</ol>
<p><img loading="lazy" src="loading.png" alt="Loading"  />
</p>
<p><img loading="lazy" src="openarch.png" alt="openarch"  />
</p>
<ol start="6">
<li>For enabling/setting up the internet. <strong>If you use a wired connection, it is usually picked up automatically.</strong> As I&rsquo;m setting it up on a VM, it was picked u automatically. To check connection to the internet, we&rsquo;ll use ping command:</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ping -c <span class="m">3</span> google.com
</span></span></code></pre></div><p><img loading="lazy" src="ping.png" alt="ping"  />
</p>
<p>Wi-Fi requires some additional settings. <strong>For Wi-Fi</strong>, we&rsquo;ll use <code>iwctl</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">iwctl
</span></span><span class="line"><span class="cl"> ...
</span></span><span class="line"><span class="cl">Output:
</span></span><span class="line"><span class="cl"><span class="c1">#iwctl</span>
</span></span><span class="line"><span class="cl"><span class="o">[</span>iwd<span class="o">]</span><span class="c1">#</span>
</span></span></code></pre></div><p>Command to get your system’s <strong>wireless device name</strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="o">[</span>iwd<span class="o">]</span><span class="c1"># device list </span>
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">Output:
</span></span><span class="line"><span class="cl"><span class="o">[</span>iwd<span class="o">]</span><span class="c1"># device list </span>
</span></span><span class="line"><span class="cl"><span class="c1">#You should see something like this: </span>
</span></span><span class="line"><span class="cl">            Devices  
</span></span><span class="line"><span class="cl">--------------------------------------------
</span></span><span class="line"><span class="cl"> Name   Address   Powered    Adapter   Mode  
</span></span><span class="line"><span class="cl">-------------------------------------------- 
</span></span><span class="line"><span class="cl">wlan0   ...        on         ...      ...
</span></span></code></pre></div><p>To  <strong>get the list of WiFi networks</strong>, run the below command. Replace  <code>wlan0</code>  with your device name on the below command and all the following commands.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">station wlan0 get-networks 
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">Output:
</span></span><span class="line"><span class="cl"><span class="o">[</span>iwd<span class="o">]</span><span class="c1"># station wlan0 get-networks  </span>
</span></span><span class="line"><span class="cl"><span class="c1">#You should see something like this: </span>
</span></span><span class="line"><span class="cl">           Available Networks  
</span></span><span class="line"><span class="cl">--------------------------------------------
</span></span><span class="line"><span class="cl"> Network Name       Security       Signal  
</span></span><span class="line"><span class="cl">-------------------------------------------- 
</span></span><span class="line"><span class="cl">  TP-Link_8DAB      psk            *****
</span></span><span class="line"><span class="cl">  dlink             wep            *****
</span></span></code></pre></div><p>To  <strong>connect to the WiFi network</strong>, run the below command with the WiFi access point name from the above “get-networks” command.
Enter your WiFi password when prompted.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">station wlan0 connect
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">Output:
</span></span><span class="line"><span class="cl"><span class="o">[</span>iwd<span class="o">]</span><span class="c1"># station wlan0 connect</span>
</span></span><span class="line"><span class="cl"><span class="c1">#You should see something like this: </span>
</span></span><span class="line"><span class="cl">Type the network passprahase <span class="k">for</span> TP-Link_8DAB psk.
</span></span><span class="line"><span class="cl">Passphrase: *******
</span></span></code></pre></div><p>Exit the <code>iwctl</code> using <code>exit</code> or Ctrl+C and test the connection again using <code>ping</code> command.</p>
<ol start="8">
<li>Now moving to <strong>Partitions!</strong>
For partitioning the disks, we’ll use command line based partition manager- <a href="https://www.man7.org/linux/man-pages/man8/fdisk.8.html">fdisk</a></li>
</ol>
<ul>
<li>When recognized by the live system, disks are assigned to a  <a href="https://wiki.archlinux.org/title/Block_device" title="Block device">block device</a>  such as  <code>/dev/sda</code>,  <code>/dev/nvme0n1</code>  or  <code>/dev/mmcblk0</code>. To identify these devices, use  <a href="https://wiki.archlinux.org/title/Lsblk" title="Lsblk">lsblk</a>  or  <em>fdisk</em>.</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">fdisk -l
</span></span></code></pre></div><p><img loading="lazy" src="fdisk.png" alt="fdisk"  />
</p>
<p>Results ending in <code>rom</code>, <code>loop</code> or <code>airootfs</code> may be ignored. <code>mmcblk*</code> devices ending in <code>rpbm</code>, <code>boot0</code> and <code>boot1</code> can be ignored.</p>
<ul>
<li>Check if you have UEFI mode enabled using this command:</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ls /sys/firmware/efi/efivars
</span></span></code></pre></div><p>If this directory exists, you have a UEFI enabled system. You should follow the steps for UEFI system.
<img loading="lazy" src="efivars.png" alt="efivars"  />
</p>
<ul>
<li>If you already have a partition table, skip this step. If your hard drive is brand-new as in the case of a virtual machine or you want to re-partition your hard drive, run this command to create a new partition table:</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cfdisk /dev/sda
</span></span></code></pre></div>

<!-- Shortcode 'video.html' -->

<figure >
  <video playsinline controls class="player" preload="metadata" data-poster="cfdisk.png">
    <source src="/video/cfdisk.mp4">
    <p>
      Your browser does not support HTML5 video.
      Here is <a href="/video/cfdisk.mp4">">a link to download the video</a>.
    </p>
  </video>
  
  <figcaption>Cfdisk Tutorial</figcaption>
</figure>

<p><strong>Steps to follow for UEFI with GPT:</strong>
In the label type window, select <em>GPT</em>.
ss for gpt
<em>Example layout for 20 GB Disk Size which I&rsquo;m following</em></p>
<table>
<thead>
<tr>
<th>Mount Point</th>
<th>Partition</th>
<th>Partition Type</th>
<th>Suggested Size</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>/mnt/boot</code></td>
<td><code>/dev/_efi_system_partition</code></td>
<td>EFI Partition System</td>
<td>512MB</td>
</tr>
<tr>
<td><code>[SWAP]</code></td>
<td><code>/dev/swap_partition</code></td>
<td>Linux Swap</td>
<td>9.5GB</td>
</tr>
<tr>
<td><code>/mnt</code></td>
<td><code>/dev/root_partition</code></td>
<td>Linux x86 Root (/)</td>
<td>10GB</td>
</tr>
</tbody>
</table>
<p>Use the arrow keys and  enter  to create 3 partitions with  <code>cfdisk</code>:</p>
<ul>
<li>/dev/sda1 # choose 512Mb of space (UEFI)</li>
<li>/dev/sda2 # choose at least 10 GB of space (root)</li>
<li>/dev/sda3 # choose all the left space (home)</li>
</ul>
<p>Write the table to your hard drive and quit.</p>
<p><strong>Steps to follow for BIOS with MBR:</strong>
<em>Example layouts for 20 GB Disk Size.</em></p>
<table>
<thead>
<tr>
<th>Mount Point</th>
<th>Partition</th>
<th>Partition Type</th>
<th>Suggested Size</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>[SWAP]</code></td>
<td><code>/dev/swap_partition</code></td>
<td>Linux Swap</td>
<td>10GB</td>
</tr>
<tr>
<td><code>/mnt</code></td>
<td><code>/dev/root_partition</code></td>
<td>Linux x86 Root (/)</td>
<td>10GB</td>
</tr>
</tbody>
</table>
<p><em>If you do the legacy installation, skip the step of UEFI formatting because you should not have the UEFI partition.</em>
Use the arrow keys and  enter  to create 2 partitions with  <code>cfdisk</code>:</p>
<ul>
<li>/dev/sda1 # choose at least 10 GB of space (root)</li>
<li>/dev/sda2 # choose all the left space (home)</li>
</ul>
<p>Write the table to your hard drive and quit.</p>
<p><strong>Mount the partitions:</strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#For UEFI partition:</span>
</span></span><span class="line"><span class="cl">mkfs.fat -F32 /dev/sda1
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#For non-UEFI partitions:</span>
</span></span><span class="line"><span class="cl">mkfs.ext4 /dev/sda2
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#For Swap partition</span>
</span></span><span class="line"><span class="cl">mkswap /dev/sda3
</span></span></code></pre></div><p><img loading="lazy" src="mkfs.png" alt="mkfs"  />
</p>
<ol start="9">
<li>Mount the filesystems:</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#Mount the root volume to  `/mnt`:</span>
</span></span><span class="line"><span class="cl">mount /dev/sda2 /mnt
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#For UEFI systems, create new dir /mnt/boot and mount the EFI system partition:</span>
</span></span><span class="line"><span class="cl">mount --mkdir /dev/sda1 /mnt/boot
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#For Swap volume,</span>
</span></span><span class="line"><span class="cl">swapon /dev/sda3 
</span></span></code></pre></div><p><img loading="lazy" src="mnt.png" alt="mount"  />
</p>
<ol start="10">
<li>Configuring Reflectors</li>
</ol>
<p>Packages to be installed must be downloaded from <a href="https://wiki.archlinux.org/title/Mirrors" title="Mirrors">mirror servers</a>, which are defined in <code>/etc/pacman.d/mirrorlist</code>. On the live system, after connecting to the internet, <a href="https://wiki.archlinux.org/title/Reflector" title="Reflector">reflector</a> updates the mirror list by choosing 20 most recently synchronized HTTPS mirrors and sorting them by download rate. The top mirror is chosen automatically and it may not always be a good choice. Let&rsquo;s update to ensure we have good mirror list available.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Install reflector to update the list of fastest mirrors located in your country:</span>
</span></span><span class="line"><span class="cl">pacman -Sy reflector
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Make a backup of mirror list (just in case):</span>
</span></span><span class="line"><span class="cl">cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Get the mirror list and save it</span>
</span></span><span class="line"><span class="cl">reflector -c <span class="s2">&#34;India&#34;</span> -f <span class="m">12</span> -l <span class="m">10</span> -n <span class="m">12</span> --save /etc/pacman.d/mirrorlist
</span></span></code></pre></div><p><img loading="lazy" src="reflector.png" alt="reflector"  />
</p>
<p>Woohoo! We&rsquo;re done with all the pre-installation steps :)</p>
<h2 id="installation-steps">Installation Steps</h2>
<p>Using the <a href="https://man.archlinux.org/man/pacstrap.8">pacstrap</a> script we&rsquo;ll install the <a href="https://archlinux.org/packages/?name=base">base</a> package, Linux <a href="https://wiki.archlinux.org/title/Kernel" title="Kernel">kernel</a> and firmware for common hardware.
I&rsquo;m also adding <code>nano</code> editor (you can use vim or anyother editor) and <code>sudo</code> (short for super user do)</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pacstrap -i /mnt base linux linux-firmware sudo nano
</span></span></code></pre></div><p>Let&rsquo;s move to configuring the system!</p>
<h2 id="configure-the-system">Configure the system</h2>
<ol>
<li>Generate the fstab  file</li>
</ol>
<p>The <a href="https://man.archlinux.org/man/fstab.5">fstab</a> file can be used to define how disk partitions, various other block devices, or remote file systems should be mounted into the file system.  You can type <code>genfstab -help</code> to see the options available and it&rsquo;s description.</p>
<p>One can use <code>genfstab</code> to generate fstab entries for mounted partitions given a filesystem root. This can be useful when installing and that&rsquo;s what we&rsquo;ll do.</p>
<p>There are different ways to identify file systems that will be mounted in <code>/etc/fstab</code>: kernel name descriptor, file system label and UUID, and GPT partition label and UUID for GPT disks. Kernel name descriptors should not be used, while UUIDs or PARTUUIDs should be preferred over labels because:</p>
<ul>
<li>Labels have to be unambiguous to prevent any possible conflicts.</li>
<li>Labels can be up to 16 characters long.</li>
<li>Since the label is a property of the filesystem, it is not suitable for addressing a single RAID device persistently.</li>
</ul>
<p>Thus, we&rsquo;ll generate an fstab file using UUIDs as identifiers.  We&rsquo;ll use <code>-U</code> which specifies that you want to generate the output based on a volume UUID.<br>
So <code>genfstab -U /mnt</code> will output all current mounts under the <code>/mnt</code> mount point. We can save that output to the <code>/mnt/etc/fstab</code> file using the <code>&gt;&gt;</code> operator.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">genfstab -U /mnt &gt;&gt; /mnt/etc/fstab
</span></span></code></pre></div><ol start="2">
<li><code>chroot</code> (change root) to the installed system
Changing root is commonly done for performing system maintenance on systems where booting and/or logging in is no longer possible. Common examples are:</li>
</ol>
<ul>
<li>Reinstalling the  <a href="https://wiki.archlinux.org/title/Boot_loader" title="Boot loader">boot loader</a>.</li>
<li>Rebuilding the  <a href="https://wiki.archlinux.org/title/Mkinitcpio" title="Mkinitcpio">initramfs image</a>.</li>
<li>Upgrading or  <a href="https://wiki.archlinux.org/title/Downgrading_packages" title="Downgrading packages">downgrading packages</a>.</li>
<li>Resetting a  <a href="https://wiki.archlinux.org/title/Password_recovery" title="Password recovery">forgotten password</a>.</li>
<li>Building packages in a  <a href="https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot" title="DeveloperWiki:Building in a clean chroot">clean chroot</a>.</li>
</ul>
<p>Now using <a href="https://wiki.archlinux.org/index.php/Chroot?ref=itsfoss.com#Using_arch-chroot">arch-chroot</a> we&rsquo;ll enter the mounted disk as root.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># arch-chroot /mnt</span>
</span></span></code></pre></div><ol start="3">
<li>Set locale
To set the localization, you will have to work in <code>nano</code> editor.<br>
Run command to open file in the editor:</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">nano /etc/locale.gen
</span></span></code></pre></div><p>In the file find the language you are going to use and uncomment it by removing <code>#</code>. In my case, I am going to install English (en_US.UTF-8 UTF-8).</p>
<p>You can either manually do it or activate the search option using the shortcut <strong>Ctrl + W</strong>. Press <strong>Ctrl+O</strong>  Enter to save and <strong>Ctrl+X</strong>  Enter to exit the editor.</p>
<p>Run command to generate the locale:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">locale-gen
</span></span></code></pre></div><p><img loading="lazy" src="utf8.png" alt="utf8"  />
</p>
<p>Finally, Create the <a href="https://man.archlinux.org/man/locale.conf.5">locale.conf</a> file, and <a href="https://wiki.archlinux.org/title/Locale#Setting_the_system_locale" title="Locale">set the LANG variable</a> accordingly:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;LANG=en_US.UTF-8&#34;</span> &gt; /etc/locale.conf
</span></span></code></pre></div><p><img loading="lazy" src="locale.png" alt="locale"  />
</p>
<ol start="4">
<li>Set the  time zone by creating a symbolic link
A symbolic link, also known as a symlink or soft link, is a special type of file that points to another file or directory. Symbolic links are commonly used to create shortcuts or aliases for files or directories located in the file system.</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Run command to get details about all the zones:</span>
</span></span><span class="line"><span class="cl">ls /usr/share/zoneinfo/
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Run command to create the link:</span>
</span></span><span class="line"><span class="cl"> ln -sf /usr/share/zoneinfo/Asia/Calcutta/etc/localtime
</span></span><span class="line"><span class="cl"> 
</span></span><span class="line"><span class="cl"><span class="c1"># Run hwclock to set the local time on the system:</span>
</span></span><span class="line"><span class="cl">hwclock --systohc --utc
</span></span></code></pre></div><p><img loading="lazy" src="info.png" alt="time"  />

<img loading="lazy" src="time.png" alt="time"  />
</p>
<ol start="5">
<li>Set hostname</li>
</ol>
<p>Hostname is basically the name of your computer on the network. I&rsquo;m name it  <code>arch</code> but you can choose whatever you want. Use the following command:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> arch &gt; /etc/hostname
</span></span></code></pre></div><p>Local host name resolution is provided by  <code>nss-myhostname</code>  (an NSS module provided by systemd) without having to edit  <code>/etc/hosts</code>  file. It is enabled by default.</p>
<p>But some software may still read the  <code>/etc/hosts</code>  file directly. So let&rsquo;s edit <code>/etc/hosts</code> file in nano and add the following lines to it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">nano /etc/hosts
</span></span></code></pre></div><p>Add these lines at the end of the file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">127.0.0.1        localhost
</span></span><span class="line"><span class="cl">::1              localhost
</span></span><span class="line"><span class="cl">127.0.1.1        arch
</span></span></code></pre></div><p>If you use a static IP address, replace  <code>127.0.1.1</code>  with your static IP address given by the Internet provider. Press  <strong>Ctrl+O</strong>  Enter  and  <strong>Ctrl+X</strong>  Enter  to save and exit the editor.</p>
<ol start="6">
<li>Configure the network
We&rsquo;ll use <code>NetworkManager</code> package:
<code>NetworkManager</code> is a network management tool that provides easy automatic connection to the Internet. NetworkManager manages your network interfaces, detects available connections and automatically connects network devices when connections for the device become available. In practice, NM provides “set it and forget it” functionality—after connecting to a network on a given network interface, NM remembers the connection and will automatically connect you in the future (unless you disable automatic connection, of course). The <code>networkmanager</code> package contains a few things: the <code>NetworkManager</code> daemon itself, the <code>nmcli</code> command line interface, and the <code>nmtui</code> and a text user interface.
To install the package, we&rsquo;ll use the package manager <code>pacman</code>:</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pacman -S networkmanager
</span></span></code></pre></div><p>Since Automatic network configuration is accomplished using <a href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" title="wikipedia:Dynamic Host Configuration Protocol">Dynamic Host Configuration Protocol</a> (DHCP). The network&rsquo;s DHCP server provides IP address(es), the default gateway IP address(es) and optionally also DNS name servers upon request from the DHCP client. We&rsquo;ll use  <code>systemd-resolved</code>  for DNS resolution which NetworkManager can then use for <a href="https://en.wikipedia.org/wiki/Domain_Name_System">DNS</a> resolution, i.e. converting human-readable domain names into computer-friendly IP addresses.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Check service status</span>
</span></span><span class="line"><span class="cl">systemctl status systemd-resolved.service
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># If the service is not active and running, enable and start it</span>
</span></span><span class="line"><span class="cl">systemctl <span class="nb">enable</span> --now systemd-resolved.service
</span></span></code></pre></div><ul>
<li>For wired internet connection,
Enable NM using :</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">systemctl <span class="nb">enable</span> NetworkManager
</span></span></code></pre></div><p><img loading="lazy" src="nm.png" alt="nm"  />
</p>
<ul>
<li>For WiFi connection:
First enable Wi-Fi and list available wireless networks:</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Ensure Wi-Fi is enabled</span>
</span></span><span class="line"><span class="cl">nmcli radio wifi
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">Output:
</span></span><span class="line"><span class="cl">nmcli radio wifi on
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># List available Wi-Fi networks</span>
</span></span><span class="line"><span class="cl"> nmcli device wifi list
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">Output:
</span></span><span class="line"><span class="cl">BSSID              SSID            MODE   CHAN  RATE        SIGNAL  BARS  SECURITY
</span></span><span class="line"><span class="cl">AA:11:BB:22:CC:33  MyCoolNetwork   Infra  <span class="m">6</span>     <span class="m">230</span> Mbit/s  <span class="m">95</span>      ▂▄▆_  WPA2
</span></span><span class="line"><span class="cl">DD:44:EE:55:FF:66  AnotherNetork   Infra  <span class="m">6</span>     <span class="m">195</span> Mbit/s  <span class="m">90</span>      ▂▄▆_  WPA1 WPA2
</span></span><span class="line"><span class="cl">GG:77:HH:88:II:99  FooBarNetwork   Infra  <span class="m">6</span>     <span class="m">175</span> Mbit/s  <span class="m">85</span>      ▂▄▆_  --
</span></span></code></pre></div><p>Identify your desired network’s SSID, and connect as follows:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Specify network SSID and password (for secured networks)</span>
</span></span><span class="line"><span class="cl">nmcli device wifi connect <span class="o">{</span>SSID<span class="o">}</span> password <span class="o">[</span>password<span class="o">]</span>
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">Output:
</span></span><span class="line"><span class="cl"><span class="c1">#Secured Network</span>
</span></span><span class="line"><span class="cl">nmcli device wifi connect <span class="s1">&#39;MyCoolNetwork&#39;</span> password <span class="s1">&#39;my_secure_password&#39;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Unsecured networks don&#39;t need a password</span>
</span></span><span class="line"><span class="cl">nmcli device wifi connect <span class="s1">&#39;FooBarNetwork&#39;</span>
</span></span></code></pre></div><ol start="7">
<li>Set the password for root user
The <code>passwd</code> command lets you change the password for a user. By default it affects the current user&rsquo;s password which is the <code>root</code> right now.</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">passwd
</span></span></code></pre></div><p>You&rsquo;ll have to type the password twice. It will not show when you&rsquo;re typing, not even as *****</p>
<ol start="8">
<li>Add a non-root user:
Using your Linux system as the root user for long is not a good idea so creating a non-root user is important. To create a new user, execute the following command:</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">useradd -m -G wheel bhavs
</span></span></code></pre></div><p>The  <code>useradd</code>  command lets you create a new user.
<code>-m</code>  option indicates that you also want it to create the corresponding home directory. The  <code>-G</code>  option will add the new user to the  <code>wheel</code>  group which is the administration user group in Arch Linux.
<img loading="lazy" src="useradd.png" alt="user add"  />
</p>
<p>Now you can use the  <code>passwd</code>  command once again to set the password for the newly created user:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">passwd bhavs
</span></span></code></pre></div><p>Finally, you&rsquo;ll have to enable  <code>sudo</code>  privilege for this new user. To do so, open the  <code>/etc/sudoers</code>  file using nano. Once open, locate the following line and uncomment it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># %wheel ALL=(ALL) ALL</span>
</span></span></code></pre></div><p>This file essentially means that all users in the  <code>wheel</code>  group can use  <code>sudo</code>  by providing their password. Save the file by hitting <strong>Ctrl + O</strong> and exit nano by hitting <strong>Ctrl + X</strong>. Now the new user will be able to use  <code>sudo</code>  when necessary.
<img loading="lazy" src="wheel.png" alt="wheel"  />
</p>
<ol start="9">
<li>Installing the microcode:
Processor manufacturers release stability and security updates to the processor  <a href="https://en.wikipedia.org/wiki/Microcode" title="wikipedia:Microcode">microcode</a>. These updates provide bug fixes that can be critical to the stability of your system. Without them, you may experience spurious crashes or unexpected system halts that can be difficult to track down.</li>
</ol>
<p><em>PS- In virtual machines and containers, the microcode updates belongs on the host, not in the guest system.</em></p>
<p>To acquire updated microcode, depending on the processor,  <a href="https://wiki.archlinux.org/title/Install" title="Install">install</a>  one of the following packages:</p>
<ul>
<li><a href="https://archlinux.org/packages/?name=amd-ucode">amd-ucode</a>  for AMD processors,</li>
<li><a href="https://archlinux.org/packages/?name=intel-ucode">intel-ucode</a>  for Intel processors</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># for amd processors</span>
</span></span><span class="line"><span class="cl">pacman -S amd-ucode
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># for intel processors</span>
</span></span><span class="line"><span class="cl">pacman -S intel-ucode
</span></span></code></pre></div><ol start="9">
<li>Install and configure the bootloader:</li>
</ol>
<p>A boot loader is a piece of software started by the firmware (<a href="https://en.wikipedia.org/wiki/BIOS" title="wikipedia:BIOS">BIOS</a> or <a href="https://wiki.archlinux.org/title/UEFI" title="UEFI">UEFI</a>). It is responsible for loading the kernel with the wanted <a href="https://wiki.archlinux.org/title/Kernel_parameters" title="Kernel parameters">kernel parameters</a> and any external initramfs images.
There are several bootloaders you can install on Arch Linux. I recommend the GRUB bootloader which is built-in and supports both UEFI and BIOS. It is the most popular, highly configurable and easy to use bootloader.</p>
<ul>
<li>For UEFI:</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#Install the GRUB bootloader and EFI boot manager packages:</span>
</span></span><span class="line"><span class="cl">pacman -Sy grub efibootmgr
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#  The mkdir command creates a directory called `efi` inside the `/boot` directory. After creating the directory, we&#39;ll  mount the EFI system partition in that directory:</span>
</span></span><span class="line"><span class="cl">mount --mkdir /dev/sda1 /boot/efi
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Check if everything is mounted correctly:</span>
</span></span><span class="line"><span class="cl">lsblk 
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Install GRUB in the newly mounted EFI system partition:</span>
</span></span><span class="line"><span class="cl">grub-install --target<span class="o">=</span>x86_64-efi --bootloader-id<span class="o">=</span>GRUB --efi-directory<span class="o">=</span>/boot/efi --removable
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#The grub-mkconfig command generates the GRUB configuration file and saves it to a given target location- /boot/grub/grub.cfg</span>
</span></span><span class="line"><span class="cl">grub-mkconfig -o /boot/grub/grub.cfg
</span></span></code></pre></div><p><img loading="lazy" src="grub.png" alt="grub"  />
</p>
<ul>
<li>For BIOS:</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#Install GRUB:</span>
</span></span><span class="line"><span class="cl">grub-install /dev/sda
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#The grub-mkconfig command generates the GRUB configuration file and saves it to a given target location- /boot/grub/grub.cfg</span>
</span></span><span class="line"><span class="cl">grub-mkconfig -o /boot/grub/grub.cfg
</span></span></code></pre></div><ol start="10">
<li>Install Desktop Environment:</li>
</ol>
<p>To run programs with graphical user interfaces on your system, you&rsquo;ll have to install an X Window System implementation and Audio. The most common one is <code>xorg</code>.  I&rsquo;ve also added <code>virtualbox-guest-utils</code> since I&rsquo;m setting up Arch on a VM.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pacman -Sy pulseaudio pulseaudio-alsa xorg xorg-xinit xorg-server virtualbox-guest-utils
</span></span></code></pre></div><p>Now that you&rsquo;ve installed Xorg, you&rsquo;re ready to install a desktop environment. Arch Linux supports a long list of desktop environments like GNOME, Plasma, XFCE etc. I&rsquo;m installing GNOME in this guide.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Install GNOME package</span>
</span></span><span class="line"><span class="cl">pacman -Sy gnome
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Enable the GDM or Gnome Display Manager service</span>
</span></span><span class="line"><span class="cl">systemctl <span class="nb">enable</span> gdm
</span></span></code></pre></div><p><img loading="lazy" src="gdm.png" alt="gdm"  />
</p>
<ol start="12">
<li>Final Step: Reboot</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#First come out of the Arch-Chroot environment:</span>
</span></span><span class="line"><span class="cl"><span class="nb">exit</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Unmount the root partition to make sure there are no pending operations:</span>
</span></span><span class="line"><span class="cl">umount -R /mnt
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#Reboot the machine:</span>
</span></span><span class="line"><span class="cl">reboot
</span></span></code></pre></div><p>Wait until you see the GRUB menu.
Choose Arch Linux from the list and wait until the system finishes booting up.
<img loading="lazy" src="startup.png" alt="gg"  />
</p>
<p><strong>Arch Linux (Minimal) Installation is done! Congratulations!!</strong>
Reminder- This is a very minimal installation. From this point, you can install what you want and configure your Arch Linux as you want.
If you have any queries, check out the <a href="https://bbs.archlinux.org/">Arch Linux forums</a>.</p>
<h2 id="refrences">Refrences:</h2>
<ul>
<li><a href="https://wiki.archlinux.org/title/Installation_guide#Installation">https://wiki.archlinux.org/title/Installation_guide#Installation</a></li>
<li><a href="https://www.freecodecamp.org/news/how-to-install-arch-linux/">https://www.freecodecamp.org/news/how-to-install-arch-linux/</a></li>
<li><a href="https://averagelinuxuser.com/a-step-by-step-arch-linux-installation-guide/#download-arch-linux-iso">https://averagelinuxuser.com/a-step-by-step-arch-linux-installation-guide/#download-arch-linux-iso</a></li>
<li>Arch Linux Wiki and Forums</li>
</ul>
]]></content:encoded>
    </item>
  </channel>
</rss>
