quarta-feira, 31 de maio de 2023

Automating REST Security Part 1: Challenges

Although REST has been a dominant choice for API design for the last decade, there is still little dedicated security research on the subject of REST APIs. The popularity of REST contrasts with a surprisingly small number of systematic approaches to REST security analysis. This contrast is also reflected in the low availability of analysis tools and best security practices that services may use to check if their API is secure.

In this blog series, we try to find reasons for this situation and what we can do about it. In particular, we will investigate why general REST security assessments seem more complicated than other API architectures. We will likewise discuss how we may still find systematic approaches for REST API analysis despite REST's challenges. Furthermore, we will present REST-Attacker, a novel analysis tool designed for automated REST API security testing. In this context, we will examine some of the practical tests provided by REST-Attacker and explore the test results for a small selection of real-world API implementations.

Author

Christoph Heine

Overview

 Understanding the Problem with REST

When evaluating network components and software security, we often rely on specifications for how things should work. For example, central authorities like the IETF standardize many popular web technologies such as HTTP, TLS or DNS. API architectures and designs can also be standardized. Examples of these technologies are SOAP and the more recent GraphQL language specification. Standardization of web standards usually influences their security. Drafting may involve a public review process before publication. This process can identify security flaws or allow the formulation of official implementation and usage best practices. Best practices are great for security research as a specification presents clear guidelines on how an implementation should behave and why.

The situation for REST is slightly different. First of all, REST is not a standard in the sense that there is no technical specification for its implementation. Instead, REST is an architecture style which is more comparable to a collection of paradigms (client-server architecture, statelessness, cacheability, uniform interface, layering, and code-on-demand). Notably, REST has no strict dependency on other web technologies. It only defines how developers should use components but not what components they should use. This paradigm makes REST very flexible as developers are not limited to any particular protocol, library, or data structure.

Furthermore, no central authority could define rules or implementation guidelines. Roy Fielding created the original definition of REST as a design template for the HTTP/1.1 standard in 2000. It is the closest document resembling a standard. However, the document merely explains the REST paradigms and does not focus on security implications.

The flexibility of the REST architecture is probably one of the primary reasons why security research can be challenging. If every implementation is potentially different, how are we supposed to create common best practices, let alone test them consistently across hundreds of APIs? Fortunately for us, not every API tries to reinvent the wheel entirely. In practice, there are a lot of similarities between implementations that may be used to our advantage.

Generalizing REST Security

The most glaring similarity between REST API implementations is that most, if not all, are based on HTTP. If you have worked with REST APIs before, this statement might sound like stating the obvious. However, remember that REST technically does not require a specific protocol. Assuming that every REST API uses HTTP, we can use it as a starting point for a generalization of REST API security. Knowing that we mainly deal with HTTP is also advantageous because HTTP - unlike REST - is standardized. Although HTTP is still complex, it gives us a general idea of what we can expect.

Another observation is that REST API implementations reuse several standardized components in HTTP for API communication. Control parameters and actions in an API request are mapped to components in a generic HTTP request. For example, a resource that an API request operates on, is specified via the HTTP URL. Actions or operations on the said resource are identified and mapped to HTTP methods defined by the HTTP standard, usually GET, POST, DELETE, PUT, and PATCH. API operations retain their intended action from HTTP, i.e., GET retrieves a resource, DELETE removes a resource, and so on. In REST API documentation, we can often find a description of available API endpoints using HTTP "language":

Since the URL and the HTTP method are sufficient to build a basic HTTP request, we can potentially create an API requests if we know a list of REST endpoints. In practice, the construction of such requests can be more complicated because the API may have additional parameter requirements for their requests, e.g., query, header, or body content. Another problem is finding valid IDs of resources can be difficult. Interestingly, we can infer each endpoint's action based on the HTTP method, even without any context-specific knowledge about the API.

We can also find components taken from the HTTP standard in the API response. The requested operation's success or failure is usually indicated using HTTP status codes. They retain their meaning when used in REST APIs. For example, a 200 status code indicates success, while a 401 status code signifies missing authorization (in the preceding API request). This behavior again can be inferred without knowing the exact purpose of the API.

