<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Jonathan Aseh </title>
    <description>The latest articles on Forem by Jonathan Aseh  (@jonathan_aseh).</description>
    <link>https://forem.com/jonathan_aseh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2038622%2F2eb17768-badb-47ae-8705-b2b77a6a900a.png</url>
      <title>Forem: Jonathan Aseh </title>
      <link>https://forem.com/jonathan_aseh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jonathan_aseh"/>
    <language>en</language>
    <item>
      <title>Implement Load Balancing on Compute Engine in GCP</title>
      <dc:creator>Jonathan Aseh </dc:creator>
      <pubDate>Mon, 23 Sep 2024 07:19:36 +0000</pubDate>
      <link>https://forem.com/jonathan_aseh/implement-load-balancing-on-compute-engine-4pfi</link>
      <guid>https://forem.com/jonathan_aseh/implement-load-balancing-on-compute-engine-4pfi</guid>
      <description>&lt;p&gt;Task 1. Configure the region and Zone:&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;gcloud config set compute/region us-east1 gcloud config set compute/zone us-east1-d&lt;/p&gt;

&lt;p&gt;Task 2. Create the instance:&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;gcloud compute instances create nucleus-jumphost-397 \ --zone=us-east1-d \ --machine-type=e2-micro \ --image-family=debian-11 \ --image-project=debian-cloud \ --tags=nucleus-network&lt;/p&gt;

&lt;p&gt;Task 3. Configure the web servers using nginx&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;cat &amp;lt;&amp;lt; EOF &amp;gt; startup.sh #! /bin/bash apt-get update apt-get install -y nginx service nginx start sed -i -- 's/nginx/Google Cloud Platform - '"\$HOSTNAME"'/' /var/www/html/index.nginx-debian.html EOF&lt;/p&gt;

&lt;p&gt;Task 4. Create an instance template.&lt;/p&gt;

&lt;p&gt;Mermaid&lt;/p&gt;

&lt;p&gt;Code&lt;/p&gt;

&lt;p&gt;gcloud compute instance-templates create nucleus-server-template \  --region=us-east1 \     --machine-type=e2-medium \  --image-family=debian-11 \  --image-project=debian-cloud \  --tags=nucleus-network \    --metadata-from-file startup-scri&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--metadata-from-file startup-script=startup.sh 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Task 5. Create a managed instance group based on the template.&lt;/p&gt;

&lt;p&gt;gcloud compute instance-groups managed create nucleus-webserver-group \    --template=nucleus-server-template \   --size=2 \     --base-instance-name=nucleus-webserver \   --zone=us-east1-d &lt;/p&gt;

&lt;p&gt;Task 6. Create a firewall rule.&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;gcloud compute firewall-rules create accept-tcp-rule-843 --allow tcp:80 --target-tags=nucleus-network&lt;/p&gt;

&lt;p&gt;Task 7. Create a health check.&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;gcloud compute http-health-checks create http-basic-check --port 80&lt;/p&gt;

&lt;p&gt;Task 8. Create a backend service and add your instance group as the backend to the backend service group with named port (http:80)&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;gcloud compute backend-services create web-backend-service --protocol=HTTP --port-name=http --health-checks=http-basic-check --global   &lt;/p&gt;

&lt;p&gt;Task 8.b. Add your instance group as the backend to the backend service group with named port (http:80)&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;gcloud compute backend-services add-backend web-backend-service --instance-group=nucleus-webserver-group --instance-group-zone=us-east1-d --global (This corrects the ports fail error) gcloud compute instance-groups managed set-named-ports nucleus-webserver-group --named-ports http:80 --zone=us-east1-d&lt;/p&gt;

&lt;p&gt;Task 9.b Target the HTTP proxy to route the incoming requests to the default backend service.&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;gcloud compute target-http-proxies create web-http-proxy --url-map=web-url-map&lt;/p&gt;

&lt;p&gt;Task 10. Create a forwarding rule.&lt;/p&gt;

&lt;p&gt;Visual Basic&lt;/p&gt;

&lt;p&gt;gcloud compute forwarding-rules create http-content-rule --target-http-proxy=web-http-proxy --ports=80 --global&lt;/p&gt;

