How to enforce HTTPS on your web application

How to enforce HTTPS on your web application

Enforcing HTTPS is a lot harder than most people make it seem

So, lemme break this down into the 7 (yes 7!) different things you are gonna need to have configured to meet the requirement in the top paragraph:

  1. create the unencrypted “origin” service
  2. create a load balancer, CDN or other service to answer inbound encrypted requests.  If you are going to do this all on one server it’s harder to get this all right.
  3. create a valid certificate for the encrypted endpoint whether that’s on an origin server, load-balancer, CDN, etc
  4. redirect requests from port 80 to 443 preferably at a load-balancer.  If you do this on a server, make sure that you are redirecting all inbound HTTP to HTTPS.
  5. if you are using a load-balancer or CDN make sure that you firewall the origin server or service so that clients can’t connect directly to it and bypass the control.
  6. check that all links (especially external links!) in your app or website are using HTTPS (ie., https://cdn.google.com/images/profile_pic.jpg)
  7. enable HSTS which will *enforce* the “https://” part which means that if you haven’t ticked the box in #5 above you will get a HTTP error

See, not so easy!  Unfortunately, many security frameworks gloss over this complexity so the people actually implementing the control aren’t aware of how complex it is to “serve HTTPS exclusively”.

 

developer-logo

How do I enforce HTTPS?

Enforcing HTTPS is harder than it sounds and most software engineers don’t realize the complexity

,

complete-security-coverage-startups

SecureStack provides security coverage across the whole of your SDLC

Our platform helps you protect your most valuable asset:  Your source code.

SecureStack is easy to use as it’s a SaaS-based platform so you can be up and running in less than 3 minutes with complete coverage.

 

If you like what you see, book a demo!

 

Paul McCarty

Founder of SecureStack

DevSecOps evangelist, entrepreneur, father of 3 and snowboarder

Forbes Top 20 Cyber Startups to Watch in 2021!

 

Risky Business

Risky Business

Risky Business Podcast

In this edition of Snake Oilers we’ll be hearing from Google Security — Anton Chuvakin is appearing on their behalf to talk more about how switching to its cloud-native SIEM actually makes sense now. Paul McCarty from SecureStack will be along to talk through their latest stuff, and it’s interesting actually because they’re doing software composition analysis that includes a lot more information than just what code is going into an application — what services is the application using? Which APIs? They’ve also built some really nice compliance tools where you can do a single scan and see how you measure up against various regimes…

You can find the original podcast at the Risky.biz site here:  https://risky.biz/snakeoilers15pt2/

risky-biz
compliance-frameworks-thin

If you like what you see, book a demo!

 

Paul McCarty

Founder of SecureStack

DevSecOps evangelist, entrepreneur, father of 3 and snowboarder

Forbes Top 20 Cyber Startups to Watch in 2021!

 

Australian ISM – Guidelines for Secure Development

Australian ISM – Guidelines for Secure Development

The Australian Cyber Security Centre (ACSC) is the arm of the government that provides guidance on how to improve cybersecurity in Australia.  As part of this mandate, they have been producing a document called the “Information Security Manual” (ISM) since 2017.

You can think of the ISM as a single document that helps Australian businesses and government know how to address cybersecurity challenges.  In reality, the ISM is really a collection of different guideline documents that focus on specific areas of IT.  Some of the existing guidelines address things like system hardening, database management, network management, using cryptography, and many others.  These guideline documents as an aggregate can be thought of as “the ISM” and can be used to increase an organization’s cybersecurity maturity which benefits both the organization itself, but also Australian society.

What’s in the Guidelines for Secure Development section of the Australian ISM?

In December of 2021, the ACSC released the latest version of the ISM which for the first time included a Guideline for Secure Development.  This document lays out a framework for building and maintaining secure software development processes.  It is a total of 21 controls and is more prescriptive than what we typically see from other frameworks like APRA.

You can find the Guidelines for Secure Development here: https://www.cyber.gov.au/acsc/view-all-content/advice/guidelines-software-development

The format for this blog post

I wanted to write this blog post to help Australian orgs know about this new compliance requirement from the ACSC.  The new Guidelines for Secure Development document is split into two sections which we’ll address separately below.
Those two sections are:  Application development and web development.  

We’ll break both of those two sections down into their individual sub-sections and the controls that exist at each one of those stages. At the end, I talk about how you can assess and implement the controls in the ISM.

From this point on I’ll refer to the Guidelines for Secure Development as “GSD” for brevity’s sake.

Okay, let’s dig in!

Section 1: Application Development

This section of the GSD is applicable to all forms of software development including: client/server, web and mobile.  So special emphasis on this section should be placed on all assessments you make using the GSD.

 

Within this top level section there are 6 sub-sections:

  • Development environments
  • Secure software design
  • Software bill of materials
  • Secure programming practices
  • Software testing
  • Vulnerability disclosure program
software-development-environments

Development, Testing, and Production Environments

Segregating development, testing, pre-production and production environments into discreet separate workspaces is one of the core security principles of secure software design.  This segmentation can limit accidental issues and malicious attacks from spreading from one environment to another.  Software engineers are limited to dev and testing environments so that bad code or third-party issues can’t be added to production directly.

There are 4 controls in this sub-section that deal with environment segmentation, the scope for development changes, data segregation, and user access.  If you can’t answer yes to all 4 of these please stop what you are doing and go and address this now!

Secure Software Design and Development

This sub-section deals with the identification of software development risk during the design and development stages.  This sub-section has two controls:  One for “secure design principles” and the second for threat modeling.

I feel like this section is under-baked and needs some love.  What are “secure-by-design practices”?  Would have loved this section to be more prescriptive.  Maybe in the future, we can add things like application baselines, secure code training and application ownership labels.

 

threat-modeling
software-development-environments

Software Bill of Materials (SBOM)

This section only has one control and it’s all about SBOM.  SBOM stands for “Software Bill of Materials” and the reason that it’s so important is that it delivers something we never had had before:  a complete “recipe” of what is in an application.  An SBOM is a single source of truth for all software dependencies, frameworks, libraries, resources, and services that went into making a specific software solution.   Most definitions of SBOM agree on the above, but some go further and say that any known vulnerabilities and cloud-based services should also be included in the SBOM.  To me, this makes sense as an SBOM should be both an end-to-end description of the application, but also should list any deficiencies and liabilities.  If one of the components used to build an application has a known vulnerability, it should be codified in the SBOM.

SBOM is a huge topic right now as the US government mandated several important software-related security controls last year.  One of those was the requirement for all companies looking to sell to the US government to provide an SBOM.  This mandate is extended to any company that is part of a software dependency or supply chain even if they themselves don’t wish to sell to the US government.

Unfortunately, SBOM hasn’t delivered on its promise yet as very few organisations are actually creating SBOMs when they build software.  If you want to know more about SBOM please check out our blog post on them here:  https://securestack.com/sbom/

Application testing and maintenance

There are two controls in this section.  The first deals with testing software applications, both internally, as well as externally.   The second talks about software engineers needing to resolve issues found in their applications.  This is an important part of the document and makes no bones about the engineer’s responsibilities.

different-types-security-scan-tools

Even though there are only two controls here the description specifically calls out static analysis (SAST), dynamic analysis (DAST), web vulnerability scanning, and software composition (SCA) requirements.  It also calls out penetration testing and it also mentions “prior to their initial release and following any maintenance activities”.  To me, this sounds like automated tests during continuous integration and deployment (CI/CD). 

So that should really be 6 controls minimum.  I expect this to be fleshed out on the next version of the GSD.

vulnerability-disclosure-program

Vulnerability Disclosure Program

There are actually four controls in this sub-section.  The first three are somewhat redundant switching the terms “policy”, “program” and “processes” which might confuse people.  Luckily the last control is straightforward and requires that orgs use a security.txt file to advertise their VDP information.

I think we can simplify this section in this way:

  • Are security researchers able to come to your website and find how to contact you if they’ve found a security issue?
  • Have you partnered with a platform to allow security researchers to bring security bugs they find to you?
  • Do you have a set of documents that describe your security policies?  And can your employees find it?

 

 

Section 2: Web Application Development

This section of the GSD is applicable to applications available on the web that users interact with primarily via a web browser.  This section should be carefully following if you are building web apps.

 

Within this top level section there are 6 sub-sections:
  • Open Web Application Security Project
  • Web Application Frameworks
  • Web Application Interactions
  • Web Application Input Handling
  • Web Application Output Encoding
  • Web Browser-Based Security Controls
  • Web Application Event Logging
owasp-project-logo

Open Web Application Security Project

The OWASP is an organization that is trying to help encourage application security through its community and projects like Zed Attack Proxy (ZAP) and the purposefully vulnerable Juice Shop project.

This section has only one control and it explicitly states that orgs should be following the Application Security Verification Standard (ASVS) when building web applications.

 

 

While I am personally a fan of the OWASP ASVS I am a little confused about why one security framework, the ISM, is referencing another, the OWASP ASVS?  Isn’t the point of the ISM to be a standalone security framework?  If so, why are we then nesting another framework within the ISM?

Web Application Frameworks

This section has one control and emphasizes the need to use existing “robust” web frameworks.  I think the main point here is to use off-the-shelf components to provide session management, input handling, and cryptographic operations.​

web-application-framework
Web frameworks like Angular, React and Laravel are awesome and save time for development teams.  Unfortunately, sometimes these frameworks come with built-in dependency issues, and the react-scripts npm package is a great example of this as there are hundreds of transitive dependencies in this package.  Many of those transitive dependencies are out of date and insecure, as is often the case with Javascript packages in NPM.   So, we have to make sure that while we are using components that save us time and offer security benefits we aren’t causing ourselves future troubles by using the wrong frameworks.
https-everywhere

Web Application Interactions

This section has one control and it’s pretty specific:  All web application content is offered exclusively using HTTPS.  That sounds pretty straightforward, right?

Unfortunately, enforcing encrypted HTTP traffic is more complicated than many people think and require multiple controls and functions to be aligned.  Engineers need to make sure that HTTP is redirecting to HTTPS, that HSTS is enabled and that SSL/TLS is terminated in a secure environment.

I wrote a blog post about enforcing HTTPS which you can read here: https://securestack.com/enforce-https/

Web application input handling

This section also has one control: Validation or sanitisation is performed on all input handled by web applications.  That sounds relatively straightforward but is fairly difficult to do and requires using multiple controls and functions.

Input validation requires equal parts developer training, testing of the source code, and testing the web application.  That’s 3 different sets of tooling to address to achieve this requirement.

form-validation
url-encoding

Web Application Output Encoding

This section has one control which is:  Output encoding is performed on all output produced by web applications.  This is a necessary requirement as the use of un-encoded data can cause serious issues as special characters can be interpreted incorrectly by the web application.

 

 

Web browser-based security controls

While this section has only one control it speaks to the need to address browser-based attacks like cross-site scripting, CSRF, and click-jacking.   Modern web applications using things like Javascript run entirely in a user’s client-side browser.  Traditional security controls can’t help here and this is why a new generation of controls was born, most of which are delivered as HTTP response headers.  Content Security Policy, or CSP, is the best and most powerful of these but unfortunately, most websites do not use CSP.

content-security-policy
centralized-logging

Web application event logging

The final sub-section has two controls associated with it.  The first says that all access attempts and errors need to be logged.  The second, stipulates that all logs are stored centrally in another location.

Unfortunately, we see less web server and application logging than we used to.  In the era of the public cloud, many engineering teams misinterpret logging functions like AWS’s Cloudwatch and Cloudtrail which log events at the cloud layer, and NOT at the application layer.  To be very clear:  Enabling Cloudwatch and Cloudtrail are NOT effective application logging solutions.

 

 

How do we assess and implement these controls?

Okay, so now that we’ve laid out all 16 controls in the new Guidelines for Secure Development document, where do we go from here?   Well, part of the challenge of this new ISM document is that it spans across the whole software development lifecycle (SDLC).  It talks about things the developer needs to do (local software testing) and it talks about segregating deployment environments.   It talks about things that happen at the beginning of the lifeycycle, and things that happen at the end of the lifecycle.  It talks about how to build your web applications and it talks about how your customers should be protected while using that application in a browser.

Unified ISM compliance coverage for the SDLC?

All of these disparate controls focusing on different parts of the SDLC means that there’s a broad surface area to assess and quantify against.  This is one of the reasons that when we were building SecureStack we intentionally wanted to integrate into the multiple platforms our customers use.  Unified coverage for the SDLC means integrating into source code management providers like GitHub, Bitbucket, and Gitlab,  It also means integrating into the continuous integration and deployment and build platforms.  And it definitely means integrating into the public cloud providers like AWS, Azure and GCP.  But finally, it also means that you need to have continuous awareness of the web application at the heart of this as well.

content-security-policy

How can SecureStack help you assess your ISM compliance?

The SecureStack platform can help you assess and quantify your ISM GSD compliance with our SaaS platform.  We help you integrate your source code platform, CI/CD processes, build environments and your public cloud providers, and we do it all in less than 5 minutes.

Thanks right!  You can see assess your entire software development lifecycle in less than 5 minutes with SecureStack.  Check out the video to the left to see how!

 

If you like what you see, book a demo!

 

Paul McCarty

Founder of SecureStack

DevSecOps evangelist, entrepreneur, father of 3 and snowboarder

Forbes Top 20 Cyber Startups to Watch in 2021!

 

Automate responses to security questionnaires!

Automate responses to security questionnaires!

Are you sick of filling out security questionnaires to meet some compliance or audit objectives?  Most of the software engineers we talk to that have to fill these pesky forms out hate the process.  Many of them say to us that they really want something that could automate responses to security questionnaires.

I had to fill out my first security questionnaire back in 2002. The questionnaire came in the form of a large Excel spreadsheet and I remember looking at it and thinking at the time, “Man, that’s a LOT of questions!!” I wondered how they would know if I was telling the truth or not? I could just put anything down and how would they know if I was being honest? Would they come onsite and audit us?

Fast forward to 2022. We still use spreadsheets for our security questionnaires. They pretty much ask the same questions they did 20 years ago, and they are still being used by the same people. It is a hallmark of #infosec that you get told to fill out the questionnaire and it’s just something we all do.

Here’s the thing:  Security questionnaires aren’t that good at determining risk

  • Security questionnaires are lengthy and take a long time to fill out. The industry doesn’t trust them very much but continues to use them for lack of anything better. Only 14% of organizations surveyed said they are highly confident that security questionnaires represent true security profiles.
  • Finding the right people to talk to and getting responses from them is a real challenge.  This is especially true if you are trying to ascertain compliance around software development processes and you need to talk to software engineers.  Engineers are busy delivering software and often actively hostile to the audit or compliance processes.  Software engineers will sometimes not respond to queries which leaves the party responsible for collecting the data in a lurch.
  • Questionnaires are usually not very accurate. The person filling it out usually doesn’t have the answers and often makes up answers or guesses, neither of which help. When asked, most risk professionals admit they have very little confidence in security questionnaires.
  • Security questionnaires are a single point-in-time snapshot. Even if somehow, the original data captured in the questionnaire was accurate, they don’t get updated which means that you can’t really trust them for very long.
developer-logo

Developers are usually not aligned with security or compliance objectives

As mentioned above, security questionnaires aren’t great at determining risk in normal circumstances, but it’s even harder when you are trying to audit your software development processes.  Gathering data from software engineers can be really tough.  They are often resistant, and sometimes downright hostile to the idea that their development processes need to meet some compliance requirements.

Software engineers’ metric of success is not usually security or compliance-related.  Instead, it’s how fast they can deliver new features.  So, this explains in part why developers are often so against security teams asking them questions about their security protocols.  

,

How do you audit the CI/CD process?

Auditing the CI/CD processes to identify whether there are security or compliance gaps can be difficult.  Often, even gaining the right access can be a problem.  Engineering teams are often the ones with administrative access to the source code management (SCM) and CI/CD platforms, so getting them to provide access can be challenging.

Wouldn’t it be better if we could somehow automate the responses to these security questionnaires?

github default is public

SecureStack automates responses to security questionnaires which saves your team time and money!

 

If you like what you see, book a demo!

 

Paul McCarty

Founder of SecureStack

DevSecOps evangelist, entrepreneur, father of 3 and snowboarder

Forbes Top 20 Cyber Startups to Watch in 2021!

 

The DevSecOps Playbook

The DevSecOps Playbook

The DevSecOps Playbook

SecureStack is committed to open-source projects, that’s the reason we recently open-sourced the “DevSecOps Playbook”.  This playbook, originally written by our CEO Paul McCarty, was an internal automation document that explained how to secure application environments.  Now, after a bit of a re-work, it’s a comprehensive step-by-step guide to implementing a DevSecOps practice for any organization.  So, we thought, why not share this with the world?!

Check out the GitHub project here: https://github.com/6mile/DevSecOps-Playbook

devsecops-playbook-infinite-loop

How to use this free open-source Playbook

The Playbook is 50 individual tasks that you can follow to help make your application environments materially better.  Each task has a Priority, which tells you what you should do first, as well as a Difficulty which tells you how hard that task is.  So your teams can start with all the priority 1 tasks and once they’ve crossed all those off the list, they can start with the priority 2 tasks.  It’s really that simple.

If you like the playbook, feel free to star it on GitHub, or fork it for internal use.  If you see something that needs adjusting or if the Playbook is missing something, please create a PR!  We want the Playbook to be a community document!  You can check out our community stargazers here.

If you have a compliance or audit requirement that you need to address, check out the last column in each controls row.  You will see there any mappings that our community has associated with that particular control.  Most tasks have been mapped to at least two frameworks, such as ISO27001, ISO27002, SOC2, CIS, APRA, NIST 800, Australian ISM/Essential 8, or PCI-DSS.

compliance-frameworks-thin

Accelerate your DevSecOps success with SecureStack

Because the Playbook started out as an internal piece of automation, it’s built right into the heart and soul of our solution.  The SecureStack platform will check your applications for all the controls listed on the DevSecOps Playbook and report back if it finds any missing.  Even better, our platform will help you understand how to address any gaps we find with our visibility and automation platform.   We give you real-time continuous compliance reporting on your applications, so you can meet ISO27001, ISO27002, SOC2, CIS, NIST 800, NIST SSDF, Australian ISM, or APRA requirements.  If you have a security questionnaire you need to fill out or are going through an audit and you’re being asked about how secure your software development processes are, then please reach out to us!

If you like what you see, book a demo!

 

Paul McCarty

Founder of SecureStack

DevSecOps evangelist, entrepreneur, father of 3 and snowboarder

Forbes Top 20 Cyber Startups to Watch in 2021!