Tag: authorization management

  • GraphQL: Security by Obscurity Just Isn’t Enough

    GraphQL: Security by Obscurity Just Isn’t Enough

    The debate about how to secure GraphQL rages on. Many organizations are hesitant to adopt GraphQL for public-facing APIs as there is no precise method to handle authorization concerns as of yet. Without a role-based access layer to enable fine-grained permissions for each field (and underlying services that GraphQL might wrap), the query language can be prone to access control issues.

    One method to hamper GraphQL access is to turn off introspection features altogether. Some may assume that hackers can’t perform introspection on an endpoint if it’s not visible. But this isn’t entirely true—even though an “internal” endpoint may not be fully documented, any endpoint on the public web can be searched and introspected quite easily by brute-forcing queries or through field suggestions.

    I recently met with Karim Rustom, cybersecurity engineer, Escape Technologies. According to Rustom, “making something obscure isn’t enough to make it secure.” Leveraging a single slip-up in access control could be used as a doorway into these systems. Although it’s a best practice to limit introspection, it’s likely not enough to protect production GraphQL endpoints, he said. Below, we’ll consider some common GraphQL threats and alternative solutions to retain a safe GraphQL implementation.

    Common GraphQL Threats

    Having run thousands of scans on production GraphQL endpoints, Rustom found common trends emerge around GraphQL threats. First, he noticed the potential for denial-of-service attacks to be quite high. GraphQL, by design, is intended to query whatever data the client requires. But sometimes, these queries can return a mountain of data.

    If GraphQL owners don’t place a limit on what can be requested in a single query, the platform can easily fall victim to denial-of-service attacks and service interruptions. And limits aren’t only necessary for bulk read-only operations—although GraphQL is primarily used for fetching data, some methods might initiate intense server-side processing, which should be limited in some form. According to Rustom, such data manipulation methods are especially pervasive in FinTech, food delivery or health care-related applications.

    Another rampant GraphQL threat lies in access control issues. This comes as little surprise, as access control is ranked as OWASP’s most common web application security risk. Often, when creating new objects or new queries, a developer might forget to add the correct authorization, said Rustom. This can become a huge problem and lead to privilege escalation.

    Finally, too many production GraphQL implementations rely on security by obscurity. “Folks think that disabling introspection is a layer of security—we highly stress that it’s not,” said Rustom. He recalled performing penetration testing for a certain client; even though they had disabled introspection, the team was able to fetch ample open paths and discover an unsecured doorway to divulge secret internal knowledge.

    Solutions and Best Practices

    To avoid some of the vulnerabilities presented above, it’s recommended to first place request limits on overly complex GraphQL calls to prevent denial-of-service attacks. One nuance here that Rustom recommended is to consider request complexity—not in terms of the query size, but the overall processing required. He suggested assigning scores for every query and permutation to help inform the decision about whether or not to process the incoming call.

    Furthermore, it’s recommended to disable field suggestions as the feature could be prone to abuse. Using field suggestions, hackers can leak a lot of information to build a partial or complete introspection. These tactics are similar to the word-busting techniques black hats use to perform introspection on REST endpoints.

    Although it’s a good practice to limit the possibility of surveillance, hackers can still discover systems and leverage other common vulnerabilities like broken access control. Rustom suggested other tactics, such as luring attackers into a honeypot or logging them into a fake account. Or, creating error messages that are intentionally misleading for a attacker.

    To retain a safe GraphQL implementation, organizations can use pre-made free and open source tools to audit their surface area and scan for known vulnerabilities. For example, GraphQL.security quickly scans your GraphQL URL endpoint to discover vulnerabilities. Or, Graphinder can examine a subdomain to discover GraphQL endpoints, which could aid auditing purposes. There’s also middleware that wraps a GraphQL service with additional security, such as GraphQL Armor and GraphQL Shield.

    Future of GraphQL in the Market

    There appear to be many flavors of GraphQL throughout the market. We’ve seen it emerge as a mechanism to power backend microservices. We’ve also witnessed the technology adopted as a layer to centralize multiple REST services with a more usable data retrieval mechanism for frontend engineers. Some GraphQL endpoints also run on the public web to serve end clients and external partners.

    “GraphQL is a beautiful technology, just lacking in security,” said Rustom. And unfortunately, his outlook for API security looks grim—amid political turmoil and economic instabilities in regions like Europe, some companies may seek to cut cybersecurity investments to stay lean. For companies that haven’t yet suffered a breach, security is easy to ditch to slim budgets, but it should remain a priority, said Rustom. “Keep securing GraphQL.”

  • Conjur up some agile, automated authorization management

    Conjur up some agile, automated authorization management

    One issue that has plagued IT since its inception is adding and removing authorized users. Most network and application security rely on somehow validating credentials to confirm that an individual is authorized to access the resources, but in a rapidly changing environment it is a serious challenge to keep authorization and authentication systems up to date. Conjur hopes to solve that problem.

    What is Conjur? In a nutshell, Conjur is an API-backed virtual appliance that makes cloud infrastructure projects possible by giving DevOps teams the ability to manage permissions and authorizations in a secure, automated, and well-audited way. In other words, Conjur allows for automated authorization management.

    Kevin O’Brien, part of the founding team at Conjur, shared some thoughts on Conjur, the issues the company seeks to address, and how Conjur can make life easier for DevOps teams. “As we’ve grown into the market, we’ve seen a lot of DevOps teams struggling with the same kind of authorizations problems, either slowing or killing cloud initiatives outright. For the ones that make it off the ground, they have to build a tangled web of handwritten scripts or hacked together key/certificate/user/access management inside of toolchains that are designed for other purposes (things like Puppet, Ansible, Docker, Chef, Salt, GitHub, etc.).”

    Conjur provides a dedicated platform for conducting authorizations without relying on insecure alternatives. Rather than trying to force old authorization technologies and ideas—like Active Directory—into a radically new environment—like an agile DevOps infrastructure, organizations can leverage Conjur.

    Conjur helps simplify and automate tasks like moving SSH keys out of insecure locations such as on-disk storage, or in Docker images, or GitHub repositories, and consolidating them on the secure, encrypted Conjur server. Conjur can manage secrets, including SSL certificates, across their entire lifecycle—from provisioning to replacement—with minimal downtime. And, Conjur maintains a comprehensive audit log of its activities.

    O’Brien relayed the story of one Conjur customer. This customer provides data analytics products for healthcare organizations, and solves complex computational problems with a focus on reducing health costs. The customer wanted to integrate DevOps concepts and culture into its business model, but ran into some stumbling blocks.

    “They were running into an issue where they wanted to begin using an AWS-based clustered genomics product, which would have allowed them to automate a large portion of their analytics, but were being told by their insurance payers that moving client data into that environment would be an impediment to doing business, because they couldn’t provide sufficiently granular access rights (the product used passwordless SSH keys),” explained O’Brien. “The insurance companies saw that as an ePHI issue, and absent a more sophisticated control and auditing, it was a no-go.”

    This company used Conjur to replace the default authorization mechanism in the project with a “Conjurized” access check, which allowed it to store the relevant keys in ephemeral storage and manage permissions through Conjur rather than by embedding them in code throughout their product set. Along with the audit capabilities, this meant that it had effectively taken a show-stopping design and circumvented it in a matter of weeks, without relying on key distribution or having to spend any time building an in-house solution.

    Conjur even has a solution dedicated to “DevOps and User Enablement.” O’Brien described it, “At a macro level, we’re solving a problem that is unique to DevOps and cloud: unlike the on-premise infrastructure of 20 years ago, protected by an Active Directory/LDAP system that handled authorization, role-based access control, and so on, there’s no way to translate that to the rapidly changing infrastructure that teams deal with today.”

    User enablement, in the end, is about driving innovation and speed. Conjur claims to make that possible (and more automated), without sacrificing security or auditability, or requiring a lot of custom work to use.