&lt;p&gt;Note: Wait for 5 to 7 minutes, then check the external IP to see the congratulatory NGINX Server display.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Securing a Virtual Machine Using BeyondCorp Enterprise (BCE)</title>
      <dc:creator>Jonathan Aseh </dc:creator>
      <pubDate>Mon, 16 Sep 2024 20:00:35 +0000</pubDate>
      <link>https://forem.com/jonathan_aseh/securing-a-virtual-machine-using-beyondcorp-enterprise-bce-4hof</link>
      <guid>https://forem.com/jonathan_aseh/securing-a-virtual-machine-using-beyondcorp-enterprise-bce-4hof</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Understand the BeyondCorp Enterprise Model&lt;br&gt;
   &lt;br&gt;
-Zero Trust: BCE operates under a zero-trust security model, meaning no one is automatically trusted—internal or external to your network.&lt;br&gt;
-Secure Access: It secures applications,devices, and networks by verifying user identity, device health, and context before access is granted.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set Up BeyondCorp Enterprise &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;-Google Cloud Console: To use BCE,you need a Google Cloud account. Begin by logging into the Google Cloud Console at &lt;a href="https://console.cloud.google.com" rel="noopener noreferrer"&gt;console.cloud.google.com&lt;/a&gt;.&lt;br&gt;
  - Navigate to the APIs &amp;amp; Services section and enable the API to integrate it into your security strategy.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Configure a Virtual Machine (VM) in Google Cloud&lt;br&gt;
   &lt;br&gt;
 - Create a VM&lt;br&gt;
 - Go to the Compute Engine section and select &amp;gt;Create Instance. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose your preferred machine configuration (OS, size, region)
 - Ensure proper firewall rules are configured during VM setup, restricting unnecessary traffic.&lt;/li&gt;
&lt;li&gt;SSH Access: Enable SSH access for your VM. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set Up Identity-Aware Proxy (IAP) for VM Access&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;-Enable IAP &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to &amp;gt; Identity-Aware Proxy under Security in the Google Cloud Console.&lt;/li&gt;
&lt;li&gt;Enable IAP for your project&lt;/li&gt;
&lt;li&gt;Configure VM access via IAP**: &lt;/li&gt;
&lt;li&gt;In the IAP settings, select the VM instances you want to protect.&lt;/li&gt;
&lt;li&gt;Set up access control policies to manage who can SSH into the virtual machines, verifying identity and device compliance before allowing entry. &lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Implement Context-Aware Access
   &lt;/li&gt;
&lt;li&gt;Define Access Levels 

&lt;ul&gt;
&lt;li&gt;Set access levels based on device compliance, user identity, location, and other risk factors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In Access Context Manager create access levels with specific conditions, such as device encryption or specific IP ranges.&lt;/li&gt;
&lt;li&gt;Apply Access Policies &lt;/li&gt;
&lt;li&gt;&lt;p&gt;Attach these access levels to your VM’s resources, ensuring that only authorized and compliant users can access the machine. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Monitor and Enforce Security Policies&lt;br&gt;
   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-Time Monitoring Use the Security Command Center to monitor VM access in real-time, identifying suspicious activities or failed access attempts&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Audit Logs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable audit logging for both the VM and BCE. This will track access attempts and flag any unauthorized access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logs can be viewed in Cloud Logging. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Congratulations &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Title: How I Configured IAM in Google Cloud Step by Step.</title>
      <dc:creator>Jonathan Aseh </dc:creator>
      <pubDate>Tue, 10 Sep 2024 11:23:24 +0000</pubDate>
      <link>https://forem.com/jonathan_aseh/title-how-i-configured-iam-in-google-cloud-step-by-step-g5p</link>
      <guid>https://forem.com/jonathan_aseh/title-how-i-configured-iam-in-google-cloud-step-by-step-g5p</guid>
      <description>&lt;p&gt;In this guide,I'll walk you through how I successfully configured Identity and Access Management (IAM) on Google Cloud. IAM allows you to manage access to resources securely by defining who has access and what they can do with those resources.&lt;/p&gt;

&lt;p&gt;Step 1:Accessing IAM on Google Cloud.&lt;/p&gt;

&lt;p&gt;1.Log in to the &lt;a href="https://console.cloud.google.com/" rel="noopener noreferrer"&gt;Google Cloud Console&lt;/a&gt;&lt;br&gt;
2.Navigate to the Navigation Menu(hamburger icon in the upper-left corner)&lt;/p&gt;