Another factor that influences REST's complexity is its statelessness paradigm. Essentially, statelessness requires that the server does not keep a session between individual requests. As a result, every client request must be self-contained, so multi-message operations are out of the picture. It also effectively limits interaction with the API to two HTTP messages: client request and server response. Not only does this make API communication easier to comprehend, but it also makes testing more manageable since we don't have to worry as much about side effects or keeping track of an operations state.

Implementing access control mechanisms can be more complicated, but we can still find general similarities. While REST does not require any particular authentication or authorization methods, the variety of approaches found in practice is small. REST API implementations usually implement a selection of these methods:

  • HTTP Basic Authentication (user authentication)
  • API keys (client authentication)
  • OAuth2 (authorization)

Two of these methods, OAuth2 and HTTP Basic Authentication, are standardized, while API keys are relatively simple to handle. Therefore, we can generalize access control to some degree. However, access control can be one of the trickier parts of API communication as there may be a lot of API-specific configurations. For example, OAuth2 authorization allows the API to define multiple access levels that may be required to access different resources or operations. How access control data is delivered in the HTTP message may also depend on the API, e.g., by requiring encoding of credentials or passing them in a specified location of the HTTP message (e.g. header, query, or body).

Finding a Systematic Approach for REST API Analysis

So far, we've only discussed theoretical approaches scatching a generic REST API analysis. For implementing an automated analysis tool, we need to adopt the hints that we used for our theoretical API analyses to the tool. For example, the tool would need to know which API endpoints exist to create API requests on its own.

The OpenAPI specification is a popular REST API description format that can be used for such purpose. An OpenAPI file contains a machine-readable definition (as JSON or YAML) of an API's interface. Basic descriptions include the definition of the API endpoints, but can optionally contain much more content and other types of useful information. For example, an endpoint definition may include a list of required parameters for requests, possible response codes and content schemas of API responses. The OpenAPI can even describe security requirements that define what types of access control methods are used.

{     "openapi": "3.1.0",     "info": {         "title": "Example API",         "version": "1.0"     },     "servers": [         {             "url": "http://api.example.com"         }     ],     "paths": {         "/user/info": {             "get": {                 "description": "Returns information about a user.",                 "parameters": [                     {                     "name": "id",                     "in": "query",                     "description": "User ID",                     "required": true                     }                 ],                 "responses": {                     "200": {                         "description": "User information.",                         "content": {                             "application/json": {                                 "schema": {                                     "type": "object",                                     "items": {                                         "$ref": "#/components/schemas/user_info"                                     }                                 }                             }                         }                     }                 }             }         }     },     "security": [         {             "api_key": []         }     ] } 

As you can see from the example above, OpenAPI files allow tools to both understand the API and use the available information to create valid API requests. Furthermore, the definition can give insight into the expected behavior of the API, e.g., by checking the response definitions. These properties make the OpenAPI format another standard on which we can rely. Essentially, a tool that can parse and understand OpenAPI can understand any generic API. With the help of OpenAPI, tools can create and execute tests for APIs automatically. Of course, the ability of tools to derive tests still depends on how much information an OpenAPI file provides. However, wherever possible, automation can potentially eliminate a lot of manual work in the testing process.

Conclusion

When we consider the similarities between REST APIs and OpenAPI descriptions, we can see that there is potential for analyzing REST security with tools. Our next blog post discusses how such an implementation would look like. We will discuss REST-Attacker, our tool for analyzing REST APIs.

Further Reading

The feasibility of tool-based REST analysis has also been discussed in scientific papers. If you want to know more about the topic, you can start here:

  • Atlidakis et al., Checking Security Properties of Cloud Service REST APIs (DOI Link)
  • Lo et al., On the Need for a General REST-Security Framework (DOI Link)
  • Nguyen et al., On the Security Expressiveness of REST-Based API Definition Languages (DOI Link)

Acknowledgement

The REST-Attacker project was developed as part of a master's thesis at the Chair of Network & Data Security of the Ruhr University Bochum. I would like to thank my supervisors Louis Jannett, Christian Mainka, Vladislav Mladenov, and Jörg Schwenk for their continued support during the development and review of the project.

Related links

  1. Hack Apps
  2. Hack Tool Apk No Root
  3. Pentest Recon Tools
  4. Android Hack Tools Github
  5. Termux Hacking Tools 2019
  6. Pentest Tools Tcp Port Scanner
  7. Hack Website Online Tool
  8. Hack Tools For Windows
  9. Beginner Hacker Tools
  10. Pentest Box Tools Download
  11. Top Pentest Tools
  12. Underground Hacker Sites
  13. Hacking Tools Pc
  14. Hack Tools Pc
  15. Pentest Tools For Windows
  16. Hack Tools Online
  17. Pentest Tools Website
  18. Pentest Tools Bluekeep
  19. Hack Tools For Pc
  20. Termux Hacking Tools 2019
  21. Hack Tools Github
  22. Computer Hacker
  23. Hacker Hardware Tools
  24. Hacking Tools Software
  25. Kik Hack Tools
  26. World No 1 Hacker Software
  27. Pentest Tools Framework
  28. Hacker Tools Apk Download
  29. Usb Pentest Tools
  30. Nsa Hack Tools Download
  31. Hack Tools
  32. Hacking Tools For Windows Free Download
  33. Tools For Hacker
  34. Hacking Tools 2020
  35. Wifi Hacker Tools For Windows
  36. Hacker Search Tools
  37. Hacking Tools Windows
  38. Hak5 Tools
  39. Pentest Tools Framework
  40. Hacker Tools Free Download
  41. Hacking Tools
  42. Game Hacking
  43. Hacking Tools For Mac
  44. Hacking Tools Pc
  45. Hack Tools For Windows
  46. Best Hacking Tools 2020
  47. Hack Tools For Mac
  48. New Hacker Tools
  49. Pentest Tools Review
  50. Hack Tools
  51. Nsa Hack Tools
  52. Hacker Tools Apk Download
  53. Pentest Tools Download
  54. Hacking Tools For Windows 7
  55. Hacking Tools For Windows 7
  56. Pentest Tools Linux
  57. Growth Hacker Tools
  58. Pentest Tools Website Vulnerability
  59. Hacking Tools Online
  60. Hack Tools
  61. Android Hack Tools Github
  62. Hacking Tools Free Download
  63. Free Pentest Tools For Windows
  64. Pentest Tools Github
  65. Pentest Tools Free
  66. How To Hack
  67. Tools For Hacker
  68. Top Pentest Tools
  69. Hacker Tools For Mac
  70. Hacker Tools Free Download
  71. Hacking Tools Pc
  72. Hack Tools 2019
  73. Hacking Tools Online
  74. Wifi Hacker Tools For Windows
  75. Hack Tool Apk
  76. Nsa Hack Tools Download

How To Start | How To Become An Ethical Hacker

Are you tired of reading endless news stories about ethical hacking and not really knowing what that means? Let's change that!
This Post is for the people that:

  • Have No Experience With Cybersecurity (Ethical Hacking)
  • Have Limited Experience.
  • Those That Just Can't Get A Break


OK, let's dive into the post and suggest some ways that you can get ahead in Cybersecurity.
I receive many messages on how to become a hacker. "I'm a beginner in hacking, how should I start?" or "I want to be able to hack my friend's Facebook account" are some of the more frequent queries. Hacking is a skill. And you must remember that if you want to learn hacking solely for the fun of hacking into your friend's Facebook account or email, things will not work out for you. You should decide to learn hacking because of your fascination for technology and your desire to be an expert in computer systems. Its time to change the color of your hat 😀

 I've had my good share of Hats. Black, white or sometimes a blackish shade of grey. The darker it gets, the more fun you have.

If you have no experience don't worry. We ALL had to start somewhere, and we ALL needed help to get where we are today. No one is an island and no one is born with all the necessary skills. Period.OK, so you have zero experience and limited skills…my advice in this instance is that you teach yourself some absolute fundamentals.
Let's get this party started.
  •  What is hacking?
