Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Advanced Infrastructure Penetration Testing

You're reading from  Advanced Infrastructure Penetration Testing

Product type Book
Published in Feb 2018
Publisher Packt
ISBN-13 9781788624480
Pages 396 pages
Edition 1st Edition
Languages

Table of Contents (14) Chapters

Preface 1. Introduction to Advanced Infrastructure Penetration Testing 2. Advanced Linux Exploitation 3. Corporate Network and Database Exploitation 4. Active Directory Exploitation 5. Docker Exploitation 6. Exploiting Git and Continuous Integration Servers 7. Metasploit and PowerShell for Post-Exploitation 8. VLAN Exploitation 9. VoIP Exploitation 10. Insecure VPN Exploitation 11. Routing and Router Vulnerabilities 12. Internet of Things Exploitation 13. Other Books You May Enjoy

Exploiting Git and Continuous Integration Servers

Continuous integration (CI) and Continuous delivery (CD) are becoming two major parts of modern software development. This chapter is an amazing opportunity to discover how to secure CI servers. We are going to start with refreshers about software development methodologies and CI. In addition to learning how to build a CI environment from scratch, we will discover what it takes to secure CI and CD pipelines.

Software development methodologies

A software project, like any project, needs to go through well-defined steps to be well-managed. In order to ensure efficient project management, a software development project requires a number of steps:

  1. Requirements
  2. Design
  3. Implementation
  4. Verification
  5. Maintenance

The steps are shown here:

The previous steps are carried out through different methods, according to business requirements. There are many development methodologies:

  • Waterfall methodology: This is a linear and sequential methodology; there is no turning back in it.
  • Prototyping methodology: In this methodology, the product is built and tested again and again.
  • Spiral methodology: This methodology is risky and costly to use as it is done by iterating the development processes (objectives identification, alternatives, constraints, and planning).
  • Agile methodologies: Agile methodologies...

Continuous integration

CI is a software development practice where developers have the chance to integrate their code many times a day before waiting for the end of the project. Nowadays, CI is a key practice in every software project. These frequent check-ins solve the classic integration headaches, and they allow developers and CI adopters the following benefits:

  • Error detection in a short period of time
  • Detecting and locating issues easily
  • Delivering software products faster

CI adoption is a major step for avoiding tense integrations, and it delivers software in time because inaccurate time and effort estimates are main causes of a failed project, in addition to the lack of effective communication at all levels. CI is based on automation. Automation is an integral aspect of CI. Thus, automation of the tests will ensure faster development and in product-to-market time.

...

Continuous integration with GitHub and Jenkins

We have had an overview of development methodologies and the different product life cycle processes. Now let's learn how to build a real-world CI environment using GitHub and the Jenkins CI server, illustrated here:

Jenkins is an open source automation server. Thanks to its ability to automate tasks, it can perform CI. You can download it from https://jenkins.io/:

Installing Jenkins

During the demonstration, we are going to use an Ubuntu 16.04 machine. To install Jenkins, you need to add the repository key, add the Jenkins Debian package repository to the sources.list file using the echo command, and update the sources.list file by typing:

apt-get update

Now, install Jenkins...

Continuous integration attacks

Like any modern organization, precious assets, continuous integrations, and CD servers are high targets because they represent good entry points for compromising production systems. There are many dangerous attacks that threaten CI servers. The following are some examples of CI/CD server attacks:

  • Reverse shell using CI
  • Unauthorized commit to master
  • Jenkins-CI Script-Console Java Execution

Continuous integration server penetration testing

Securing CI and CD servers is essential. Establishing security controls is critical to securing the pipelines, as they are a bridge between the source code and the production servers.

Rotten Apple project for testing continuous integration or continuous delivery system security

The Rotten Apple project is an open source project developed with the aim of giving developers and penetration testers an easy and efficient experience when testing CI servers, by delivering various features and capabilities.

You can clone the project from its GitHub repository by typing sudo git clone https://github.com/claudijd/rotten_apple.

...

Summary

This chapter was an overview of the hidden power of CI servers and their benefits for enterprises. Thus, we discovered how to build a CI environment step by step and learned what it takes to secure CI/CD servers. The next chapter will take you on an intensive journey where you will learn how Metasploit and PowerShell are used to attack organization infrastructures.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Advanced Infrastructure Penetration Testing
Published in: Feb 2018 Publisher: Packt ISBN-13: 9781788624480
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime}