<?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[When I Work Product &amp; Engineering - Medium]]></title>
        <description><![CDATA[Stories and ideas from the team making work, less work. - Medium]]></description>
        <link>https://medium.com/wheniworkeng?source=rss----5ecb8c14da25---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>When I Work Product &amp;amp; Engineering - Medium</title>
            <link>https://medium.com/wheniworkeng?source=rss----5ecb8c14da25---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:29:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/wheniworkeng" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How we built a better beta process]]></title>
            <link>https://medium.com/wheniworkeng/how-we-built-a-better-beta-process-cece12b309d2?source=rss----5ecb8c14da25---4</link>
            <guid isPermaLink="false">https://medium.com/p/cece12b309d2</guid>
            <category><![CDATA[product-design]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[beta]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Nick Wellner]]></dc:creator>
            <pubDate>Fri, 17 Aug 2018 15:03:48 GMT</pubDate>
            <atom:updated>2018-08-17T15:21:36.454Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Km5_uJp0ry5XN_u0LhrZDA.png" /></figure><p>Building software is risky business. Every time we create a new product or feature for customers, there’s a risk they won’t understand how to use it, or they won’t use it at all, which can cost us customers or revenue. A <a href="http://www.designkit.org/">human-centered design process</a> can help reduce these risks, but some inevitably remain in the software we ship.</p><p>Beta releases can help reduce the remaining risk. By shipping our new solution to a portion of engaged customers first, we can quickly learn what we need to improve before rolling it out to the rest.</p><p>This article is for any product team looking to launch their first beta, or improve an existing beta process. At <a href="http://wheniwork.com/">When I Work</a>, we recently ran betas for two new products. What we learned during the first release made us more effective in our second. Using the following tools and techniques, we increased engagement, gathered more data, and had more confidence about where to go next.</p><h3>Finding engaged customers</h3><p>When we released the first of our two new products, we chose existing customers at random, flipped the switch, and sent them an announcement. We saw very little engagement in the first few weeks, so we tried again.</p><p>Second time around, we sent a message to customers describing the problem we were trying to solve and invited them to try our new solution. We quickly attracted customers experiencing the problem we described, excited to try what we were building.</p><p>A week before the release we sent our beta customers a reminder, and we messaged them again when we shipped. Having a motivated group and keeping them excited along the way lead to a much higher engagement rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjr0VsavWjkzRzugz_PBPQ.png" /><figcaption>An Intercom message we used to invite customers to join our beta.</figcaption></figure><h3>Gathering feedback</h3><p>With a group of customers motivated to use your new solution, having the right tools in place from day one will maximize the feedback you collect, helping you get to the right solution faster.</p><p><strong>Analytics<br></strong>Ship your new solution with event tracking and analytics in place so you can start gathering data immediately. Our product manager reviews metrics weekly, which helps us uncover issues with adoption and retention. Thanks to our analytics, we quickly determined our initial beta group was filled with uninterested customers, and we were able to move fast to correct it.</p><p><strong>Capturing sessions<br></strong>Analytics help paint a picture of behavior, but adding <a href="https://logrocket.com/">LogRocket</a> helps us see exactly how customers are behaving during their sessions. While running our beta programs, our team spends an hour each week watching sessions over lunch. It gives us a chance to note where customers are getting stuck and brainstorm ways we can make the interface more clear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2RnF_9j1DpsO3WELY8Fog.gif" /><figcaption>Watching a user interact with our new tasks feature in LogRocket.</figcaption></figure><p><strong>Encouraging feedback during use<br></strong>In the interfaces of our new solutions, we include a prominent way for users to share feedback. We route the feedback through an email address that forwards to the entire team to keep us all in the loop. Our product manager responds to each customer and tracks the feedback.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JW_TqxbmqchaUdxVrSA2cQ.png" /><figcaption>Beta banner with a link to provide feedback.</figcaption></figure><p><strong>Funneling feedback from customer support<br></strong>If your customer support team will be supporting your beta group, they’ll be a great source for determining where customers are getting stuck, and what enhancements they’re asking about. We use a Slack channel dedicated to the new solution and invite the support team to share the feedback they receive. Here we can ask clarifying questions while the details are fresh in their minds.</p><p><strong>Creating a feedback repository<br></strong>Since feedback comes from multiple sources, it’s essential to have a place to gather it all. We use a spreadsheet for each beta group to collect feedback. We categorized each piece of feedback, using a macro to rank the categories on a separate tab where we can see patterns emerge.</p><p><strong>Hosting a webinar<br></strong>This was one of the most valuable things we did with our beta groups. Within the first week of releasing, we invited our beta group to a webinar where we demoed our new solution. After the demo, we used the chat feature in <a href="https://www.gotomeeting.com/">GoToMeeting</a> to gather questions from attendees, and took the remaining time to answer them.</p><p>Not only did our customers leave the webinar more confident and excited, but in 30 minutes, we uncovered what 100 customers found confusing, and what they wanted to see next. We added these insights to our feedback repository.</p><h3>Sense and respond</h3><p>A month after each beta release, we review the feedback repository. It’s usually filled with requests for solutions. Our product teams strive to identify the underlying problems before jumping to solutions, so we interview our beta customers to learn more.</p><p><strong>Interviewing customers<br></strong>We segment beta customers into three groups:</p><ol><li>Non-starters (never tried it)</li><li>Abandoners (tried it, no longer active)</li><li>Active users (use it consistently)</li></ol><p>We schedule 10 interviews with participants from each group, and ask each group a unique set of questions. For Non-starters: What prevented them from trying the solution? What are they using instead? For abandoners: Why did they stop using the solution? For active users: What value does the solution provide? How can we take it to the next level? We add this information to our feedback repository.</p><p><strong>Closing the loop<br></strong>At this point, we’ve identified the remaining challenges and we know how prevalent each one is amongst our beta customers. We select the most common or painful ones, and we attempt to solve them next.</p><p>We often don’t get it right on the first try, but betas quickly help us identify the most significant improvements we need to make before releasing our solution to 100% of our customers. Hopefully these practices can help your team take some of the risk out of building software.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cece12b309d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wheniworkeng/how-we-built-a-better-beta-process-cece12b309d2">How we built a better beta process</a> was originally published in <a href="https://medium.com/wheniworkeng">When I Work Product &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Testing with Locust.io & Docker Swarm]]></title>
            <link>https://medium.com/wheniworkeng/load-testing-with-locust-io-docker-swarm-d78a2602997a?source=rss----5ecb8c14da25---4</link>
            <guid isPermaLink="false">https://medium.com/p/d78a2602997a</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Scott Ernst]]></dc:creator>
            <pubDate>Wed, 12 Jul 2017 15:12:37 GMT</pubDate>
            <atom:updated>2017-07-12T15:12:37.120Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QPTD3HsRdLUNpnCWFZzT4A.png" /></figure><p>While there are a number of good open-source load testing libraries available today, Locust.io stands out as a lightweight but highly flexible tool written in Python that is easy to use and scale. Like many load testing libraries, Locust.io uses a master-worker execution paradigm to scale horizontally. The master process manages the workers and serves the WebUI, and the worker processes execute the load tests. Efficient communication between the manager and its workers, handled by <em>gevent</em>, allows scaling to a large number of workers for sizable load tests.</p><p>The Locust.io documentation includes a helpful <a href="http://docs.locust.io/en/latest/quickstart.html">quick start</a> guide for creating and running a simple load test on a single host. It’s a great way to familiarize yourself with the basics, but for production load testing you’ll need to run in a distributed environment. Thankfully, Locust.io is flexible and can be set up to accommodate many different types of <a href="http://docs.locust.io/en/latest/running-locust-distributed.html">distributed environments</a>. I decided to containerize the processes in order to run them in a multi-container cluster.</p><h3>Dockerize It</h3><p>I began by creating a docker container for a Locust.io process running in Python 3.6 that could serve as either a master or a worker depending on the run command arguments. The image is available on <a href="https://hub.docker.com/r/swernst/locusts/">Docker Hub</a>:</p><pre>$ docker pull swernst/locusts:latest </pre><p>and the source and documentation on <a href="https://github.com/sernst/locusts">GitHub</a>. A container started without command arguments will run a master Locust.io process:</p><pre>$ docker run -it --rm \<br>    -v ./scripts:/scripts \ <br>    <strong>-p 8089:8089</strong> \ <br>    swernst/locusts </pre><p>The WebUI is exposed on port 8089 of the master container, and is used to initiate and monitor a load test. The <em>scripts </em>volume is where both master and worker containers look for the load test script files and settings (more on that in a moment).</p><p>The same docker image is used to create a worker, but the host name of the master must be specified with the --master-host command argument. Running a worker locally would look something like this:</p><pre>$ docker run -it --rm \<br>    -v ./scripts:/scripts \<br>    swernst/locusts \<br>    <strong>--master-host=127.0.0.1 </strong></pre><p>Docker compose makes it easy to define and manage the master and workers. A basic <em>docker-compose.yml</em> file would look something like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/480f1c1ad5dd0927ec3a75765ea1b4e8/href">https://medium.com/media/480f1c1ad5dd0927ec3a75765ea1b4e8/href</a></iframe><h3>A Hello Load Test</h3><p>As an example, let’s consider a simple load test with a single POST request. We start by creating a <em>locustfile.py</em> in a directory that will be attached as the <em>scripts</em> volume to the locusts docker container. This is the file that Locust.io will invoke to kick off the load test.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a53bdbc1d37645da4f63baf3786414f/href">https://medium.com/media/8a53bdbc1d37645da4f63baf3786414f/href</a></iframe><p>We need to include at least one subclass of the <em>Locust</em> class and one <em>TaskSet</em> subclass. In our example we’re doing an HTTP test, so we subclass the <em>HttpLocust</em> class, which itself is a subclass of the <em>Locust</em> class. The <em>TaskSet</em> class should define one or more functions, decorated as <em>tasks</em>, to be carried out by the load test. In this simple example, <em>HelloTaskSet</em> includes only <em>my_task</em>, which posts to the <strong>/hello</strong> endpoint of the targeted API. In a more complex use case, a <em>TaskSet </em>subclass would likely contain multiple tasks to properly represent the usage patterns of the API being tested. Check out the <a href="http://locust.io/">Locust.io documentation</a> for more details on that.</p><p>The elegance of the <em>TaskSet </em>class comes from it being a thin structural wrapper around the <a href="http://docs.python-requests.org/en/master/"><em>requests</em></a><em> </em>library, which for the unfamiliar is a very popular HTTP client library in Python. Its popularity extends beyond the Python community as well. There are “inspired by” libraries in many other programming languages such as <a href="https://github.com/levigross/grequests">Go</a>, <a href="https://github.com/JustHTTP/Just">Swift</a>, <a href="https://github.com/rmccue/Requests">PHP</a>, <a href="https://github.com/cyx/requests">Ruby</a> and <a href="https://github.com/imp/requests-rs">Rust</a> (I could go on). The <em>TaskSet</em> class provides the structure necessary for executing the load testing tasks within the Locust.io application and then gets out of the way and allows you to write whatever you want within the task to simulate a specific loading behavior.</p><p>In addition to a locustfile.py, the docker container requires a configuration file named <em>locust.config.json</em> that specifies the root URL for the API being targeted and the list of class names for the <em>Locust </em>subclasses to use in the test. An example for the above <em>locustfile.py</em> would look like:</p><pre>{<br>  &quot;target&quot;: &quot;<a href="https://api.example.com/">https://api.example.com</a>&quot;,<br>  &quot;locusts&quot;: [&quot;HelloLocust&quot;]<br>}</pre><p>Then given the following directory structure:</p><pre>hello_load_test/<br>    docker-compose.yml<br>    scripts/<br>        locustfile.py<br>        locust.config.json</pre><p>we can start and scale a local <em>locusts </em>application with docker compose:</p><pre>$ docker-compose up<br>$ docker-compose scale locust-worker=5</pre><p>Then switch to a browser and open <a href="http://127.0.0.1:8089/">http://127.0.0.1:8089</a> to access the WebUI and launch a load test.</p><h3>Swarm the Locusts</h3><p>For larger-scale load testing, it’ll be necessary to run in a cluster environment. I decided to try the relatively new <a href="https://docs.docker.com/docker-for-aws/">Docker for AWS</a> project, which is Docker’s officially supported way of creating a swarm cluster in AWS. The project uses a CloudFormation template to provision and manage the AWS infrastructure and resources required of a fully-functional Docker Swarm cluster.</p><p>A number of input parameters exist to customize the cluster. The complete list is available in the <a href="https://docs.docker.com/docker-for-aws/#configuration">configuration section</a> of the Docker for AWS documentation. Here are key values I set for my cluster:</p><ul><li><strong>ManagerSize</strong>: The number of manager nodes in your cluster. Set this to one and use the single manager node to host the locust-master container.</li><li><strong>ClusterSize</strong>: The number of worker nodes in the cluster. I deployed clusters of various sizes from 5 to 20 for my tests.</li><li><strong>InstanceType</strong>: Type of AWS instance to use for the worker nodes. I used both <em>m4.large</em> and <em>m4.xlarge</em> for my cluster and was satisfied with the performance-to-cost ratio.</li></ul><p>One thing you cannot customize with input parameters is that all of the EC2 instances in the cluster are added to the cluster’s Elastic Load Balancer (ELB). Docker for AWS assumes that each EC2 instance will be serving the same publicly accessible content, which is not the case here. So you’d have to play a lot of refresh-roulette before the ELB would route you to the master instance where the Locust.io WebUI resides. To get around this, I created a post-launch script that iterated through the EC2 instances in the ELB and checked the value of their swarm-node-type tag. If the value was worker, I removed that instance from the ELB. You could also do this manually in the EC2 web console if you don’t require automated deployments.</p><p>As of Docker Engine v1.13, it is possible to use docker compose v3 files to deploy stacks on Docker Swarm clusters. To do that, I baked my scripts folder into a container that I deployed to a private registry. I then created a new compose file specifically for production called <em>production-compose.yml</em> that looked like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9bfa6483e33a2fcef7e569e9b07c848/href">https://medium.com/media/a9bfa6483e33a2fcef7e569e9b07c848/href</a></iframe><p>It is similar to the previous compose file, except that it uses a container image with the scripts directory baked in and has additional stack deployment information. In the deploy sections, I’ve specified a single master container that resides on the swarm cluster’s manager node and twenty worker containers that are distributed throughout the cluster. Check out the <a href="https://docs.docker.com/compose/compose-file/#deploy">deploy configuration</a> documentation for more details on using deploy within compose files.</p><p>Next, I copied my production compose file to the docker swarm cluster and started my locusts application with a single <a href="https://docs.docker.com/engine/reference/commandline/stack_deploy/">stack deploy</a> command:</p><pre>$ docker stack deploy \<br>    --with-registry-auth \<br>    --compose-file production-compose.yml</pre><p>Open the WebUI in your browser using the public DNS of your cluster’s ELB on port 8089 to run your load tests.</p><h3>My Results</h3><p>But first a caveat: I did not conduct any kind of performance tuning to try and optimize my load tests. I was much more interested in getting something up and running quickly than making sure I was optimally allocating resources. Given that load testing is ephemeral and this configuration so easy to scale horizontally, I focused most of my time building out the test logic in my <em>locustfile.py</em> to best capture the anticipated API usage behaviors.</p><p>My test logic consisted of two Locusts, one for invalid requests (noise) and another for valid requests (signal). I set weights in the two <em>Locust </em>classes for a high signal-to-noise ratio. Each of the two <em>TaskSet </em>classes contained about a dozen tasks with different weights to produce the anticipated loading behavior. I also created a module with functions to generate highly-randomized payload data specific to each task and included that in my scripts folder.</p><p>Using <em>m4.large</em> and <em>m4.xlarge</em> instance types for the cluster workers, I was able to get a reliable 200 requests per second (RPS) from each container. I ran load tests at 1k, 1.2k, 1.6k, 2k, 2.4k, 3k and 4k RPS for extended periods of time. I found the <em>m4.xlarge</em> instances to have a bit more networking consistency, but both were adequate for the task. Locust.io handled all of the configurations without any issue, and with no indication that I was anywhere near its scaling limits.</p><h3>Final Thoughts</h3><p>In the end, I was able to very quickly create and run a test that generated thousands of events per second for each endpoint and sustain that for a number of hours to confirm my API was ready for a production load. Locust.io was definitely up to the task and lived up to my expectations in every way.</p><p>Docker for AWS was a quick way to deploy a cluster, and the capabilities of Docker Swarm (e.g. compose file deployments) was definitely compelling. My only issue with Docker for AWS is that it provisioned a lot of AWS resources in a black-box way. I’d love to see some additional documentation on how and why certain resources are being provisioned to better understand the resource usage. However, for getting a Docker Swarm cluster running on AWS, it was definitely an easy way to go.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d78a2602997a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wheniworkeng/load-testing-with-locust-io-docker-swarm-d78a2602997a">Load Testing with Locust.io &amp; Docker Swarm</a> was originally published in <a href="https://medium.com/wheniworkeng">When I Work Product &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Private Homebrew Tap with Gitlab]]></title>
            <link>https://medium.com/wheniworkeng/creating-a-private-homebrew-tap-with-gitlab-8800c453d893?source=rss----5ecb8c14da25---4</link>
            <guid isPermaLink="false">https://medium.com/p/8800c453d893</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[homebrew]]></category>
            <category><![CDATA[tools]]></category>
            <dc:creator><![CDATA[Adam Meech]]></dc:creator>
            <pubDate>Fri, 19 May 2017 16:46:16 GMT</pubDate>
            <atom:updated>2017-05-19T16:46:30.831Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43xgVv2arQ-vQy1uoWQlbw.jpeg" /></figure><p>At <a href="https://wheniwork.com/">When I Work</a> we love internal tooling to aid us in our day to day jobs, but as we grow it’s not so easy getting everyone ramped up on our tools. While we could use something like <a href="https://github.com/boxen/our-boxen">Boxen</a> or some fancy bash scripts, we prefer to keep it easy and just use good ol’ <a href="https://brew.sh/">Homebrew</a>. I’ll walk you through the steps we took to get set up.</p><p>First step is to create a private Git repository (make sure this is accessible to your coworkers!) that’s name is prefixed with homebrew-, we used homebrew-tools. The structure for the repository is as follows:</p><pre>├── Homebrew Formula<br>│ └── foo.rb<br>│ └── bar.rb<br>│ └── …<br>└──README.md</pre><p>As you can see this will contain the formulae for your internal tools (or whatever else you want!). The code required to create a formula is as about straightforward as it could be:</p><pre>class Foobar &lt; Formula<br>  desc &quot;&lt;description of the formula&gt;&quot;<br>  homepage &quot;&lt;project url&gt;&quot;<br>  url &quot;https://&lt;artifact url&gt;?private_token=#{ENV[&#39;GITLAB_HOMEBREW_TOKEN&#39;]}&quot;<br>  version &quot;&lt;version&gt;&quot;<br>  sha256 &quot;&lt;sha&gt;&quot;</pre><pre>def install<br>    mv Dir.glob(&quot;foo-*&quot;).first, &quot;foo&quot;<br>    bin.install &quot;foo&quot;<br>  end</pre><pre>  test do<br>    foo help<br>  end<br>end</pre><p>We don’t stray too far from the <a href="http://docs.brew.sh/Formula-Cookbook.html">Homebrew documentation</a>. However, the one difference is that we are using an artifact that is behind authentication and this is something I didn’t see anywhere in the documentation. After banging my head against the wall for a bit it became obvious that a formula is just regular Ruby (duh) which means I can just use string interpolation and inject an environment variable containing my personal Gitlab access token.</p><p>After we’ve added our formula to our repository we can now tap the repository using these commands:</p><p>If you’re using Github:</p><pre>brew tap wheniwork/tools</pre><p>If you’re using another Git host:</p><pre>brew tap wheniwork/tools &lt;git-clone-url&gt;</pre><blockquote>I recommend using the Git SSH URL so Homebrew can use your SSH keys for access.</blockquote><p>After tapping your repository it’s time install your formula:</p><pre>brew install foo</pre><p>If you have a naming collision with another Homebrew formula you can do this:</p><pre>brew install wheniwork/tools/foo</pre><p>As you can see it’s pretty easy to setup a private Homebrew tap for your internal tools. You can improve upon this by updating your CI/CD pipelines to generate updated formulae when new versions are tagged, but sometimes good enough is good enough.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8800c453d893" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wheniworkeng/creating-a-private-homebrew-tap-with-gitlab-8800c453d893">Creating a Private Homebrew Tap with Gitlab</a> was originally published in <a href="https://medium.com/wheniworkeng">When I Work Product &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finally, SAML command line access for AWS STS.]]></title>
            <link>https://medium.com/wheniworkeng/finally-saml-command-line-access-for-aws-sts-b0e33bbba26e?source=rss----5ecb8c14da25---4</link>
            <guid isPermaLink="false">https://medium.com/p/b0e33bbba26e</guid>
            <category><![CDATA[sso]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Richard Genthner]]></dc:creator>
            <pubDate>Mon, 27 Mar 2017 13:41:16 GMT</pubDate>
            <atom:updated>2017-03-27T13:46:29.484Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*of88Xev71FR1cDMdQpBZVg.jpeg" /></figure><p>At last, we have a solution for allowing Google’s Security Assertion Markup Language (SAML) based federation to use Amazon Web Services’ Security Token Service for authorization against AWS resources. This article is a followup to our previous write-up at When I Work Engineering on <a href="https://wheniwork.engineering/how-to-setup-google-sso-and-aws-4496f054a707#.3sh5sa70v">How to Setup Google SSO and AWS</a>.</p><p>Today, I am pleased to announce the release of KeyMe by <a href="http://www.wheniwork.com/">When I Work</a>. KeyMe is a Python 2.7 library with a command line interface called fetch_creds. This library is available via pip as of today and the source is available for download over at our <a href="http://github.com/wheniwork/keyme">GitHub account </a>. The code is an amalgamation of internal innovation, a lot of good old-fashioned experimentation and, of course, the incredible open source community. We would like to sincerely thank those who attempted this before us. Without those efforts and the results so kindly shared, this would have been a far more difficult journey.</p><p>Let’s get into how it works.</p><p>Previous solutions, while providing some useful functionality, ultimately fail to accommodate Google’s updated workflow. The ‘dance’ is now a 4 step process. Let’s break down each component:</p><ol><li>GET request to https://accounts.google.com/o/saml2/initsso?idpid=&lt;idpid&gt;&amp;spid=&lt;spid&gt;&amp;forceauthn=false</li><li>POST request to &lt;account_login_url&gt; (gathered from step #1)</li><li>POST request to &lt;password_challenge_url&gt; (gathered from step #2)</li><li>POST request to &lt;challenge_url&gt; (gathered from step #3, if using MFA)</li></ol><p>In step one, replace &lt;idpid&gt; and &lt;spid&gt; with the values for your Google SAML setup and your AWS SAML provider id. If you were to do this in your browser, you would be prompted for your username (e.g. johnny.appleseed@seeds.example). Once prompted, you would click continue and be directed to the password entry page. In Python, we can do this using the incredibly powerful <a href="https://pypi.python.org/pypi/beautifulsoup4">beautifulsoup</a> library. With beautifulsoup, we can then pull the account URL from the decoded HTML.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bdd87abfdee09e62b2b213d1328d658f/href">https://medium.com/media/bdd87abfdee09e62b2b213d1328d658f/href</a></iframe><p>Next, we need to capture the password from the data payload. We will decode the HTML again, pull out the input fields and get the password URL.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2d4317d2b2b30b30cb51ea8a36c0711/href">https://medium.com/media/a2d4317d2b2b30b30cb51ea8a36c0711/href</a></iframe><p>If you have MFA devices enabled on your user, you would have one more HTML page to decode (to capture your PIN for Google’s 2FA).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e0fc2b5c2f8877f72856e7d286bfb3d/href">https://medium.com/media/4e0fc2b5c2f8877f72856e7d286bfb3d/href</a></iframe><p>If all went well, you will receive a SAML response from Google. We can now use this response with AWS’s Python boto3 library. Let’s verify that we are getting a SAML response:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53d5518c93cc2742898f5bc93389a1e3/href">https://medium.com/media/53d5518c93cc2742898f5bc93389a1e3/href</a></iframe><p>Now that we know we have valid SAML from Google, we can pass that to boto3.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/625ca2f2503c11b1481d12739b2a730a/href">https://medium.com/media/625ca2f2503c11b1481d12739b2a730a/href</a></iframe><p>This will return the values we need to interact with AWS resources such as EC2, S3 and others.</p><h4>How to use the `fetch_creds` command line tool.</h4><p>fetch_creds allows a user to log in and ‘fetch’ their credentials. First, we need to generate a configuration file to store some options. The tool will walk you through the process of generating that file if you call fetch_creds init.</p><p>This call will walk you through some questions about your IDP, SP, AWS region, MFA status and username. You will need to get the principal and role ARNs from your AWS account or manager of your AWS accounts. This is a one-time process. Once completed, it will not need to be re-run. If you have more than one AWS account, you can run this command more than once with different names.</p><pre>$ fetch_creds init<br>Please enter a name for this config: dev<br>Please enter your google idp id: ******<br>Please enter your aws sp id: *********<br>Which AWS Region do you want to be defualt?[us-east-1]:<br>Please provide your default principal ARN: arn:aws:iam::**********:saml-provider/GoogleAppsProvider<br>Please provide your default role arn: arn:aws:iam::***************:role/GoogleAppsDeveloper<br>Do you want to provide a default username? [y/N]: n<br>Do your want to enable MFA tokens? [y/N]: n</pre><p>Next, finish the exercise with:</p><pre>$ fetch_creds login</pre><p>This command will return your temporary AWS access credentials as export commands. These credentials expire and, by default, are valid for one hour after creation (AWS STS has enforced limitations for temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html">here</a> for more details). If you wish to retrieve credentials in a different region, you can use the --region flag, like so:</p><pre>$ fetch_creds login --region us-west-2</pre><h4>Basic Usage</h4><p>As KeyMe is available via pip, you can use this anywhere you can execute a pip install keyme. Once you have it installed, it’s just a matter of putting this at the top of your Python scripts.</p><pre>from keyme import KeyMe</pre><p>Then, you can use it just like any other Python class.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0e33bbba26e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wheniworkeng/finally-saml-command-line-access-for-aws-sts-b0e33bbba26e">Finally, SAML command line access for AWS STS.</a> was originally published in <a href="https://medium.com/wheniworkeng">When I Work Product &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Setup Google SSO and AWS]]></title>
            <link>https://medium.com/wheniworkeng/how-to-setup-google-sso-and-aws-4496f054a707?source=rss----5ecb8c14da25---4</link>
            <guid isPermaLink="false">https://medium.com/p/4496f054a707</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[single-sign-on]]></category>
            <dc:creator><![CDATA[Richard Genthner]]></dc:creator>
            <pubDate>Fri, 10 Mar 2017 21:21:37 GMT</pubDate>
            <atom:updated>2017-03-10T21:21:36.589Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aFST8zPV4iTNypP52eo6Hw.png" /></figure><p>Internal authentication and authorization is a common challenge for modern organizations. Ensuring only the right users have access to the right things can be a complicated task, especially as user numbers and third-party service consumption expands. At some point, managing unique credentials for every service, across every user, is untenable. Enter single sign-on.</p><p>In this article, we will step through the process of leveraging single sign-on to control user access to Amazon Web Services (AWS) resources via Google’s G Suite accounts.</p><p>Before we get started, you will need the following tools:</p><ul><li>AWS account keys with administrator access</li><li>Google G Suite administrator access</li><li>AWS CLI tools (https://aws.amazon.com/cli/)</li></ul><h3><strong>Setup Google G Suite</strong></h3><p>First, we will need to set up a custom schema element to hold role information for our users. By default, when you map attributes for SAML applications and pass the roles to AWS, you’ll only be able to select from existing attributes of your users. Examples include:</p><ul><li>Job Title</li><li>Cost Center</li><li>Department</li></ul><p>I’ve seen other articles that mention putting a single role ARN in one of these, but it’s really not suitable for that information (especially if you use those fields already).</p><p><strong>The Solution is to setup a </strong><a href="https://support.google.com/a/answer/6327792?hl=en"><strong>Custom Attribute</strong></a><strong> for your users.</strong></p><ul><li>Open the <a href="https://developers.google.com/admin-sdk/directory/v1/reference/schemas/insert#try-it">Schema Insert Page</a> in Google Admin Console</li><li>Enter my_customer in customerId</li><li>To the right of the Request Body, select FreeForm Editor from the dropdown list and then paste the following (schemaName should be either SSO or AWS_SAML):</li></ul><pre>{<br>  &quot;fields&quot;:<br>  [<br>    {<br>      &quot;fieldName&quot;: &quot;role&quot;,<br>      &quot;fieldType&quot;: &quot;STRING&quot;,<br>      &quot;multiValued&quot;: true,<br>      &quot;readAccessType&quot;: &quot;ADMINS_AND_SELF&quot;<br>    }<br>  ],<br>  &quot;schemaName&quot;: &quot;SSO&quot;,<br>}</pre><ul><li>Then Click Authorize and Execute</li></ul><p><strong>Setup the Google G Suite SAML Applications for AWS</strong></p><p>You’ll need to configure your Google G Suite account as an identity provider (or IdP) for AWS to use.</p><p>Google has written some pretty good instructions for this <a href="https://support.google.com/a/answer/6194963?hl=en">here</a>. Go check them out and run through them on your own. Otherwise, follow the brief instructions below:</p><ol><li>Login into your Google Apps Admin Console</li><li>Head to the Apps Section then SAML Apps</li><li>Click Add a Service/App to your domain</li><li>Select Amazon Web Services</li><li>Click the Download button next to the IDP Metadata and save it somewhere for later</li><li>(Optional) Change the application Name, description and logo.</li><li>Setup the Service Provider Details</li><li>Make sure the ACS URL and Entity ID are set to <a href="https://signin.aws.amazon.com/saml">https://signin.aws.amazon.com/saml</a></li><li>Also make sure the Start URL is blank and the Signed Response is unchecked.</li><li>You’ll want the Name ID to be mapped to Basic information: Primary Email</li><li>Set the Attribute mapping up with the following:</li></ol><p>1. https://aws.amazon.com/SAML/RoleSessionName: Basic Information: Primary Email</p><p>2 .https://aws.amazon.com/SAML/Role : SSO : Role</p><p>12. Click Finish</p><p>13. Turn the application on, by clicking on the “settings” button, then Turn ON for everyone.Confirm the dialog when asked.</p><h3>Setting up the IdP in AWS</h3><p>You’ll need to tell AWS that you want to use the Google G Suite application you just set up as an IdP. You can do that with the command below:</p><pre># aws iam create-saml-provider --saml-metadata-document file://GoogleIDPMetadata-yourdomain.xml --name GoogleAppsProvider<br>{<br>    &quot;SAMLProviderArn&quot;: &quot;arn:aws:iam::123456789012:saml-provider/GoogleAppsProvider&quot;<br>}</pre><p>Make sure you substitute GoogleIDPMetadata-yourdomain.xml with the path to the IdP metadata file you downloaded earlier.</p><p>This will spit out a response with the ARN of the identity provider you created, so make sure you note this down for later.</p><p><strong>Create Some Roles</strong></p><ol><li>You’ll need to first craft a Trust Policy document to be used with the roles you’ll create. Create a new file called GoogleApps_TrustPolicy.json with the following contents:</li></ol><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>  {<br>    &quot;Effect&quot;: &quot;Allow&quot;,<br>    &quot;Principal&quot;: {<br>      &quot;Federated&quot;: &quot;&lt;Replace Me with your IdP ARN&gt;&quot;<br>    },<br>    &quot;Action&quot;: &quot;sts:AssumeRoleWithSAML&quot;,<br>    &quot;Condition&quot;: {<br>      &quot;StringEquals&quot;: {<br>        &quot;SAML:aud&quot;: &quot;https://signin.aws.amazon.com/saml&quot;<br>      }<br>    }<br>  }<br>  ]<br>}</pre><p>Make sure you replace &lt;Replace Me with your IdP ARN&gt; with the ARN of the identity provider you created earlier.</p><p>2. Run the following command to create the role. Note down the ARN that is returned as we’ll need it later</p><pre># aws iam create-role --role-name GoogleAppsAdminDemo --assume-role-policy-document file://GoogleApps_TrustPolicy.json<br>{<br>  &quot;Role&quot;: {<br>  &quot;AssumeRolePolicyDocument&quot;: {<br>      &quot;Version&quot;: &quot;2012-10-17&quot;,<br>      &quot;Statement&quot;: [<br>          {<br>              &quot;Action&quot;: &quot;sts:AssumeRoleWithSAML&quot;,<br>              &quot;Effect&quot;: &quot;Allow&quot;,<br>              &quot;Condition&quot;: {<br>                  &quot;StringEquals&quot;: {<br>                      &quot;SAML:aud&quot;: &quot;https://signin.aws.amazon.com/saml&quot;<br>                  }<br>              },<br>              &quot;Principal&quot;: {<br>                  &quot;Federated&quot;: &quot;arn:aws:iam::123456789012:saml-provider/GoogleAppsProvider&quot;<br>              }<br>          }<br>      ]<br>  },<br>  &quot;RoleId&quot;: &quot;AROAIYGHGSVXXXXXXXXXX&quot;,<br>  &quot;CreateDate&quot;: &quot;2016-03-10T12:19:31.177Z&quot;,<br>  &quot;RoleName&quot;: &quot;GoogleAppsAdminDemo&quot;,<br>  &quot;Path&quot;: &quot;/&quot;,<br>  &quot;Arn&quot;: &quot;arn:aws:iam::123456789012:role/GoogleAppsAdminDemo&quot;<br>  }</pre><p>3. At this stage, I’ve not attached any permissions to the role — you can read how to do that <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage_modify.html#d0e18315">here</a></p><p><strong>Add some roles to your Google G Suite Users:</strong></p><ol><li>Open the <a href="https://developers.google.com/admin-sdk/directory/v1/reference/users/patch#try-it">Patch Users Page</a> in the Google G Suite Console.</li><li>In the userKey put the email address of the user you want to update.</li><li>To the right of the Request body, select Freeform Editor from the drop down list, and paste the following text (replacing with the appropriate values you’ve collected before):</li></ol><pre>{<br>  &quot;customSchemas&quot;:<br>  {<br>    &quot;SSO&quot;:<br>    {<br>      &quot;role&quot;: [<br>      {<br>       value: &quot;&lt;role ARN&gt;,&lt;provider ARN&gt;&quot;,<br>       customType: &quot;SSO&quot;<br>      }<br>     ]<br>    }<br>  }<br>}</pre><p>An example my look something like this (with two roles):</p><pre>{<br>  &quot;customSchemas&quot;:<br>  {<br>    &quot;SSO&quot;:<br>    {<br>      &quot;role&quot;: [<br>      {<br>       value: &quot;arn:aws:iam::123456789012:role/GoogleAppsAdminDemo,arn:aws:iam::123456789012:saml-provider/GoogleAppsProvider,<br>       customType: &quot;SSO&quot;<br>      },<br>      {<br>       value: &quot;arn:aws:iam::123456789012:role/GoogleAppsUserDemo,arn:aws:iam::123456789012:saml-provider/GoogleAppsProvider,<br>       customType: &quot;SSO&quot;<br>      }<br>     ]<br>    }<br>  }<br>}</pre><p>4. Click Authorize and Execute</p><h3>Test it out!</h3><p>Open your Google G Suite account and then select the Amazon Web Servicesapplication. It should redirect you on to a page that lets you select role to login with (only if you created multiple Roles) or just to the AWS Console Homepage (if you created a single role).</p><p><strong>Notes:</strong></p><p>Some things to note… and these are kinda important.</p><ol><li>Currently, these users can’t get AWS keys for the SSO login user.</li><li>There’s a Amazon script out there that used to work until Google changed how its login page works.</li><li>I haven’t tried AWS STS with this yet.</li><li>I was able to get this working from a long search of random sites using Google.</li><li>If someone gets STS and AWS CLI tokens to work, please email me or even send me a link on how you did it.</li><li>Theres a limit of the number of roles you can have. As google limits custom schema data to 100Kb. I found this to be 5 roles.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4496f054a707" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wheniworkeng/how-to-setup-google-sso-and-aws-4496f054a707">How to Setup Google SSO and AWS</a> was originally published in <a href="https://medium.com/wheniworkeng">When I Work Product &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Other Reasons We Chose React]]></title>
            <link>https://medium.com/wheniworkeng/the-other-reasons-we-chose-react-fbb37e570999?source=rss----5ecb8c14da25---4</link>
            <guid isPermaLink="false">https://medium.com/p/fbb37e570999</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[DanO]]></dc:creator>
            <pubDate>Thu, 26 Jan 2017 22:05:19 GMT</pubDate>
            <atom:updated>2017-01-27T15:56:05.509Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1v3LxdPApnHjQQ2x4alXw.png" /></figure><p>Choosing the next hot framework for your company or next project always seems fun. But finding the balance between getting it right and doing it quickly is crucial. I love a quote I’ve heard around here at When I Work.</p><blockquote>Let us make haste, but not be hasty.</blockquote><p>This is a perfect way to describe the choice for a new technology, whether it be a framework or tool. Make sure to spend enough time evaluating all the options, but do it quickly and don’t linger. Wasting time on decision making in the SaaS space is a great way to ensure stagnation and death to your company.</p><p>But that’s not how we operate at When I Work. We determined several months ago that <a href="http://backbonejs.org/">backbone.js</a>, our current choice of front end “framework,” no longer suited our growing application. Once that decision was made, we moved forward evaluating several frameworks. The list included <a href="http://emberjs.com/">Ember</a>, <a href="https://angularjs.org/">Angular</a>, <a href="http://mithril.js.org/">mithril.js</a>, and <a href="https://facebook.github.io/react/">React</a>. The purpose here isn’t to determine the merits between the frameworks, but rather focus on our final choice and how we arrived there.</p><p>Our initial sweep ruled out Ember and Angular. We determined that our growing application would not benefit from the complexity and robustness of these frameworks. Had we been building a new product, or starting from the ground up, this decision may have been different.</p><p>Our next evaluation, mithril.js, was investigated thoroughly. Many of the qualities that existed in React — performance, simplicity, extensibility — also existed in Mithril. Its code was small, yet powerful. At the end of the day we determined that its community was too small. It lacked many of the components that we could find for React, and would have extended our development time. Although a final product with Mithril and React would certainly have been very comparable.</p><p>React was last on the list, mostly because so many of us already had opinions about it. Save the best for last, right? Our evaluation included many things we had evaluated before — community support, upgradability, likelihood of being around in 2–5 years, documentation, open source libraries, ease of implementation, performance. React had many, if not all, of these things.</p><p>React’s community is amazing (I’m a huge fan of <a href="https://medium.com/u/a3a8af6addc1">Dan Abramov</a>, you should definitely follow him on <a href="https://twitter.com/dan_abramov">twitter</a>). The ability to upgrade is amazing and matches that of Ember. Since Facebook maintains and actively uses React, it’s very likely to be around and improved upon for many years. Documentation is amazing and we’re consistently impressed with the quality of libraries, like <a href="https://bvaughn.github.io/react-virtualized/">this one</a>, <a href="https://casesandberg.github.io/react-reactions/">this one</a>, or <a href="https://casesandberg.github.io/react-color/">this one</a>. <em>You really should check out all those links.</em> React also includes libraries that complement its design principals, such as <a href="http://redux.js.org/">redux</a> and <a href="https://react-router.now.sh/">react-router</a>.</p><p>JSX can be a huge turn off for people — it was for some of us. But as we continued to use it, it became a valuable feature. Representing hierarchical tree data using XML is much more readable than JS or JSON, even if it does require a compiler to be executed. Here is an example where pragmatism won out over ideology.</p><p>The final decision maker was React Native. Our company and product has always taken a mobile first — or at least mobile equal — mentality. What we develop for our web application should also be developed for our iOS and Android applications. We have started using React Native in a limited capacity, and already the promise of being able to “learn once, write everywhere,” has been a huge opportunity for us.</p><p>So for now we have chosen React for our web app and are making great progress on getting new features built in React. Our next goal is to implement more functionality in our web and native applications in React. This will further simplify the development experience, in both knowledge sharing and collaboration, and also increase our productivity while reducing our delivery timeline.</p><p>Is this meant to be prescriptive? Is React the answer for everyone? Absolutely not. I’ve heard great things about Vue.js, and many successful companies have built applications using Ember, Angular, and backbone.js (including us).</p><p>At the end of the day, choosing the right frameworks and tools means evaluating what ultimately works for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbb37e570999" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wheniworkeng/the-other-reasons-we-chose-react-fbb37e570999">The Other Reasons We Chose React</a> was originally published in <a href="https://medium.com/wheniworkeng">When I Work Product &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>