&lt;p&gt;3.Select IAM &amp;amp; Admin &amp;gt;IAM&lt;br&gt;
Here, you’ll see a list of all members with access to the project and their assigned roles.&lt;/p&gt;

&lt;p&gt;Step 2:Adding a New User or Service Account&lt;/p&gt;

&lt;p&gt;1.In the IAM dashboard,click Add&lt;/p&gt;

&lt;p&gt;2.In the New principals field, input the email addresses of users,groups,or service accounts to whom you want to grant access.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Under the Role dropdown menu, select the appropriate role. Predefined roles such as &lt;code&gt;Viewer&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt;, or &lt;code&gt;Owner&lt;/code&gt; offer varying degrees of permissions. If you're configuring for specific tasks, select a more granular predefined role like &lt;code&gt;roles/storage.admin&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;4.Click Save. &lt;br&gt;
This process adds a new user with the defined role and permissions for your project.&lt;/p&gt;

&lt;p&gt;Step 3:Assigning Roles to Existing Users.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find the user in the IAM dashboard.&lt;/li&gt;
&lt;li&gt;Click the &amp;gt;Edit&amp;lt; icon next to their name.&lt;/li&gt;
&lt;li&gt;Adjust their role by selecting a new one from the dropdown menu.&lt;/li&gt;
&lt;li&gt;Click Save. 
Ensure the roles you assign follow the principle of least privilege—only give users the permissions they absolutely need&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 4:Creating Custom Roles for Specific Permissions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to IAM &amp;amp; Admin &amp;gt; Roles.&lt;/li&gt;
&lt;li&gt;Click Create Role.&lt;/li&gt;
&lt;li&gt;Provide a name,description, and choose the role’s launch stage (Beta, General Availability, etc.).&lt;/li&gt;
&lt;li&gt;Add permissions to the role by selecting specific services (e.g, storage.buckets.create` for managing Cloud Storage).&lt;/li&gt;
&lt;li&gt;Save the custom role and apply it to users as needed. 
This allows for more fine-grained control over user permissions for specific tasks or resources.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 5:Setting IAM Policies at Different Resource Levels.&lt;br&gt;
1.For resource-level permissions (e.g., Cloud Storage or Compute Engine):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the resource.&lt;/li&gt;
&lt;li&gt;Go to the **Permissions or IAM section.
 - Add users or modify their permissions specific to that resource. 
For example,you might assign roles/storage.objectAdmin` to a user for a specific Cloud Storage bucket,giving them control over the objects within it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 6:Auditing and Managing Permissions.&lt;br&gt;
1.Use IAM Recommender to get insights on permissions that are overly permissive and tighten them.&lt;br&gt;
2.Check Cloud Audit Logs to monitor changes in IAM configurations.&lt;br&gt;
3.Use the Policy Troubleshooter if any access issues arise. &lt;br&gt;
These tools help maintain the principle of least privilege and ensure your cloud environment is secure.&lt;/p&gt;

&lt;p&gt;Step 7:Using the Command Line Interface (CLI) for IAM Configuration&lt;/p&gt;

&lt;p&gt;For those who prefer working with the CLI, Google Cloud’s &lt;code&gt;gcloud&lt;/code&gt; command-line tool offers robust IAM management: &lt;/p&gt;

&lt;p&gt;-Grant a role to a user:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;   &lt;code&gt;bash&lt;br&gt;
   gcloud projects add-iam-policy-binding [PROJECT_ID] \&lt;br&gt;
       --member="user:[USER_EMAIL]" \&lt;br&gt;
       --role="roles/[ROLE]"&lt;br&gt;
  &lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;-View the current IAM policy for a project:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;   &lt;code&gt;bash&lt;br&gt;
   gcloud projects get-iam-policy [PROJECT_ID]&lt;br&gt;
  &lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;-Remove a role from a user:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;   &lt;code&gt;bash&lt;br&gt;
   gcloud projects remove-iam-policy-binding [PROJECT_ID] \&lt;br&gt;
       --member="user:[USER_EMAIL]" \&lt;br&gt;
       --role="roles/[ROLE]"&lt;br&gt;
  &lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Using the CLI allows you to automate IAM tasks and manage policies more efficiently.&lt;/p&gt;

&lt;p&gt;Let me know if you have questions feedbacks on this guild, happy configuring!&lt;/p&gt;

</description>
      <category>gcp</category>
    </item>
  </channel>
</rss>
