<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<title>My Blog</title>
	<subtitle>My blog site.</subtitle>
	<link rel="self" type="application/atom+xml" href="https://blog.daulthings.site/posts/feed.xml"/>
  <link rel="alternate" type="text/html" href="https://blog.daulthings.site/posts/"/>
  
	<updated>2026-11-24T00:00:00+00:00</updated>
	
	<id>https://blog.daulthings.site/posts/feed.xml</id>
	<entry xml:lang="en">
		<title>Building a Zero-SSH DevSecOps Pipeline on AWS Free Tier</title>
		<published>2026-11-24T00:00:00+00:00</published>
		<updated>2026-11-24T00:00:00+00:00</updated>
		<link rel="alternate" type="text/html" href="https://blog.daulthings.site/posts/zero-ssh-devsecops-pipeline-aws/"/>
		<id>https://blog.daulthings.site/posts/zero-ssh-devsecops-pipeline-aws/</id>
    
		<content type="html" xml:base="https://blog.daulthings.site/posts/zero-ssh-devsecops-pipeline-aws/">&lt;p&gt;For the second project of my internship at &lt;strong&gt;PT Darmawan Aryansyah Teknologi (DAT)&lt;/strong&gt;, I worked across the DevOps and IT Security divisions to design and implement a complete infrastructure and CI/CD pipeline for a multi-service demo application (frontend, backend, background worker, PostgreSQL, and Redis).&lt;/p&gt;
