Blog
AWS CodePipeline Random Musings
We have laid out the following accounts for our core DSOP architecture:
DSOP CodePipelines
DSOP CodeCommit
DSOP Tooling
Each of these provides us with different outcomes and tries to limit access to developers and ops. Traditionally, many would combine the CodeCommit and CodePipelines accounts into one. This is an ok strategy, but could potentially cause some issues with separation of duties. Our goal is to break that and enable CodeCommit and CodePipeline to reside in different accounts.
There are a lot of "Gotchas" in the process of developing Pipelines. For one, creating a pipeline that works on multiple branches is basically impossible with CodeCommit feeding directly into CodePipeline. You need a 1:1 pipeline for your branch. So, if you are using a branch development strategy, you will create a lot of pipelines. This becomes a tangled mess if you need to update those pipelines if they still exist.
Breaking our code into accounts for CodeCommit and CodePipeline, helped enable this. Our strategy follows below.
Automated Multi-Region deployments in AWS: DynamoDB
Virtually all of our data storage we do is within DynamoDB. We have chosen DynamoDB over others because there is literally nothing to manage—it is Platform as a Service ("PaaS") up and down.
You define a table, indices, and you are off and running.
For those that don't know, DynamoDB is analogous to a "NoSQL" database. Think of it as a large hash table that provides single digit millisecond response times. It scales so well it is what Amazon (proper) uses to drive the Amazon Store.
In 2017, Amazon launched "Global Tables" for DynamoDB. Global Tables enable you to define a table in one to many regions. DynamoDB automatically syncs to other regions without you doing additional work.
Thus, you can easily have multi-region capabilities with virtually no overhead. We'll dig into DynamoDB and Global Tables in this article. We will focus only on Global Tables.
Automated Multi-Region deployments in AWS: Gotchas
"Gotcha" maybe a bit over the top, but perhaps "caveats" is a better term. Leveraging StackSets alone can cause some order of operation issues, as well as adding multi-region on top of it.
We will discuss these caveats more in depth in other articles, but wanted to touch on StackSets up front, since they underpin everything we will do.
With StackSets and applying them to OUs, automated deployment of them works like a charm, most of the time. As we laid out in the Intro, we deploy all of our IaC as StackSets into OU targets. We do this to automate deployments and ensure we have a consistent deployment throughout all of our Accounts for an application.
This also enables us to create private tenets for customers that only they access, with minimal overhead.
Our entire cloud journey is to remove overhead and reduce maintenance needs and build more awesome things.
Automated Multi-Region deployments in AWS
The tides have changed on resiliency of building applications that reside in the cloud. We were told for years that "Be Multi-Availability Zone" was the means to have resilient cloud apps. But, the outages that have hit every major Cloud Service Provider ("CSP") recently show that it isn't always a strategy if your aim is extremely high availability.
So, we need to think bigger. But, this comes at increased cost and increased complexity. The fact is, there just aren't a whole lot of organizations doing multi-region deployments—let alone ones talking about it. This series hopes to assist in filling that gap.
We decided to author a series of blog posts on how to build resilient cloud applications that can span multiple regions in AWS, specifically AWS GovCloud. Our goal here is uptime to both push data to and retrieve data from a cloud application. This series will touch on several things which we are focusing on, building Web Apps and Web APIs that process data.
Most of our applications use several AWS core technologies (listed below). We have made a concerted effort to migrate to pure Platform as a Service ("PaaS") where we can. We want to avoid IaaS totally, as it requires additional management of resources. We can't tell you how all of this will work with Lift and Shift, as our engineering is centered around using cloud native services.
The goal for us and the reason for the cloud is, let someone else do the hard work. For our cloud based solutions, we do not use Kubernetes ("k8s"), at all. We find the overhead to be too cumbersome when we can allow AWS to do all the management for us. When we cut over to edge computing k8s becomes a viable solution.
At a high level, we use the following services to build and deliver applications:
AWS Lambda and/or AWS ECS Fargate for compute
AWS DynamoDB for data storage (Global Tables)
AWS S3 for object storage
AWS Kinesis + AWS S3 for long term logging of applications to comply with DoD SRG and FedRAMP logging
Now, there are a lot of applications that may need to use more services. Things like Athena or QuickSite maybe necessary, but we consider (at least for the solutions we are building) for those to be ancillary services to the core applications. For instance, in these applications if you can't get to QuickSite to visualize some data for an hour—its not that big of a deal (at least for this solution). But, if you can't log data from the field real time, that is a big deal.
Custom CloudFormation Resource for looking up config data
This project, CloudFormation Lookup enables you to build CloudFormation templates that pull configuration data from DynamoDB as a dictionary. Consider the scenario where you are using CodeBuild to deploy apps into a series of AWS accounts you control. Each of those accounts may have differing configuration data, depending on the intent of the account. For instance, perhaps you deploy an application across segregated tenants for customers? Each of those tenets may have different configurations, like DNS host names.
This project can be found here on GitHub
As of right now with CloudFormation, there is no means to pull that data, on a per account basis. To solve this problem, we have developed a custom CloudFormation resource, that enables you to define resource, as below in your CloudFormation template.
Automating iOS App Development with CI/CD Pipelines with macOS Build Servers
As part of our series on building iOS apps, we will walk through configuring a build server for doing so. This build server can also be used for building macOS apps as well.
This write up is intended to not solve all your CI/CD issues for building apps for iOS, but more of a "bare bones" build server that will help you scale your DevSecOps pipelines for mobile.
To be up front about this, automating builds on macOS has a few pain points. In the pursuit of building a more secure OS, macOS can tend to be on the difficult side for build automation.
For instance, configuring a "headless" build server with FileVault enabled is impossible at this point. So, you cannot VNC into a server sitting in a server rack without doing so locally. Setting up an "auto login" via macOS with FileVault also will not work, because FileVault does not allow that. So, one must take these issues into account.
Without logging in, you cannot (in this instance of this build server) run the GitLab Runners.
So, options can be limited depending on what you are attempting to do. To work around this, you may want to have your macOS boot volume not encrypted and store all your data in an encrypted volume. This will enable the macOS build server to book and auto-login to enable jobs to run.
For GitLab, you need no ingress point to access the build server, only egress to ping your GitLab repo. So, one could drop this box in a private subnet that has some outbound egress and be somewhat comfortable with the security around it.
Automating a lot of these steps hasn't been easy, there are a lot of password and confirmation prompts that require a user to do something.
Cross Account DynamoDB Access
We at Monkton use DynamoDB a lot for storage. It is extremely fast and scalable. A lot of the work we do is in AWS GovCloud, so this post will be geared towards that, but easily portable to other regions. We spent some time digging around and being frustrated trying to get this to work and wanted to share lessons learned to avoid those headaches.
Defining the need
We are helping build a new set of services, part of our multi-account architecture is a centralized "Identity SaaS" service. While we have micro-services available in that account to read/write to the "Identity SaaS" service DynamoDB, we opted to read/write directly to it, for other trusted services and accounts. This was simply a performance choice on our end to speed things up. We wanted to avoid creating a HTTPS request, waiting for it to do its thing in DynamoDB, and return—when we could do it directly using the same logic.
Many considerations
Part of how to configure this is understanding where and what services we will be using. For this project, we are using Lambda and ECS Fargate to deploy backend services. For the purposes of this demo, we are looking at Fargate, but lessons apply to Lambda as well. Part of that is following "Best Practices" and deploying these services into VPCs with private subnets.
Automated Testing of iOS Apps in CI/CD Pipelines (Part One)
This is a multipart series we are putting together to walk through automation of DevSecOps for mobile solutions. We are going to focus on iOS, but much of this is applicable to Android as well. Our goal is to leverage GitLab as the CI/CD engine and other services like AWS Device Farm, SonarQube, and NowSecure for testing. Finally, the app should pre-stage by self publishing to Apple's App Store for TestFlight publishing.
For as many mobile solutions that exist out there, the write ups and documentation that exists to automate testing, specifically UI testing is substandard to say the least. This post will lay out some of the techniques we leverage to automate the testing of mobile apps (iOS specifically) to perform fully automated UI testing.
iOS Testing in AWS Device Farm
We leverage AWS Device Farm to implement testing—the capabilities of Device Farm are fantastic, the difficult bit is the practical application of documentation.
Again, everyone talks about automated testing, but who is actually doing it?
We'll dive into AWS Device Farm later.
ICYMI: How to Sell Your Digital Transformation Vision
Why do we need change? What is the problem we are solving, and who is it being solved for? What does change look and feel like to you? Clear and succinct communication is not only necessary for executive leaders, but also necessary for others to be champions for your vision. Read this blog from Monkton to learn more about how to sell your digital transformation vision.
Automatically configuring AWS GovCloud Accounts
This technical article will walk through a CloudFormation template that will create a Step Function that creates AWS GovCloud accounts with AWS Organizations and automatically links them. Our end goal is to simply submit a JSON package like this:
{
"email": "some-email@example.com",
"name": "The Account Name"
}
And generate the AWS Organization and link them. This is a rather manual process if you do it by hand.
This CloudFormation template provides two main components:
A configured S3 bucket and KMS key that enable child AWS Organizations to pull from the bucket
A Step Function that automatically creates and links AWS organizations
This script is intended for creating AWS GovCloud accounts, but can be modified for creating standard AWS accounts. Note, this will create the requisite commercial AWS accounts that GovCloud accounts are tied to.
We have included this notice because this CloudFormation template is deployed into the root AWS GovCloud account you own.
NGINX Auto Configure from S3
This technical article will break down how to automatically configure a custom build of NGINX (using Alpine Linux) that runs in Fargate.
Why? Well, we want to enable encrypted data in transit through the stack of the AWS Fargate solution we are deploying. Our entry point is an AWS Application Load Balancer accepting traffic on port 443 for TLS communication. We have an ACM certificate stored in our Account that we have referenced and use to configure that.
From there, we have a Task running in a Service/Cluster within Fargate. This task is a RESTful Web Service. Our desire is not to configure that task to process TLS itself, due to unnecessary changes to the Containers.
So, what we will do is leverage NGINX as a reverse proxy and use S3 to automatically configure NGINX on the fly as the Container is launched! We accomplish this by extending the NGINX Alpine Linux container, adding a script to download the configuration from S3 upon launch, and voila done.
Mobilizing for USDA Inspectors
Upon entering a grocery store, the general public is typically not pondering whether they feel protected by the safety, efficacy, and security of the food supply presented to them, but that is in fact what the FDA is responsible for. When it comes to meat, labels now inform us of how the animal was fed, the conditions they were raised in, and a myriad of other miscellaneous facts that manufacturers capitalize on in order to gain consumer loyalty. However, when dealing specifically with field-based meat inspectors, how data is generated is never a thought – not even an afterthought.
Having so many nuanced compliance regulations within agriculture, mobility means always knowing what is necessary to complete inspections. USDA inspectors are the prime example of hurry up and wait—whether it be improper paper documentation, waiting for a form sign off, or lag time in getting meat over the border because of regulatory laws, inspectors need mobile apps to simply know how to do their job. Mobile solutions provide clarity on when, where, and how meat inspections can occur safely and securely, while still getting the product to its end destination in a timely manner.
Mobilizing for Pilots
There are people who fly planes, and those who don’t. The non-pilot folk likely assume that any given pilot has the ability to simply show up for work, ready and able to fly on a moment’s notice. While that notion isn’t entirely false, the simplicity of tinkering with a few levers and checking the weather before takeoff is a made-up narrative generally regarded as false.
The truth of the matter is that an Air Force pilot quite literally steps into a time machine when she or he enters an aircraft. Imagine for a second you’re a pilot. You’ve got your clean and pressed flight suit on; possibly a new pair of aviator sunglasses to block out the harsh rays; the ascent up the airstairs toward the entrance of the aircraft has been made where the wind is blowing just right to, wait for it…blow away over 100 pounds of your paper-based aeronautical and flight regulation charts to the ground below. Not exactly the Top Gun moment you envisioned.
Mobilizing During Disaster
When disaster strikes, the most precious resource is time–time to assemble, act, and mobilize with skillful efficiency. Speed is imperative to improve everything from field reporting, data collection, and damage assessments. With weather and climate changes in constant fluctuation, organizations must be prepared to handle a diverse array of potential disasters. Fire drills are introduced in elementary school, but what about explosions, chemical spills, hurricanes, floods, and extreme weather–what’s the plan then?
It’s generous to assume that employers are even 50% equipped to handle catastrophic events like earthquakes, tornadoes, hurricanes, and even snow or ice storms. Most companies have disaster preparedness plans, but when disaster strikes who is going to remember to open the locked drawer with the stuffed filing cabinet full of outdated, paper-based manuals/posters/flip books/building diagrams etc. Trick question–no one!
As a result of paper-based inefficiencies, there is often a lack of resources and preparedness to understand or much less handle what to do when disaster strikes. Beyond taking steps to empower employees to be better prepared for how to respond to disasters, it is incumbent that organizations like FEMA and The Red Cross are readily equipped with the resources and technology to respond with agile authority.
Hazards behind healthcare
Everyday millions of people make appointments to see their doctor or nurse for miscellaneous reasons. Sometimes it may be an emergency and other times it may be a routine checkup, but how often do we consider what the scheduling and charting process looks like for them? Do they suffer from aches and pains due to the behind the scenes patient charting, prescription filling, emails, office tasks, etc.? In a word—YES.
Pre Covid-19, the shift towards online and app-based appointment booking was already happening, but now it is paramount as in-person staff is reduced and access is granted towards those regarded as essential. Many would argue they do not receive enough face to face time with their healthcare provider, and with staffing down that situation is not about to change. The question now becomes if improvements are being made toward the patient experience, why can't the same be true for those truly essential doctors and nurses? If we've said it once, we've said it 101 times—Getting data to the point of use, to either consume or generate is the power of secure mobility.
The Impact of UI: Employee Satisfaction
Modern enterprise understands both the business and economic advantage to happier employees. Where digitally defiant organizations may have placed all the focus on external growth, a bulletproof business strategy is one centered around secure mobility as a tool to increase employee satisfaction and productivity in an effort to achieve long-term goals.
The Impact of UI: Rapid Results
K-I-S-S, as in the clever acronym for “keep it simple stupid”, (not the classic rock band) is never more relevant than when it comes to mobile technology. Think of the user interface (UI) on a mobile device as exposure therapy – the more you expose primary functions to users, the more engagement and overall usage. In an effort to reduce user confusion and achieve rapid results, obvious UI is often the best UI.
The Impact of UI: User Centered Design
Implementing a mobile application as a solution can feel daunting at times, but why? For many, it comes down to the myriad chains of communication between end user and developer. Call us crazy, but we believe in hearing the needs of who the app is intended for from day one, and then building. With the end user being the target audience, our approach is to listen to what their issues are and solve them—simple.
Always Design For The End User And Their Needs
One of the easiest ways to get nowhere fast is to assume you know what the problem is instead of asking. Always ask your target audience for guidance on how you can help solve their biggest problems. What is preventing them from completing their task? You wouldn’t suggest Uber to someone who is looking for a music streaming platform. Same goes for design—Identify the end user’s problem first, then design based off of their needs.
The Impact of UI: Enabling Action
After security, arguably the most important component of a mobile device is the user interface ("UI"). When implementing a mobile application as a solution, consider the following: Is it easy for the end user to operate? Can a task be completed from start to finish without difficulty? Is information presented in a way that incites action? All of those need to be answered with a resounding yes. The key differentiator between a good and a great UI is enablement – A great UI enables action, in turn creating rapid results that are achievable and repeatable. You didn’t need a user manual to use Facebook, Twitter, or Uber, why should your business apps be different?
Mobile connectivity has reached a precipice in 2020 with Covid-19 showing that the future of mobility is now. There is no longer a question of if, but when the universal shift to cloud computing occurs. In the wake of Coronavirus, the world has come to a halt leaving government and the private-sector with only one option—adapt.
Homes—our service members deserve better
Most are familiar with the ubiquitous slogans from our nation’s branches of service: "The Few, The Proud", "Born Ready", or "Aim High, Fly-Fight-Win." Television commercials do a great job marketing the resolve and steadfastness of service men and women working tirelessly at their craft—piloting Black Hawks, traversing mountains at the tactical edge, servicing F18s on aircraft carriers. However, something is conveniently left out of that narrative—the staggering amount of service members subjected to horrendous base housing living conditions. By horrendous, think black mold climbing up and down walls causing chronic headaches debilitating service men and women from doing their respective jobs, think rat droppings falling from the ceiling. Yes, the fine folks in charge of DoD marketing really were not, "Born Ready" or trying hard to "Aim High", by bringing light to what is now beyond a base housing crisis. Homes are in disrepair, falling apart, plagued with mold, rodents, and the list goes on. Besides the endangerment of service members (which is inexcusable as is), it is their families who suffer the most. These are the folks relegated to the physical home in which their living conditions are causing more harm than not. This goes beyond being a housing crisis and a major health concern affecting thousands of our service members and their families. This issue impacts our nations readiness.