Hacking is identifying weakness and vulnerabilities of some system and gaining access with it.
Hacker gets unauthorized access by targeting system while ethical hacker have an official permission in a lawful and legitimate manner to assess the security posture of a target system(s)

 There's some types of hackers, a bit of "terminology".
White hat — ethical hacker.
Black hat — classical hacker, get unauthorized access.
Grey hat — person who gets unauthorized access but reveals the weaknesses to the company.
Script kiddie — person with no technical skills just used pre-made tools.
Hacktivist — person who hacks for some idea and leaves some messages. For example strike against copyright.
  •  Skills required to become ethical hacker.
  1. Curosity anf exploration
  2. Operating System
  3. Fundamentals of Networking
*Note this sites





Related news

OWASP May Connector 2019

OWASP
Connector
May 2019

COMMUNICATIONS


Letter from the Vice Chairman:

Dear OWASP Community,

Since last month the foundation has been busy working towards enabling our project leaders and community members to utilize funds to work on nurturing and developing projects. So far there has been huge uptake on this initiative. It's great to see so many people passionate about collaborating at project summits. 
 
Our Global AppSec Tel-Aviv is nearly upon us, for members, there is an extra incentive for attending this conference, in the form of a significant discount. This and the sandy beaches and beautiful scenery, not to mention the great speakers and trainers we have lined up, is a great reason to attend. If you have not done so we would encourage you to attend this great conference - https://telaviv.appsecglobal.org.
 
One of the key things I've noticed in my Board of Director tenure is the passion our community emits, sometimes this passion aids in growing the foundation, but sometimes it also forces us to take a step back and look at how we do things within the foundation. With Mike, our ED and staff we have seen a lot of good change from an operations perspective, with more in the pipeline. Mike's appointment has allowed the Board of Directors to take a step back from operations and enable us to work on more strategic goals. To this end at a recent Board meeting we discussed each Board member taking up one of the following strategic goals, as set out at the start of the year:
 
1.Marketing the OWASP brand 
2.Membership benefits
3.Developer outreach

  • Improve benefits 
  • Decrease the possibility of OWASP losing relevance
  • Reaching out to management and Risk levels
  • Increase involvement in new tech/ ways of doing things – dev ops
 
4.Project focus 
  • Get Universities involved
  • Practicum sponsored ideas
  • Internships 

 
5.Improve finances
6.Improve OWAP/ Board of Directors Perception
7.Process improvement
8. Get consistent ED
9.Community empowerment
 
I would encourage the community to come forward if you have any ideas on the above and are happy to work with one of the 7 Board of Directors and community members on one of these initiatives. 
 
Thanks and best wishes, 
Owen Pendlebury
Vice Chair

OWASP FOUNDATION UPDATE FROM INTERIM EXECUTIVE DIRECTOR:

OWASP Foundation welcomes aboard Emily Berman as Events Director. Emily was most recently with the Scrum Alliance where she planned high-profile functions for upwards of 2,000 guests. Emily brings a fresh approach to events planning and her 12 years of experience planning and organizing large-scale events worldwide well in advance will greatly benefit our Global AppSecs.
Did you Register yet? 
Global AppSec DC September 9-13, 2019
submit to the Call for Papers and Call for Training
Check out Sponsorship Opportunities while they are still available.
Save the Date for Global AppSec Amsterdam Sept 23-27, 2019 
Sponsorship Opportunities are available

EVENTS 

You may also be interested in one of our other affiliated events:

REGIONAL AND LOCAL EVENTS

Event Date Location
Latam Tour 2019 Starting April 4, 2019 Latin America
OWASP Portland Training Day September 25, 2019 Portland, OR
OWASP Italy Day Udine 2019 September 27,2019 Udine, Italy
OWASP Portland Day October 16,2019 Wroclaw, Poland
LASCON X October 24-25,2019 Austin, TX
OWASP AppSec Day 2019 Oct 30 - Nov 1, 2019 Melbourne, Australia