&lt;p&gt;Because interns understandably don&#39;t get direct access to company production infrastructure, the entire stack was built on a personal AWS Free Tier account—with strict security and cost constraints from my mentors: no SSH ports open, no static AWS access keys in CI, automated quality and vulnerability gates before deployment, and proper observability.&lt;/p&gt;
&lt;h2 id=&quot;infrastructure-topology-cost-constraints&quot;&gt;Infrastructure Topology &amp;amp; Cost Constraints&lt;a class=&quot;zola-anchor&quot; href=&quot;#infrastructure-topology-cost-constraints&quot; aria-label=&quot;Anchor link for: infrastructure-topology-cost-constraints&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Using &lt;strong&gt;Terraform&lt;/strong&gt; (split into a &lt;code&gt;bootstrap&lt;/code&gt; layer for remote S3 state and a &lt;code&gt;main&lt;/code&gt; layer for networking, IAM, and compute), I provisioned a single VPC in &lt;code&gt;ap-southeast-3a&lt;/code&gt; (Jakarta) with three role-separated EC2 instances:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Application server (&lt;code&gt;t4g.small&lt;/code&gt;, ARM64)&lt;/strong&gt;: Runs Nginx as a reverse proxy, the frontend, backend, worker, PostgreSQL, Redis, &lt;code&gt;node-exporter&lt;/code&gt;, and &lt;code&gt;cAdvisor&lt;/code&gt;. Only HTTP/HTTPS ports are exposed to the public.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitoring server (&lt;code&gt;t4g.small&lt;/code&gt;, ARM64)&lt;/strong&gt;: Runs Prometheus, Grafana, and Alertmanager with &lt;strong&gt;zero public ingress rules&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code quality server (&lt;code&gt;c7i-flex.large&lt;/code&gt;, x86-64)&lt;/strong&gt;: Runs SonarQube and its companion PostgreSQL database, also with &lt;strong&gt;zero public ingress rules&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Choosing ARM64 (&lt;code&gt;t4g.small&lt;/code&gt;) instances, a single availability zone, and skipping a NAT Gateway kept the setup within Free Tier limits. It&#39;s a conscious trade-off—single-AZ means no multi-zone redundancy—and one we documented explicitly as a budget constraint rather than a production recommendation.&lt;/p&gt;
&lt;h2 id=&quot;zero-ssh-secretless-access&quot;&gt;Zero-SSH &amp;amp; Secretless Access&lt;a class=&quot;zola-anchor&quot; href=&quot;#zero-ssh-secretless-access&quot; aria-label=&quot;Anchor link for: zero-ssh-secretless-access&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;One of the core security requirements was eliminating traditional SSH and long-lived credentials:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No SSH&lt;/strong&gt;: Port 22 is closed on every instance. &lt;strong&gt;Ansible&lt;/strong&gt; connects using the &lt;code&gt;amazon.aws.aws_ec2&lt;/code&gt; dynamic inventory plugin over &lt;strong&gt;AWS Systems Manager (SSM) Session Manager&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Private operator access&lt;/strong&gt;: Grafana and SonarQube have no public ingress; operators reach them through a private &lt;strong&gt;Tailscale&lt;/strong&gt; network.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No static AWS keys in CI&lt;/strong&gt;: GitHub Actions authenticates to AWS using &lt;strong&gt;OpenID Connect (OIDC)&lt;/strong&gt;, assuming scoped IAM roles per workflow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Server configuration is organized into five idempotent Ansible roles (&lt;code&gt;docker_engine&lt;/code&gt;, &lt;code&gt;notes_app&lt;/code&gt;, &lt;code&gt;notes_monitoring&lt;/code&gt;, &lt;code&gt;notes_sonarqube&lt;/code&gt;, and &lt;code&gt;tailscale&lt;/code&gt;), using &lt;code&gt;docker compose up -d --wait&lt;/code&gt; so Ansible waits for database and service health checks before moving on.&lt;/p&gt;
&lt;h2 id=&quot;three-stage-ci-cd-with-quality-gates-rollback&quot;&gt;Three-Stage CI/CD with Quality Gates &amp;amp; Rollback&lt;a class=&quot;zola-anchor&quot; href=&quot;#three-stage-ci-cd-with-quality-gates-rollback&quot; aria-label=&quot;Anchor link for: three-stage-ci-cd-with-quality-gates-rollback&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Across the application repositories (&lt;code&gt;notes-fe&lt;/code&gt;, &lt;code&gt;notes-be&lt;/code&gt;, &lt;code&gt;notes-worker&lt;/code&gt;) and the infrastructure repository (&lt;code&gt;notes-infra&lt;/code&gt;), I separated delivery into three distinct GitHub Actions workflows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;CI (&lt;code&gt;ci.yml&lt;/code&gt;)&lt;/strong&gt;: Runs linting, unit tests, and &lt;strong&gt;SonarQube&lt;/strong&gt; static analysis on pushes and pull requests. To prove the gate wasn&#39;t just decorative, I intentionally pushed faulty code with a SQL injection pattern to a test branch—the pipeline blocked it before it could progress.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CD (&lt;code&gt;cd.yml&lt;/code&gt;)&lt;/strong&gt;: Triggered after CI passes on &lt;code&gt;master&lt;/code&gt;. Builds ARM64 container images, scans them with &lt;strong&gt;Docker Scout&lt;/strong&gt;, and pushes commit-SHA-tagged images to Docker Hub.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deploy (&lt;code&gt;deploy.yml&lt;/code&gt;)&lt;/strong&gt;: Triggered manually with a target commit SHA. It validates that the SHA exists on &lt;code&gt;origin/master&lt;/code&gt;, verifies the image in Docker Hub, re-runs Docker Scout, and sends the deployment bundle via AWS SSM &lt;code&gt;SendCommand&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If health checks pass, the deployment script saves the configuration and image tags to a &lt;code&gt;last-good&lt;/code&gt; directory and prunes old images. To verify recovery, I tested an intentionally broken release that failed health checks: the script automatically restored the &lt;code&gt;last-good&lt;/code&gt; state so the app stayed healthy, while still exiting with code &lt;code&gt;1&lt;/code&gt; so GitHub Actions accurately flagged the deployment as failed.&lt;/p&gt;
&lt;h2 id=&quot;observability-alerting&quot;&gt;Observability &amp;amp; Alerting&lt;a class=&quot;zola-anchor&quot; href=&quot;#observability-alerting&quot; aria-label=&quot;Anchor link for: observability-alerting&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;On the monitoring instance, &lt;strong&gt;Prometheus&lt;/strong&gt; scrapes host and container metrics every 15 seconds (7-day retention), &lt;strong&gt;Grafana&lt;/strong&gt; visualizes them over Tailscale, and &lt;strong&gt;Alertmanager&lt;/strong&gt; sends email notifications for instance downtime (&amp;gt;2 minutes), high CPU (&amp;gt;85%), high memory (&amp;gt;90%), or low disk space (&amp;lt;15% for 10 minutes).&lt;/p&gt;
&lt;p&gt;Building this end-to-end—from Terraform state bootstrapping to testing a live rollback—made DevSecOps principles concrete. Security controls like OIDC, SSM, and vulnerability gates aren&#39;t extra overhead when they&#39;re baked into the pipeline from day one; they&#39;re what make automated releases safe to trust.&lt;/p&gt;
</content>
	</entry>
	<entry xml:lang="en">
		<title>Building a Resilient E2E Test Suite for a Crypto Exchange Staging Environment</title>
		<published>2026-10-05T00:00:00+00:00</published>
		<updated>2026-10-05T00:00:00+00:00</updated>
		<link rel="alternate" type="text/html" href="https://blog.daulthings.site/posts/automating-e2e-regression-testing/"/>
		<id>https://blog.daulthings.site/posts/automating-e2e-regression-testing/</id>
    
		<content type="html" xml:base="https://blog.daulthings.site/posts/automating-e2e-regression-testing/">&lt;p&gt;During the first month of my internship at &lt;strong&gt;PT Darmawan Aryansyah Teknologi (DAT)&lt;/strong&gt;, I worked with the Developer division to automate regression testing for &lt;strong&gt;Coinx&lt;/strong&gt;, a crypto asset exchange platform.&lt;/p&gt;
