diff --git a/Dockerfile b/Dockerfile index f2912a6..a967c95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ FROM python:3.8.0-slim as builder RUN apt-get update -y \ && apt-get clean -y -WORKDIR /kubestrike +WORKDIR /kubestriker RUN pip install --upgrade pip \ && pip install prompt-toolkit==1.0.14 \ -&& pip install kubestrike +&& pip install kubestriker FROM python:3.8.0-slim LABEL maintainer="vasant kumar chinnipilli" COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages -COPY --from=builder /kubestrike /kubestrike -WORKDIR /kubestrike +COPY --from=builder /kubestriker /kubestriker +WORKDIR /kubestriker ENV PATH=/root/.local/bin:$PATH CMD ["bash"] diff --git a/LICENSE b/LICENSE index f352b83..3491566 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,201 @@ -MIT License - -Copyright (c) 2020 kubestrike - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2020] [vasant kumar chinnipilli] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 45083af..becb8c9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@


- +

A Blazing fast Security Auditing tool for Kuberentes!!

@@ -8,25 +8,23 @@ ![Python](https://img.shields.io/badge/python-v3.0+-blue.svg?style=plastic) ![Dependencies](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg?style=plastic) ![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg?style=plastic) -[![GitHub Issues](https://img.shields.io/github/issues/vchinnipilli/kubestrike?style=plastic)](https://github.com/vchinnipilli/kubestrike/issues) -![Downloads](https://img.shields.io/github/downloads/vchinnipilli/kubestrike/total?style=plastic) -![Release](https://img.shields.io/github/release-date/vchinnipilli/kubestrike?style=plastic) -![Stars Badge](https://img.shields.io/github/stars/vchinnipilli/kubestrike?style=plastic) -![Docker Pulls](https://img.shields.io/docker/pulls/cloudsecguy/kubestrike?style=plastic) -![Last Commit Date](https://img.shields.io/github/last-commit/vchinnipilli/kubestrike?style=plastic) -[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fvchinnipilli%2Fkubestrike&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=Visitors&edge_flat=false)](https://hits.seeyoufarm.com) -[![GitHub followers](https://img.shields.io/github/followers/vchinnipilli.svg?style=plastic&label=Follow&maxAge=2592000)](https://github.com/vchinnipilli?tab=followers) -[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=plastic)](https://github.com/vchinnipilli/kubestrike) +[![GitHub Issues](https://img.shields.io/github/issues/vchinnipilli/kubestriker?style=plastic)](https://github.com/vchinnipilli/kubestrike/issues) +![Release](https://img.shields.io/github/release-date/vchinnipilli/kubestriker?style=plastic) +![Stars Badge](https://img.shields.io/github/stars/vchinnipilli/kubestriker?style=plastic) +![Docker Pulls](https://img.shields.io/docker/pulls/cloudsecguy/kubestriker?style=plastic) +![Last Commit Date](https://img.shields.io/github/last-commit/vchinnipilli/kubestriker?style=plastic) +[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fvchinnipilli%2Fkubestriker&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=Visitors&edge_flat=false)](https://hits.seeyoufarm.com) +[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=plastic)](https://github.com/vchinnipilli/kubestriker) [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg?style=plastic)](https://www.python.org/) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=plastic)](https://opensource.org/licenses/MIT) ### Basic Overview -**Kubestrike** performs numerous in depth checks on kubernetes infra to identify the **security misconfigurations** and challenges that devops engineers/developers are likely to encounter when using Kubernetes, especially in production and at scale. +**Kubestriker** performs numerous in depth checks on kubernetes infra to identify the **security misconfigurations** and challenges that devops engineers/developers are likely to encounter when using Kubernetes, especially in production and at scale. -**kubestrike** is Platform agnostic and works equally well across more than one platform such as self hosted [kubernetes](https://kubernetes.io/), [Amazon EKS](https://aws.amazon.com/eks), [Azure AKS](https://azure.microsoft.com/en-us/services/kubernetes-service/), [Google GKE](https://cloud.google.com/kubernetes-engine) etc. +**kubestriker** is Platform agnostic and works equally well across more than one platform such as self hosted [kubernetes](https://kubernetes.io/), [Amazon EKS](https://aws.amazon.com/eks), [Azure AKS](https://azure.microsoft.com/en-us/services/kubernetes-service/), [Google GKE](https://cloud.google.com/kubernetes-engine) etc. -

+

### Table of content @@ -34,7 +32,7 @@ - [How To Install](#How-To-Install) - [Clone the repo and install](#Clone-the-repo-and-install) - [Install using pip](#Install-using-pip) - - [How to spin up kubestrike container](#How-to-spin-up-kubestrike-container) + - [How to spin up kubestriker container](#How-to-spin-up-kubestriker-container) - [Types of Scans](#Types-of-Scans) - [Authenticated scans](#Authenticated-scans) - [Unauthenticated scans](#Unauthenticated-scans) @@ -47,10 +45,10 @@ - [Statistics](#Statistics) - [License](#License) - [Support](#Support) -- [Find me here!! ](#Find-me-here-img-src%22httpsrawgithubusercontentcomvchinnipillikubestrikemastermediawavegif%22-width%2230px%22) +- [Find me here!! ](#Find-me-here-img-src%22httpsrawgithubusercontentcomvchinnipillikubestrikermastermediawavegif%22-width%2230px%22) -## How To Install +## How To Install ### Clone the repo and install @@ -67,10 +65,10 @@ $ python3 -m venv env $ source env/bin/activate # Clone this repository -$ git clone https://github.com/vchinnipilli/kubestrike.git +$ git clone https://github.com/vchinnipilli/kubestriker.git # Go into the repository -$ cd kubestrike +$ cd kubestriker # Install dependencies $ pip install -r requirements.txt @@ -79,8 +77,8 @@ $ pip install -r requirements.txt $ pip install prompt-toolkit==1.0.15 $ pip install -r requirements.txt -# Gearing up Kubestrike -$ python -m kubestrike +# Gearing up Kubestriker +$ python -m kubestriker # Result will be generated in the current working directory with the name of the target ``` @@ -98,37 +96,37 @@ $ python3 -m venv env $ source env/bin/activate # Install using pip -$ pip install kubestrike +$ pip install kubestriker # Incase of prompt toolkit or selectmenu errors $ pip install prompt-toolkit==1.0.15 -$ pip install kubestrike +$ pip install kubestriker -# Gearing up Kubestrike -$ python -m kubestrike +# Gearing up Kubestriker +$ python -m kubestriker # Result will be generated in the current working directory with the name of the target ``` -### How to spin up kubestrike container +### How to spin up kubestriker container -[Use this link to view the Kubestrike container latest releases](https://hub.docker.com/repository/docker/cloudsecguy/kubestrike) +[Use this link to view the Kubestrike container latest releases](https://hub.docker.com/repository/docker/cloudsecguy/kubestriker) ```bash -# Spinning up the kubestrike Container -$ docker run -it --rm -v /Users/vasantchinnipilli/.kube/config:/root/.kube/config -v "$(pwd)":/kubestrike --name kubestrike cloudsecguy/kubestrike:v1.0.1 +# Spinning up the kubestriker Container +$ docker run -it --rm -v /Users/vasantchinnipilli/.kube/config:/root/.kube/config -v "$(pwd)":/kubestriker --name kubestriker cloudsecguy/kubestriker:v1.0.0 # Replace the user vasantchinnipilli above with your username or absolute path of kube config file -$ docker run -it --rm -v /Users//.kube/config:/root/.kube/config -v "$(pwd)":/kubestrike --name kubestrike cloudsecguy/kubestrike:v1.0.1 +$ docker run -it --rm -v /Users//.kube/config:/root/.kube/config -v "$(pwd)":/kubestriker --name kubestriker cloudsecguy/kubestriker:v1.0.0 -# Gearing up Kubestrike -$ python -m kubestrike +# Gearing up Kubestriker +$ python -m kubestriker # Result will be generated in the current working directory with the name of the target ``` -

+

-## Types of Scans +## Types of Scans ### Authenticated scans **Authenticated scan** expects the user to have atleast **read-only** priviliges and provide a token during the scan. please use the below provided links to create read-only users @@ -159,12 +157,12 @@ $ cat /run/secrets/kubernetes.io/serviceaccount/token **Unauthenticated scan** will be successful incase of anonymous access is permitted on the target cluster #### Identifying an open Insecure port on kuberentes master node -

+

#### Identifying a worker Node with kubelet readwrite and readonly ports open -

+

-## Current Capabilities +## Current Capabilities * Scans Self Managed and cloud provider managed kuberentes infra * Reconnaissance phase checks for various services or open ports @@ -181,30 +179,30 @@ $ cat /run/secrets/kubernetes.io/serviceaccount/token * Elaborative report with detailed explanation -## Future improvements +## Future improvements * Automated exploitation based on the issues identified * api and cicd automation friendly * A Decent FrontEnd to make the lives easier -## Suggestions +## Suggestions -Kubestrike is an opensource and [emailware](https://en.wiktionary.org/wiki/emailware). Meaning, if you liked using this tool or it has helped you in any way or if you have any suggestions/improvements, I'd like you send me an email at about anything you'd want to say about this tool. I'd really appreciate it! +Kubestriker is an opensource and [emailware](https://en.wiktionary.org/wiki/emailware). Meaning, if you liked using this tool or it has helped you in any way or if you have any suggestions/improvements, I'd like you send me an email at about anything you'd want to say about this tool. I'd really appreciate it! -## Contributors +## Contributors -## Statistics +## Statistics - - + + - - + + -## License -**The MIT License** +## License +**Apache License** ## Support [vasant chinnipilli](https://cloudsecguy.dev) builds and maintains kubestrike to audit and secure kuberentes infrastructure. @@ -213,7 +211,7 @@ Start with [Documentation - will be available soon](https://cloudsecguy.dev) for If you need direct support you can contact me at vchinnipilli@gmail.com. -## Find me here!! +## Find me here!! [![cloudsecguy.dev](https://img.shields.io/badge/-https://www.cloudsecguy.dev-brightgreen?style=plastic&label=web:&logoColor=white&link=https://www.cloudsecguy.dev/)](https://www.cloudsecguy.dev/) [![Linkedin Badge](https://img.shields.io/badge/-vasantChinnipilli-blue?style=plastic&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/vasantreddy/)](https://www.linkedin.com/in/vasantreddy/) [![Instagram Badge](https://img.shields.io/badge/-vasantchinnipilli-orange?style=plastic&logo=instagram&logoColor=white&link=https://instagram.com/vasant_reddy/)](https://instagram.com/vasant_reddy) diff --git a/changelog.md b/changelog.md index e69de29..b2ab709 100644 --- a/changelog.md +++ b/changelog.md @@ -0,0 +1,25 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + + +## 1.1.0 (2021-01-15) + +### Fixes +* **Name:** Renamed the tool to Kubestriker +* **Logo:** Updated the Logo and Media + +### Features +* **Config File:** Server Names will be listed insted of url/IP addresses when default config file is chosen + + +## 1.0.0 (2020-12-14) + +### Features + +* **First-release:** The first release. diff --git a/contributing.md b/contributing.md index 4bf6d89..e72afb3 100644 --- a/contributing.md +++ b/contributing.md @@ -1,9 +1,9 @@ -

How to contribute to Kubestrike

+

How to contribute to Kubestriker


Hi there! we are thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. 🤝 -Please note that this project is released with a [Contributor Code of Conduct](https://raw.githubusercontent.com/kubestrike/kubestrike/master/code_of_conduct.md). By participating in this project you agree to abide by its terms. +Please note that this project is released with a [Contributor Code of Conduct](https://raw.githubusercontent.com/kubestriker/kubestriker/master/code_of_conduct.md). By participating in this project you agree to abide by its terms. ## Issues and PRs diff --git a/kubestrike/__init__.py b/kubestriker/__init__.py similarity index 100% rename from kubestrike/__init__.py rename to kubestriker/__init__.py diff --git a/kubestrike/__main__.py b/kubestriker/__main__.py similarity index 94% rename from kubestrike/__main__.py rename to kubestriker/__main__.py index 849c108..39592a6 100644 --- a/kubestrike/__main__.py +++ b/kubestriker/__main__.py @@ -5,12 +5,12 @@ from pyfiglet import Figlet from colored import fg, bg, attr, fore, style, stylize from selectmenu import SelectMenu -from kubestrike.validate_input import ValidateInput -from kubestrike.service_discovery import ServiceDiscovery -from kubestrike.service_hunt import ServiceHunt -from kubestrike.cmd_exec import cmd_exec -from kubestrike.bars import cowsay -from kubestrike.jwt_token_converter import decode_jwt_token_data +from kubestriker.validate_input import ValidateInput +from kubestriker.service_discovery import ServiceDiscovery +from kubestriker.service_hunt import ServiceHunt +from kubestriker.cmd_exec import cmd_exec +from kubestriker.bars import cowsay +from kubestriker.jwt_token_converter import decode_jwt_token_data menu = SelectMenu() @@ -52,11 +52,12 @@ def main(): input_file = input("Enter the full path of custom config file: ") else: input_file = 'default' - host_url_list = ValidateInput().config_file_to_host_list(input_file) - menu.add_choices(host_url_list) + cluster_list, host_url_map = ValidateInput().config_file_to_host_list(input_file) + menu.add_choices(cluster_list) print("") - result = menu.select("Choose one of the below url:") - host, port = ValidateInput().input_to_host(result) + result = menu.select("Choose one of the below cluster:") + host_url = host_url_map.get(result) + host, port = ValidateInput().input_to_host(host_url) if not host: cowsay("Input is not valid") return @@ -272,14 +273,14 @@ def get_git_version(end_point): if __name__ == '__main__': - x = (stylize((Figlet(font='slant', justify='center').renderText('>>>-kube-strike->')), fg("orange_1"))) + x = (stylize((Figlet(font='slant', justify='center').renderText('>>-kube-striker->')), fg("orange_1"))) print(stylize('\n ###########################################################################', fg("light_sky_blue_1"))) print(x) t = (stylize(' ###########################################################################', fg("light_sky_blue_1"))) print(t + fore.LIGHT_RED + ' v1.0.0\n' + style.RESET) - print(stylize('[+] Gearing up Kube-Strike......................................................\n', fg("green_1"))) + print(stylize('[+] Gearing up Kube-Striker..................................................\n', fg("green_1"))) try: main() except KeyboardInterrupt: diff --git a/kubestrike/apps_v1api.py b/kubestriker/apps_v1api.py similarity index 100% rename from kubestrike/apps_v1api.py rename to kubestriker/apps_v1api.py diff --git a/kubestrike/bars.py b/kubestriker/bars.py similarity index 100% rename from kubestrike/bars.py rename to kubestriker/bars.py diff --git a/kubestrike/batch_v1api.py b/kubestriker/batch_v1api.py similarity index 100% rename from kubestrike/batch_v1api.py rename to kubestriker/batch_v1api.py diff --git a/kubestrike/cmd_exec.py b/kubestriker/cmd_exec.py similarity index 100% rename from kubestrike/cmd_exec.py rename to kubestriker/cmd_exec.py diff --git a/kubestrike/core_v1api.py b/kubestriker/core_v1api.py similarity index 100% rename from kubestrike/core_v1api.py rename to kubestriker/core_v1api.py diff --git a/kubestrike/extensions_v1beta1api.py b/kubestriker/extensions_v1beta1api.py similarity index 100% rename from kubestrike/extensions_v1beta1api.py rename to kubestriker/extensions_v1beta1api.py diff --git a/kubestrike/jwt_token_converter.py b/kubestriker/jwt_token_converter.py similarity index 100% rename from kubestrike/jwt_token_converter.py rename to kubestriker/jwt_token_converter.py diff --git a/kubestrike/kubelet.py b/kubestriker/kubelet.py similarity index 100% rename from kubestrike/kubelet.py rename to kubestriker/kubelet.py diff --git a/kubestrike/kubelet_ro.py b/kubestriker/kubelet_ro.py similarity index 96% rename from kubestrike/kubelet_ro.py rename to kubestriker/kubelet_ro.py index 8e9139d..786f20c 100644 --- a/kubestrike/kubelet_ro.py +++ b/kubestriker/kubelet_ro.py @@ -1,5 +1,5 @@ import requests -from kubestrike.bars import prefix, sub_prefix, service_open +from kubestriker.bars import prefix, sub_prefix, service_open class Kubelet_RO(object): diff --git a/kubestrike/kubelet_rw.py b/kubestriker/kubelet_rw.py similarity index 96% rename from kubestrike/kubelet_rw.py rename to kubestriker/kubelet_rw.py index 6067259..1cd5b4e 100644 --- a/kubestrike/kubelet_rw.py +++ b/kubestriker/kubelet_rw.py @@ -1,5 +1,5 @@ import requests -from kubestrike.bars import prefix, sub_prefix, service_open +from kubestriker.bars import prefix, sub_prefix, service_open class Kubelet_RW(object): diff --git a/kubestrike/policy_v1beta1api.py b/kubestriker/policy_v1beta1api.py similarity index 100% rename from kubestrike/policy_v1beta1api.py rename to kubestriker/policy_v1beta1api.py diff --git a/kubestrike/psp_role.py b/kubestriker/psp_role.py similarity index 99% rename from kubestrike/psp_role.py rename to kubestriker/psp_role.py index fb787cd..dd7bec9 100644 --- a/kubestrike/psp_role.py +++ b/kubestriker/psp_role.py @@ -1,4 +1,4 @@ -from kubestrike.bars import prefix +from kubestriker.bars import prefix class PspRole(object): def __init__(self): diff --git a/kubestrike/pvl_containers.py b/kubestriker/pvl_containers.py similarity index 99% rename from kubestrike/pvl_containers.py rename to kubestriker/pvl_containers.py index 842d926..8821ebf 100644 --- a/kubestrike/pvl_containers.py +++ b/kubestriker/pvl_containers.py @@ -1,6 +1,6 @@ # Read data from files import json -from kubestrike.bars import prefix +from kubestriker.bars import prefix dangerous_caps = [ "*", "DAC_READ_SEARCH", "LINUX_IMMUTABLE", "NET_BROADCAST", "NET_ADMIN", "IPC_LOCK", "IPC_OWNER", diff --git a/kubestrike/rbac_authorization_v1api.py b/kubestriker/rbac_authorization_v1api.py similarity index 100% rename from kubestrike/rbac_authorization_v1api.py rename to kubestriker/rbac_authorization_v1api.py diff --git a/kubestrike/service_discovery.py b/kubestriker/service_discovery.py similarity index 99% rename from kubestrike/service_discovery.py rename to kubestriker/service_discovery.py index f198f63..47cf8c3 100644 --- a/kubestrike/service_discovery.py +++ b/kubestriker/service_discovery.py @@ -1,6 +1,6 @@ import socket import warnings -from kubestrike.bars import prefix, sub_prefix, service_open, print_msg_box +from kubestriker.bars import prefix, sub_prefix, service_open, print_msg_box warnings.filterwarnings("ignore") diff --git a/kubestrike/service_hunt.py b/kubestriker/service_hunt.py similarity index 97% rename from kubestrike/service_hunt.py rename to kubestriker/service_hunt.py index 4fe5d36..35fcb7e 100644 --- a/kubestrike/service_hunt.py +++ b/kubestriker/service_hunt.py @@ -2,18 +2,18 @@ from colored import stylize import yaml from colored import fg -from kubestrike.rbac_authorization_v1api import RbacAuthorizationV1Api -from kubestrike.validate_roles import Validate_Roles -from kubestrike.core_v1api import CoreV1Api -from kubestrike.apps_v1api import AppsV1Api -from kubestrike.policy_v1beta1api import PolicyV1beta1Api -from kubestrike.pvl_containers import PvlContainers -from kubestrike.psp_role import PspRole -from kubestrike.extensions_v1beta1api import ExtensionsV1beta1Api -from kubestrike.jwt_token_converter import decode_jwt_token_data -from kubestrike.bars import prefix, scan_status, service_open, resource_available, print_msg_box -from kubestrike.kubelet_ro import Kubelet_RO -from kubestrike.kubelet_rw import Kubelet_RW +from kubestriker.rbac_authorization_v1api import RbacAuthorizationV1Api +from kubestriker.validate_roles import Validate_Roles +from kubestriker.core_v1api import CoreV1Api +from kubestriker.apps_v1api import AppsV1Api +from kubestriker.policy_v1beta1api import PolicyV1beta1Api +from kubestriker.pvl_containers import PvlContainers +from kubestriker.psp_role import PspRole +from kubestriker.extensions_v1beta1api import ExtensionsV1beta1Api +from kubestriker.jwt_token_converter import decode_jwt_token_data +from kubestriker.bars import prefix, scan_status, service_open, resource_available, print_msg_box +from kubestriker.kubelet_ro import Kubelet_RO +from kubestriker.kubelet_rw import Kubelet_RW warnings.filterwarnings("ignore") diff --git a/kubestrike/validate_input.py b/kubestriker/validate_input.py similarity index 92% rename from kubestrike/validate_input.py rename to kubestriker/validate_input.py index 9b91cb0..e2e8460 100644 --- a/kubestrike/validate_input.py +++ b/kubestriker/validate_input.py @@ -67,6 +67,7 @@ def input_to_host(self, input_host): def config_file_to_host_list(self, file): host_list = [] + host_map = {} if file == 'default': file_full_path = f'{str(Path.home())}/.kube/config' else: @@ -75,5 +76,6 @@ def config_file_to_host_list(self, file): file_data = file.read() file_data = yaml.safe_load(file_data) for cluster_data in file_data.get('clusters'): - host_list.append(cluster_data.get('cluster').get('server')) - return host_list + host_list.append(cluster_data.get('name')) + host_map.update({cluster_data.get('name'): cluster_data.get('cluster').get('server')}) + return host_list, host_map diff --git a/kubestrike/validate_roles.py b/kubestriker/validate_roles.py similarity index 99% rename from kubestrike/validate_roles.py rename to kubestriker/validate_roles.py index 58c6a66..35fe566 100644 --- a/kubestrike/validate_roles.py +++ b/kubestriker/validate_roles.py @@ -1,5 +1,5 @@ import json -from kubestrike.bars import prefix, sub_prefix,service_open, resource_available, print_msg_box +from kubestriker.bars import prefix, sub_prefix,service_open, resource_available, print_msg_box class Validate_Roles(object): def __init__(self,file_obj=None): diff --git a/media/docker.gif b/media/docker.gif index c57bf7e..01e889d 100644 Binary files a/media/docker.gif and b/media/docker.gif differ diff --git a/media/insecure_port.gif b/media/insecure_port.gif index 30e4a5e..9350f24 100644 Binary files a/media/insecure_port.gif and b/media/insecure_port.gif differ diff --git a/media/kube-strike.png b/media/kube-strike.png deleted file mode 100644 index 3babc11..0000000 Binary files a/media/kube-strike.png and /dev/null differ diff --git a/media/kube-striker.png b/media/kube-striker.png new file mode 100644 index 0000000..b2c7b9d Binary files /dev/null and b/media/kube-striker.png differ diff --git a/media/name_black.png b/media/name_black.png deleted file mode 100644 index aaa0bb3..0000000 Binary files a/media/name_black.png and /dev/null differ diff --git a/media/name_red.png b/media/name_red.png deleted file mode 100644 index 5732f36..0000000 Binary files a/media/name_red.png and /dev/null differ diff --git a/media/node_scan.gif b/media/node_scan.gif index 1d726bd..ea24348 100644 Binary files a/media/node_scan.gif and b/media/node_scan.gif differ diff --git a/media/pip-install.gif b/media/pip-install.gif index b5b80b8..82d7980 100644 Binary files a/media/pip-install.gif and b/media/pip-install.gif differ diff --git a/setup.py b/setup.py index 5708b60..14309b2 100644 --- a/setup.py +++ b/setup.py @@ -7,24 +7,24 @@ requirements = f.read().splitlines() setuptools.setup( - name="kubestrike", - version="v1.0", + name="kubestriker", + version="v1.0.0", author="vasant chinnipilli", author_email="vchinnipilli@gmail.com.com", description="A Blazing fast Security Auditing tool for Kuberentes", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/vchinnipilli/kubestrike", + url="https://github.com/vchinnipilli/kubestriker", packages=setuptools.find_packages(), - python_requires='>=3.0', - install_requires=requirements, classifiers=[ 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Operating System :: OS Independent', - 'License :: OSI Approved :: MIT License', + 'License :: OSI Approved :: Apache Software License', 'Topic :: Security', 'Topic :: Software Development :: Testing' - ] + ], + python_requires='>=3.0', + install_requires=requirements )