Author: Elizabeth Lawler

  • DevOps and the Dark Pools of Security Technical Debt

    DevOps and the Dark Pools of Security Technical Debt

    We live in a world of digital transformation where organizations across industries are embracing initiatives around automation, cloud deployments and containerization of applications—and for good reason. Enabling transformative technologies such as DevOps, for example, can deliver superior product differentiation, faster time to market for new applications and services and an improved overall customer experience. A win-win, right?

    Not so fast. Amidst the explosion of new technologies, tools and practices, many business leaders are jumping in head first without testing the security waters, so to speak.

    In their race to move fast, it’s all too common for organizations to quickly realize that they’ve landed in a deepening pool of security debt that hackers are eager to exploit. As evidenced by recent breaches resulting from misconfigured AWS security settings, leaked S3 buckets full of secrets, database security misconfigurations, ransomware and the growing interest in exploiting CI/CD tools for hijacking IT assets to mine cryptocurrency, attackers are increasingly targeting DevOps environments.

    Security and DevOps Teams Swimming in Different Pools

    When it comes to prioritizing efforts, devoting attention to the non-functional requirements of DevOps infrastructure security often takes a back seat to the more observable value that the output of these systems provide. This is where security technical debt is created.

    Often times it’s a shortcut in establishing a process around managing security configurations, which is the first step on the path to an “event.” Other times it’s aligning personal development processes to corporate IT security standards.

    No matter what the first step in the chain is, the accumulation of unaddressed issues, incomplete process and failure to attend and improve security posture is how companies and groups find themselves in security quicksand.

    How deep and how wide is the security debt pool for DevOps and digital transformation initiatives?  Numerous studies show that most organizations simply don’t know what their level of exposure is, but there is concern about the unmet need of consistent security posture. We know this because security and compliance consistently rank among the top three barriers for DevOps and cloud initiatives year over year as evidenced in Puppet’s “State of DevOps Report” and RightScale’s “State of Cloud Report.”

    According to the “CyberArk Global Advanced Threat Landscape Report 2018,” fewer than half of DevOps respondents said DevOps and security teams are well-integrated, and 41 percent said security teams are only brought in at the end of the development cycle. These two departments are clearly working in different silos.

    IT security professionals and developers often have different areas of responsibility and focus on the DevOps adoption path. Owing to variable technical capabilities and operational silos, roles and responsibilities can get confusing, and the resulting work may or may not get done—leaving technical debt.

    While DevOps teams typically take ownership over application testing, QA and remediation for security flaws in software, there remains a significant “gray area” that isn’t wholly within the DevOps pipeline flow. For example, managing the security “of the pipeline” and adherence to the corporate standards for login ins/2FA and privileged account management, management of access control to secrets and rotation for shared sensitive corporate assets such as databases can impact other teams. Who builds and maintains these core controls for which the business needs to attest regarding the security of these systems when service level responsibility or operational controls are outside the DevOps team’s controls?

    It’s around these gaps that security responsibilities and operational roles get murky, and the debt pools deepen while issues remain unaddressed. The security maturity of various DevOps tools and open source projects vary widely. Missing security features as well as misconfigurations are to blame for numerous security events at many organizations with new stack components at work.

    As Cyberark Labs research has shown, DevOps pipelines can be starting points for lateral movement to other IT systems, so designs of isolation and containment are often aspirational rather than the actual achieved outcome. And for DevOps teams under tight deadlines, there are only so many hours in the day, and only so many additional items that can be added to the burndown list before something has to push and isn’t addressed in any given release.

    Breaking Down the Silos to Stay Afloat

    When these issues hit a breaking point, we see one of two outcomes: security gets involved too late and “puts the brakes on,” or the team makes a premature push to production of a transformative initiative resulting in a security event when the security process simply isn’t ready.

    When integrated and working toward common KPIs and goals, security can provide the extra bandwidth, focus and expertise to avert issues when they are brought into the process in a consultative role early, so called “shifting left.” Security needs to be built into development pipeline processes, and as we’ve seen with breaches of late, security needs to be a “feature” of the pipeline itself, which is the new attack surface cited above.

    Likewise, security teams must embrace new ways of working in the “fast-flow” of modern software engineering. They need to leave behind alarmism and “all or nothing” mental models, which were the security modi operandi of prior eras.

    Business level visibility to KPIs of success in integrating DevSecOps across the organization is often the missing link.  Whether it is red teaming the DevOps pipeline to raise awareness of the latent issues, or measuring security feature delivery success, measurement creates shared values of burning down security tech debt. Whether it is the most common security events by incident (eg. github hardcoded passwords) or the lead time to security feature delivery by the team, accountability insure attention to security success.

    In the end, it’s critical that DevOps teams work with security to ensure that speed, velocity and resiliency aren’t sacrificed for security. Every company’s fortune rises with the new value being created by digital transformation, but it can also fall with the reputational damage of a breach. Organizations need consistently aligned security and risk postures across all these new tools and technologies to reduce the pernicious pools of technical security debt.

    — Elizabeth Lawler

  • An open-source pipeline for trusted images

    An open-source pipeline for trusted images

    There are a lot of good reasons to use a trusted image (aka “foundation image”), including reliability, reduced time to launch, secure configuration. [We’ve discussed them previously]

    In this article we are going to describe a development and quality assurance process for making trusted (aka “foundation” or “golden”) images.

    First, this is the tool set to be used.

    • Source Control Keeps track of all your scripts. Images will be built 100% by scripts, not by manual keying. Therefore source control is essential.
    • Virtual Machines You’ll need to periodically start from blank slate, when you make changes to your approach which are incompatible with the current state of your machine. Using virtual machines enables us to rapidly reset to a known state and re-apply scripts.
    • Vagrant Vagrant is a virtualization tool that makes it easy to quickly launch and re-launch virtual machines, bootstrap virtual machines with base packages and ssh configuration, and synchronize your files to the guest operating system.
    • Continuous Integration (CI) Server For reliability and repeatability, CI servers run scheduled and automated jobs which fetch and merge the latest code, produce output, run tests, and apply tags and other metadata.
    • Packer Provides the ability to build many images destined for different cloud environments from a single set of scripts.

    Now let’s move into the three steps required for creating a trusted image:

    1. Creating and testing the image on your local machine;
    2. Building the image, and;
    3. Validating and promoting the image.

     

    Step 1: Create and Test Your Trusted Images Locally

    Trusted images should not be built by hand, or you’ll quickly lose track of what’s on them! First, use version-controlled scripts to build up a virtual machine that works according to your specifications. When you control the target OS, you can use basic shell scripts. If you are building for multiple target operating systems, configuration management tools like Chef or Puppet will give you the ability to write a single set of platform-independent scripts. Vagrant is a very useful tool which makes virtualization and configuration management technologies work seamlessly together.

    Vagrant works by reading a Vagrantfile which you create for your project. It describes the base image (operating system) you want, the software you need to install, and the way you want to access the machine.

    You can then use Vagrant to launch local virtual machines right on your laptop/workstation using a virtualization tool like VirtualBox (a cross-platform virtualization tool), or you can work with remote virtual machines such as EC2.  Vagrant syncs a local folder to the VM so you can edit your scripts either locally or right on the VM, and because the scripts are right on the VM you can test them out in realtime as you edit and save. This makes the code/test cycle as rapid as possible, and it’s easy to keep both the scripts and the VM configuration (Vagrantfile) in source control.  Here’s an example of a Vagrantfile which starts with Ubuntu Precise and builds out the image using chef-solo:

    Vagrant.configure("2") do |config|
      The base operating system that you’ll start from
      config.vm.box = "precise64"
      config.vm.box_url = "http://files.vagrantup.com/precise64.box"
      If you install software using Git, you’ll want to forward your ssh key
      config.ssh.forward_agent = true
      We are using chef-solo as the “provisioner” to execute the configuration scripts.
      You can also use shell scripts, Puppet, SaltStack, etc.
      config.vm.provision :chef_solo do |chef|
      This configuration is specific to Chef. Other provisioners have their own options.
    	chef.roles_path = "roles"
    	chef.add_role 'myapp'
      end
    end 

    Your provisioner scripts (in this case, Chef) is where you will implement features on the VM like:

    • Installing and configuring 3rd party software packages
    • Downloading and installing your own company’s software, e.g. from Git
    • Applying system-wide configuration settings such as iptables, log rotation, syslog, etc
    • Installing any custom  SSL certificates that you may want the VM to trust

    Once you have scripts that build the virtual machine you want, and you’ve committed your code, it’s time to build an image candidate.

     

    Step 2: Building and Managing Images

    To build an image candidate, you’ll start over with a fresh virtual machine, run your scripts, and capture an image from it.

    Building an image is about the same as any other software “build” job; continuous integration tools like Jenkins are well-suited to this task. Create a Jenkins job to build your images. As you commit changes to your scripts, push to the source control repository and trigger the job which builds a new  image.  You can tag your images with build job number and other metadata.  This metadata will be very helpful as your image library grows. In particular, you’ll always need to be able to identify exactly which versions of your configuration scripts were used to build a specific image.

    Vagrant isn’t quite as good for building images as it is for launching and managing VMs, so for image building we will use a dedicated tool called Packer. Packer is a tool for creating identical machine images for multiple platforms from a single source configuration file.

    Packer can take your scripts and produce a variety of different images for platforms such as EC2, GCE, OpenStack, VirtualBox, Docker, Digital Ocean, and more. Packer’s JSON format has pretty much the same information as the Vagrantfile:

     {
      "variables": {
        "aws_account": "",
        "aws_region": "us-east-1",
        "ssh_username": "",
        "source_ami": "",
        "access_key_id": "{{env `AWS_ACCESS_KEY_ID`}}",
    	"secret_access_key": "{{env `AWS_SECRET_ACCESS_KEY`}}"
      },
      "builders": [
    	{
      	"type": "amazon-ebs",
          "ssh_timeout": "3m",
          "access_key": "{{user `access_key_id`}}",
          "secret_key": "{{user `secret_access_key`}}",
      	"region": "{{user `aws_region`}}",
          "ssh_username": "{{user `ssh_username`}}",
          "source_ami": "{{user `source_ami`}}",
          "instance_type": "m3.medium",
          "ami_name": "myapp-{{timestamp}}"
    	}
      ],
     
      "provisioners": [
    	{
      	"type": "chef-solo",
      	"roles_path": "roles",
          "cookbook_paths": ["vendor/cookbooks"],
          "run_list": [ "role[myapp]", "recipe[myapp::ami-cleanup]" ]
    	}
    }

     

    Step 3: Image Validation and Promotion

    Because your images aren’t exactly the same as the Vagrant environment that you used for developing configuration scripts, you need to perform software testing and quality assurance (QA) on each image candidate. Images that pass their tests will be promoted and released to downstream workflows (development/stage/production).

    This should sound like a familiar problem! Again, it’s well-suited to automated continuous integration systems like Jenkins. Like any other build job, your image-building job has a build number, can trigger downstream jobs (for performing QA on the image), and it can run promotion scripts. Use these facilities to validate your images, keep track of which ones have been fully tested, and tag them with important metadata such as the branch/sha of the scripts that built it.

    Conclusion

    With this “trusted” or “foundation” image you can easily create and push validated images to multiple cloud environments. This can alleviate the wait time of building and launching individual machines and the issues which can arrive with those repeated human components. And isn’t automation what DevOps is all about?

    Acknowledgements:  Kevin Gilpin, Hleb Rubanau, and Lucia Capano are coauthors on this post.

  • Trust and Computers Make the News

    Trust and Computers Make the News

    The Heartbleed bug in OpenSSL was major news this week.  While you are waiting for sudo apt-get dist-upgrade to run on all your servers, let’s take a minute to reflect on how the SSL trust system works and about the kinds of system relationships that depend on it.

    Just to recap, SSL-based trust derives from a “blessed” certificate authority, and this certificate authority can create other certificates that can be “trusted” as long as their lineage can be traced back to the original authority. In this system the answer to “Should I trust you?” is binary; the answer is either “yes” or “no” based on the certificate chain.

    In the event the certificate authority is compromised, then all of the derivative trusted systems become suspect as well.  Real certificates become indistinguishable from fake certificates and it is no longer possible to know “who or what to trust”.  Absolute all-or-nothing trust is an inherent weakness in certificate based trust and the X.509 based trust system.

    This situation got me thinking about the differences between human trust systems and computing trust systems.  It’s interesting that people take very different approaches to trusting computers as we do with each other.  We rarely can answer the question “Do I trust you?” about another person with a simple “yes” or a “no” answer to cover all scenarios.  Most of the time the answer is “it depends” on what we are trusting another person to do, which is better captured by the concept of trustworthiness.  In human networks you establish trustworthiness based on knowledge that you have about the person, their honesty and their reputation, and information from other people who have had experiences and interactions which are similar to one you are trying to assess.

    SSL doesn’t let us assess the trustworthiness of computers.  It presents a “definitive” trust answer, in which we place too much confidence.  Based on the SSL attestations of websites, we readily hand over our credit cards to strange computers in a way that we wouldn’t do with people.

    There are alternatives to SSL for establishing trust in computing.  For example, Pretty Good Privacy (PGP) is a trust system that operates a bit closer to how humans think about trust in one another, although it requires additional overhead to manage trust systems that are established on a case by case basis.  Moreover, PGP doesn’t necessarily incorporate historical experience akin to the “reliability” parameter of trustworthiness.

    This week’s news highlights the need for accessible and manageable trust systems that provide estimates of trustworthiness somewhere in between the type of trust provided by SSL and case by case managed trust systems like PGP.

  • Trust & the trusted image

    Trust & the trusted image

    Graphic No BGWhat is Your Trust Model?

    Information security conversations often start with the question “What is your threat model?” This blog asks: “What is your trust model?”.  Trust is a complex subject and an integral part of managing DevOps-oriented organizations and highly automated IT infrastructures. Who (developers, ops) or what (code, process) is trusted to accomplish specific tasks in the infrastructure can sometimes be difficult to characterize to management, auditors, or in operational/incident reviews. The goal is to describe relationships among people and systems at work in the DevOps world and discuss approaches to making systems more transparent (to coders and non-coders!).  

    The Trusted Image

    Organizations like Amazon, Canonical, and Red Hat provide virtual machine images of popular operating system distributions. It’s common to launch these images directly “as-is” and install software onto them after launch.

    However, there are advantages to specializing one (or several) of these images and using it instead of the base OS image. A base image which has been supplemented with configuration and installed packages that suit the needs of your application is referred to as a “Trusted Image”.  And there is definitely value to putting your trust in a purpose-built and well-characterized image.   

    Why Make a Trusted Image?

    The reasons are several:

    Reliability: The more downloads that a VM requires in order to provision and configure, the more likely that something will go wrong. Network errors, outages at package repositories, and random download errors can render your VM unusable or unstable.  Building base packages into a trusted image minimizes problems.

    Secure Configuration: If there are configuration options that you want to ensure on every VM, you can build these settings into your trusted image. For example, you can configure firewall (iptables) in a trusted image to protect every VM that you launch.

    Secure Communication: If you want to use SSL or TLS inside your application, you can establish trust in a root certificate via a trusted image.

    Built-in Service “Wiring”: Do you want to ensure that the syslog of every VM you launch is sent to your logging server? Or to ensure that a specific version of Python, Ruby, Java, Node.js, etc is pre-installed on every VM that you launch? How about client libraries? A configuration management agent?  Build these into your trusted image.

    Speed: No more waiting for package installations; build them into your trusted image, and launch the end product faster.

    VM Identity and Authorization: You can build trusted images that will create an identity for each VM, and help the VM to get permissions to operate accordingly in your infrastructure. Bootstrap credentials can be used to access resources that the VM needs to join the application, such as database credentials, system passwords, API tokens, and other sensitive information.

    The Counterpoint..

    The use of trusted images can have drawbacks, for example:

    Security Patching:  Security updates from vendors are frequent. Any new image that you build will have all the latest security patches built into it; but your images will quickly get out of date as patches are released by your OS vendor.  One approach is to configure VMs to patch themselves on a schedule, for example, nightly during a “quiet period”. [ Note: Patching is tough. Please share your experiences with this problem! ]

    Management: Once you have built a trusted image, you will need a way to manage them. Image tags and other metadata features provided by your cloud can be helpful here. Treat your images like any other product of your build system: version them strictly and keep track of the provenance (history). Lastly, be sure that the system you use to build trusted images is itself trustworthy!

    Weighing the pros and cons

    Overall, for many organizations the security, performance and reliability benefits of the trusted images outweigh the drawbacks.  Would love to hear more experiences from those of you who use trusted images and who’ve considered trusted images but taken another path.