&lt;p&gt;Before this project, regression testing was done manually: testers walked through scenarios step by step, checked the UI, and took screenshots as proof. That approach works when a product is small, but it quickly becomes a bottleneck—every release repeats the same steps, and manual evidence is hard to compare across iterations.&lt;/p&gt;
&lt;p&gt;My goal was to build a repeatable automated test suite against the staging environment covering core user flows—bank account management, fiat (IDR) deposits and withdrawals, and crypto asset (USDT, ETH, BTC) deposits and withdrawals—while leaving out flows that inherently require human interaction or visual chart interpretation, such as KYC verification and live trading.&lt;/p&gt;
&lt;h2 id=&quot;structuring-the-suite-with-page-object-model&quot;&gt;Structuring the Suite with Page Object Model&lt;a class=&quot;zola-anchor&quot; href=&quot;#structuring-the-suite-with-page-object-model&quot; aria-label=&quot;Anchor link for: structuring-the-suite-with-page-object-model&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;I built the suite using &lt;strong&gt;Python 3.14&lt;/strong&gt;, &lt;strong&gt;uv&lt;/strong&gt;, and &lt;strong&gt;pytest&lt;/strong&gt;, structured around the &lt;strong&gt;Page Object Model (POM)&lt;/strong&gt;. Each application page lives in its own class responsible for selectors and UI interactions, while the test files only orchestrate user flows and assertions.&lt;/p&gt;
&lt;p&gt;Shared browser setup, authentication, and helper utilities are injected via pytest fixtures, and all test credentials, TOTP secrets, and API keys stay isolated in &lt;code&gt;.env&lt;/code&gt; files outside version control. This separation meant that when a UI flow changed, I only had to update a single page object rather than hunting through dozens of test files.&lt;/p&gt;
&lt;h2 id=&quot;dealing-with-staging-realities&quot;&gt;Dealing with Staging Realities&lt;a class=&quot;zola-anchor&quot; href=&quot;#dealing-with-staging-realities&quot; aria-label=&quot;Anchor link for: dealing-with-staging-realities&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Automating a real financial/crypto staging app is rarely as simple as clicking buttons. Several practical hurdles shaped the architecture:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Bot protection &amp;amp; login captchas&lt;/strong&gt;: Automated browser sessions were immediately flagged by Cloudflare Turnstile, and the login form included a captcha. Running Chrome via &lt;strong&gt;SeleniumBase UC Mode&lt;/strong&gt; handled the browser-level protection, while authenticating directly against the login API endpoint and injecting the resulting JWT token as a browser cookie bypassed the login captcha cleanly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Time-based 2FA&lt;/strong&gt;: Sensitive flows required two-factor authentication. Using &lt;strong&gt;&lt;code&gt;pyotp&lt;/code&gt;&lt;/strong&gt; with the test account&#39;s TOTP secret allowed the suite to generate valid 6-digit codes on demand without manual input.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shifting UI locators&lt;/strong&gt;: Because the staging app was actively under development, single selectors broke frequently. I built a &lt;code&gt;SmartLocator&lt;/code&gt; wrapper that tries multiple fallback strategies (ID, CSS selector, XPath) in sequence. If every fallback fails, an LLM-assisted self-healing module (backed by &lt;strong&gt;Google Gemini&lt;/strong&gt;) inspects the context and suggests a replacement selector before giving up.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Payment gateway dependencies&lt;/strong&gt;: Fiat deposit flows depended on external payment gateway confirmations (Xendit). To avoid manual intervention, I wrote a payment API helper to simulate gateway callbacks during test runs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Traceable evidence&lt;/strong&gt;: Because one of the main pain points of manual testing was assembling proof, I added a &lt;code&gt;ScreenshotManager&lt;/code&gt; that captures sequentially numbered screenshots at every critical step alongside structured logs.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;results-and-the-biggest-lesson&quot;&gt;Results and the Biggest Lesson&lt;a class=&quot;zola-anchor&quot; href=&quot;#results-and-the-biggest-lesson&quot; aria-label=&quot;Anchor link for: results-and-the-biggest-lesson&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Executing the full suite of 33 positive and negative scenarios against staging produced a &lt;strong&gt;79% pass rate (26 passed, 4 failed, 3 marked as expected failures for known unstable features)&lt;/strong&gt;, with every negative validation check passing.&lt;/p&gt;
&lt;p&gt;The most valuable takeaway wasn&#39;t the pass rate itself—it was learning to &lt;strong&gt;separate test-script defects from actual application defects&lt;/strong&gt; before reporting them. When four scenarios failed, digging into the execution logs showed that two were caused by our payment gateway simulation not handling a response format properly, while the other two were genuine application error messages on staging. Treating every red test as an app bug wastes developer time; triaging logs and screenshots first makes automation genuinely useful to the team.&lt;/p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;One limitation remaining at the end of the project was that the suite still ran on demand rather than inside Coinx&#39;s internal CI pipeline—which would require dedicated secret management and deterministic test-data resets between runs.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
	</entry>
</feed>