PARTNER AND PROMOTIONAL EVENTS
Event Date Location
Open Security Summit June 3-7,2019 Woburn Forest Center Parcs, Bedfordshire
Hack in Paris 2019 June 16-20, 2019 Paris
Cyber Security and Cloud Expo Europe June 19-20, 2019 Amsterdam
IoT Tech Expo Europe June 19-20, 2019 Amsterdam
BlackHat USA 2019 August 3-8,2019 Las Vegas, Nevada
DefCon 27 August 8-11,2019 Las Vegas, Nevada
it-sa-IT Security Expo and Congress October 8-10, 2019 Germany

PROJECTS

We have had the following projects added to the OWASP inventory.  Please congratulate these leaders and check out the work they have done:

Project Type Leader(s)
Risk Assessment Framework Documentation Ade Yoseman Putra, Rejah Rehim
QRLJacker Tool Mohammed Baset
Container Security Verification Standard Documentation Sven Vetsch
Find Security Bugs Code Philippe Arteau
Vulnerable Web Application Code Fatih Çelik
D4N155 Tool Julio Pedro de Lira Neto
Jupiter Tool Matt Stanchek
Top 10 Card Game Documentation Dennis Johnson
Samurai WTF Code Kevin Johnson
DevSecOps Maturity Model Documentation Timo Pagel

 


Also, we will have the following projects presenting at the Project Showcase Global AppSec Tel Aviv:

Final Schedule
Wednesday, May 29th Thursday, May 30th
Time Project Presenter(s) Confirmed Time Project Presenter(s) Confirmed
10:​4​5 a.m. Glue Tool Omer Levi Hevroni Yes 10:​30 ​ a.m. API Security Erez Yalon, Inon Shkedy Yes
  ​7    
               
11:5​5​ a.m. IoT & Embedded AppSec Aaron Guzman Yes 11:​50​ a.m. Mod Security Core Rule Set Tin Zaw Yes
        12:​25 ​p.m. Automated Threats Tin Zaw Yes
12:​30 ​p.m. Lunch Break   12:​55​ p.m. Lunch Break  
2:​35​ p.m. SAMM John DiLeo Yes        
​3:10​ p.m. Application Security Curriculum John DiLeo Yes ​3:10 p.m. ​Damned Vulnerable Serveless Application​ ​Tal Melamed​ ​Yes​
 

Finally, if you are able to help participate in the Project Reviews at the Conference, please send me an email at harold.blankenship@owasp.com.  We have a large line-up of projects to review this time around:

Project To Level Leader(s)
Snakes and Ladders Flagship Katy Anton, Colin Watson
Cheat Sheet Series Flagship Dominique Righetto, Jim Manico
Mobile Security Testing Guide Flagship Jeroen Willemsen, Sven Schleier
Amass Lab Jeff Foley
Attack Surface Detector Lab Ken Prole
SecureTea Lab Ade Yoseman Putra, Bambang Rahmadi K.P, Rejah Rehim.A.A
Serverless Goat Lab Ory Segal

Google Summer of Code Update:
We were allocated 13 students this year!  The current timeline is as follows:
Google Season of Docs:
We were accepted into the Google Season of Docs.  There will be a single technical writer resource.  The current timeline is as follows:

COMMUNITY

New OWASP Chapters
Riyadh, Saudi Arabia
Guayaquil, Equador
Lome, Togo
Natal, Brazil
Nashua, New Hampshire
Gwalior, India
Louisville, Kentucky
Nainital, India
Liverpool, United Kingdom
Syracuse, New York

MEMBERSHIP

 
We would like to welcome the following Premier and Contributor Corporate Members.

Premier Corporate Members

Contributor Corporate Members
Join us
Donate
Our mailing address is:
OWASP Foundation 
1200-C Agora Drive, # 232
Bel Air, MD 21014  
Contact Us
Unsubscribe






This email was sent to *|EMAIL|*
why did I get this?    unsubscribe from this list    update subscription preferences
*|LIST:ADDRESSLINE|*