• This repository has been archived on 11/Dec/2019
  • Stars
    star
    192
  • Rank 195,149 (Top 4 %)
  • Language
    HTML
  • License
    GNU Affero Genera...
  • Created almost 7 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kubernetes Auto Analyzer

Archived

This project is not under active development at the moment and hasn't been updated in some time, so has been archived. Consider using Aqua's Kube-Bench and/or kube-hunter to achieve similar goals.

Kubernetes Auto Analyzer

This is a Kubernetes Security configuration review tool it's designed to automate the process of checking specific items on cluster security.

It also has some ability to audit against the CIS Kubernetes benchmark, however this isn't really mantained at the moment, so if this is a feature you need, consider checking out Aqua's Kube-Bench

Getting Started

There's two ways to run the analyzer either as a ruby gem or using docker.

Docker

Unsurprisingly there's an image on Docker hub. To run you'll need to put the config file (if you're using one) in a directory that can be accessed by the docker container and then mount it as a volume to /data in the container e.g.

docker run -v /data:/data raesene/kube_auto_analyzer -c /data/admin.conf -r testdock

Ruby Gem

Pre-requisites

For the gem install you'll need some development libs to get it working. In general a ruby version of 2.1+ and the ruby-dev and build-essential packages should work on debian based distributions. For Amazon Linux this set of commands should work

sudo yum groupinstall "Development Tools"
sudo yum install ruby24 ruby24-devel
sudo alternatives --set ruby /usr/bin/ruby2.4
gem install kube_auto_analyzer

Gem Install

To install the ruby gem , just do gem install kube_auto_analyzer and that should put the kubeautoanalyzer command onto your path (assuming you have a sane ruby setup!)

Operation

By default the analyzer will check enabled authentication and authorization mechanisms, check a couple of common vulnerabilities and then create an HTML report. There are other options to make things more useful, which are detailed below.

The best way to use the tool is to provide it a KUBECONFIG file to identify and authenticate the session. in that event you can run it with

kubeautoanalyzer -c <kubeconfig_file_name> -r <report_name>

If there are multiple contexts in your Kubeconfig file and you don't want to use the one specified as "current-context" then you can specify one on the commmand line with

kubeautoanalyzer -c <kubeconfig_file_name> --context=<context_name> -r <report_name>

If you've got an authorisation token for the system (e.g. with many Kubernetes 1.5 or earlier installs) you can run with

kubeautoanalyzer -s https://<API_SERVER_IP>:<API_SERVER_PORT> -t <TOKEN> -r <report_name>

If you've got access to the insecure API port and would like to run against that, you can run with

kubeautoanalyzer -s http://<API_SERVER_IP>:<INSECURE_PORT> -i -r <report_name>

Running kubeautoanalyzer without any switches will provide information on the command line switches available.

Additional Options

For the API server based checking there are a couple of additional options which can be supplied to extract additional information from the cluster.

--dump - This will dump some additional information out of the cluster, including running pods and services, and Docker images in-use. --rbac - This is an early stage attempt to provide some inforamtion about the RBAC roles and rolebindings available on the cluster. At the moment it only does clusterroles and clusterrolebindings, but the intent would be to add namespaced roles and rolebindings in the future.

CIS Audit

If you want to do some CIS audit checks against the server (carried out at the Kubernetes 1.8 version of the standard), add -a or --audit to the command line.

Agent Checks

Warning: Experimental

The --agentChecks switch will deploy a container onto each node in the cluster to try and complete various checks that need to run from the node. Your cluster need to be able to pull from Docker hub for this to work.

This will also slow things down a bit (depending on your network/cluster speed)

Reporting

There are two reporting modes available, JSON and HTML. The HTML is intended for humans to read and the JSON for input to other tools. The HTML report should looks something like this.

Report Example

Technical Background - Approach

There's two parts currently implemented by this tool, both wrapped in a ruby gem. The first element takes the approach of extracting the command lines used to start the relevant containers (e.g. API Server, Scheduler etc) from the API and check them against the relevant sections of the standard. This is possible via the API server as the spec. of each container contains the command line executed. At the moment Kubernetes doesn't have any form of API to query it's launch parameters, so this seems like the best approach.

This approach has some limitations but has the advantage of working from anywhere that has access to the API server (so doesn't need deployment on the actual nodes themselves).

In addition to that we've got an agent based approach for checks on the nodes, like file permission and kubelet checks. The agent can get deployed via the Kubernetes API and then complete it's checks and place the results in the pod log which can then be read in by the script and parsed. This is a bit on the hacky side but avoids the necessity for any form of network communications from the agent to the running script, which could well be complex.

One of the challenges with scripting these checks is that there are many different Kubernetes distributions, and each one does things differently, so implementing a generic script that covers them all would be tricky. We're working off kubeadm as a base, but ideally we'll get it working with as many distributions as possible.

Additional Vulnerability Checks

We're starting to implement checks for common Kubernetes vulnerabilities. Some of these can be derived from the CIS compliance checks, but in order to get more of a chance of picking them up, we're implementing direct checks as well.

  • Unauthenticated Kubelet check. Test in place for external access and internal access (via kaa-agent)
  • Unauthenticated API access Check. Test in place for external and internal access.
  • cluster-admin service token. Test in place for cluster-admin token exposure
  • Container Default containment checks. Based on Jessie Frazelle's amicontained We use the agent to check what the default containerization options are for a pod running on the cluster.

Tested With

  • Kubeadm 1.5,1.6,1.7,1.13 - Works ok
  • kube-aws - Works ok
  • kismatic - Works ok
  • GCE - Doesn't really work at all. GCE doesn't run the control plane components as pods, so we can't use this approach.

The switch for adding agent based checking is --agentChecks . If you run using this it will take quite a lot longer to complete, as it pulls/runs the container some times.

TODO

  • Add RBAC roles so we don't just assume cluster admin for running.
  • Getting to the point where it would be worth some re-factoring to reduce duplication. specifically abstract common routines like container creation, consistency in variable use etc.

More Repositories

1

ScoutSuite

Multi-Cloud Security Auditing Tool
Python
6,173
star
2

Scout2

Security auditing tool for AWS environments
Python
1,728
star
3

sobelow

Security-focused static analysis for the Phoenix Framework
Elixir
1,601
star
4

Winpayloads

Undetectable Windows Payload Generation
Python
1,519
star
5

demiguise

HTA encryption tool for RedTeams
Python
1,326
star
6

house

A runtime mobile application analysis toolkit with a Web GUI, powered by Frida, written in Python.
JavaScript
1,321
star
7

PMapper

A tool for quickly evaluating IAM permissions in AWS.
Python
1,279
star
8

redsnarf

RedSnarf is a pen-testing / red-teaming tool for Windows environments
PowerShell
1,182
star
9

featherduster

An automated, modular cryptanalysis tool; i.e., a Weapon of Math Destruction
Python
1,074
star
10

SocksOverRDP

Socks5/4/4a Proxy support for Remote Desktop Protocol / Terminal Services / Citrix / XenApp / XenDesktop
C++
990
star
11

singularity

A DNS rebinding attack framework.
JavaScript
962
star
12

exploit_mitigations

Knowledge base of exploit mitigations available across numerous operating systems, architectures and applications and versions.
812
star
13

AutoRepeater

Automated HTTP Request Repeating With Burp Suite
Java
742
star
14

fuzzowski

the Network Protocol Fuzzer that we will want to use.
Python
702
star
15

aws-inventory

Discover resources created in an AWS account.
Python
690
star
16

BurpSuiteHTTPSmuggler

A Burp Suite extension to help pentesters to bypass WAFs or test their effectiveness using a number of techniques
Java
654
star
17

Sniffle

A sniffer for Bluetooth 5 and 4.x LE
C
648
star
18

nmap-nse-vulnerability-scripts

NMAP Vulnerability Scanning Scripts
Lua
618
star
19

TriforceAFL

AFL/QEMU fuzzing with full-system emulation.
C
615
star
20

LoggerPlusPlus

Advanced Burp Suite Logging Extension
Java
608
star
21

nccfsas

Information released publicly by NCC Group's Full Spectrum Attack Simulation (FSAS) team.
C
598
star
22

sadcloud

A tool for standing up (and tearing down!) purposefully insecure cloud infrastructure
HCL
593
star
23

freddy

Automatically identify deserialisation issues in Java and .NET applications by using active and passive scans
Java
570
star
24

phantap

Phantom Tap (PhanTap) - an ‘invisible’ network tap aimed at red teams
C
560
star
25

tracy

A tool designed to assist with finding all sinks and sources of a web application and display these results in a digestible manner.
JavaScript
549
star
26

azucar

Security auditing tool for Azure environments
PowerShell
546
star
27

VCG

VisualCodeGrepper - Code security scanning tool.
Visual Basic .NET
506
star
28

Cyber-Defence

Information released publicly by NCC Group's Cyber Incident Response Team
Python
470
star
29

autochrome

This tool downloads, installs, and configures a shiny new copy of Chromium.
HTML
431
star
30

scrying

A tool for collecting RDP, web and VNC screenshots all in one place
Rust
425
star
31

wssip

Application for capturing, modifying and sending custom WebSocket data from client to server and vice versa.
JavaScript
425
star
32

blackboxprotobuf

Blackbox protobuf is a Burp Suite extension for decoding and modifying arbitrary protobuf messages without the protobuf type definition.
Python
380
star
33

autopwn

Specify targets and run sets of tools against them
Python
374
star
34

idahunt

idahunt is a framework to analyze binaries with IDA Pro and hunt for things in IDA Pro
Python
373
star
35

CrossSiteContentHijacking

Content hijacking proof-of-concept using Flash, PDF and Silverlight
HTML
372
star
36

Solitude

Solitude is a privacy analysis tool that enables anyone to conduct their own privacy investigations. Whether a curious novice or a more advanced researcher, Solitude makes the process of evaluating user privacy within an app accessible for everyone.
CSS
370
star
37

vlan-hopping---frogger

Easy 802.1Q VLAN Hopping
Shell
346
star
38

DriverBuddy

DriverBuddy is an IDA Python script to assist with the reverse engineering of Windows kernel drivers.
Python
331
star
39

shocker

A tool to find and exploit servers vulnerable to Shellshock
Python
330
star
40

WMIcmd

A command shell wrapper using only WMI for Microsoft Windows
C#
319
star
41

acCOMplice

Tools for discovery and abuse of COM hijacks
PowerShell
272
star
42

umap

The USB host security assessment tool
Python
265
star
43

keimpx

Check for valid credentials across a network over SMB
Python
260
star
44

SusanRTTI

Another RTTI Parsing IDA plugin
Python
258
star
45

metasploitavevasion

Metasploit AV Evasion Tool
Shell
257
star
46

UPnP-Pentest-Toolkit

UPnP Pentest Toolkit for Windows
C#
244
star
47

umap2

Umap2 is the second revision of NCC Group's python based USB host security assessment tool.
Python
240
star
48

GTFOBLookup

Offline command line lookup utility for GTFOBins (https://github.com/GTFOBins/GTFOBins.github.io), LOLBAS (https://github.com/LOLBAS-Project/LOLBAS), WADComs (https://wadcoms.github.io), and HijackLibs (https://hijacklibs.net/).
Python
238
star
49

G-Scout

Google Cloud Platform Security Tool
Python
232
star
50

asatools

Main repository to pull all NCC Group Cisco ASA-related tool projects.
Shell
220
star
51

cisco-SNMP-enumeration

Automated Cisco SNMP Enumeration, Brute Force, Configuration Download and Password Cracking
Shell
216
star
52

depthcharge

A U-Boot hacking toolkit for security researchers and tinkerers
Python
212
star
53

thetick

A simple embedded Linux backdoor.
Python
195
star
54

AWS-recipes

A number of Recipes for AWS
Python
195
star
55

TPMGenie

TPM Genie is an I2C bus interposer for discrete Trusted Platform Modules
C++
189
star
56

BinProxy

BinProxy is a proxy for arbitrary TCP connections. You can define custom message formats using the BinData gem.
Ruby
172
star
57

DetectWindowsCopyOnWriteForAPI

Enumerate various traits from Windows processes as an aid to threat hunting
C++
168
star
58

TriforceLinuxSyscallFuzzer

A linux system call fuzzer using TriforceAFL
C
167
star
59

BKScan

BlueKeep scanner supporting NLA
Shell
167
star
60

pybeacon

A collection of scripts for dealing with Cobalt Strike beacons in Python
Python
167
star
61

typofinder

A finder of domain typos showing country of IP address
Python
166
star
62

BLESuite

BLESuite is a Python package that provides an easier way to test Bluetooth Low Energy (BLE) device
Python
165
star
63

tcpprox

A small command-line TCP proxy utility written in Python
Python
156
star
64

libslub

Python
155
star
65

LazyDroid

bash script to facilitate some aspects of an Android application assessment
Shell
151
star
66

chuckle

An automated SMB relay exploitation script.
Shell
151
star
67

requests-racer

Small Python library that makes it easy to exploit race conditions in web apps with Requests.
Python
150
star
68

whalescan

Whalescan is a vulnerability scanner for Windows containers, which performs several benchmark checks, as well as checking for CVEs/vulnerable packages on the container
Python
143
star
69

gitpwnd

GitPwnd is a network penetration tool that lets you use a git repo for command and control of compromised machines
Python
139
star
70

CollaboratorPlusPlus

Java
139
star
71

Carnivore

Tool for assessing on-premises Microsoft servers authentication such as ADFS, Skype, Exchange, and RDWeb
C#
139
star
72

Change-Lockscreen

Offensive tool to trigger network authentications as SYSTEM
C#
134
star
73

Decoder-Improved

Improved decoder for Burp Suite
Java
134
star
74

Wubes

Qubes containerization on Windows
Python
131
star
75

OutlookLeakTest

The Outlook HTML Leak Test Project
C#
131
star
76

port-scan-automation

Automate NMAP Scans and Generate Custom Nessus Policies Automatically
Shell
128
star
77

Hodor

Hodor! Fuzzer..
Python
126
star
78

Zulu

The Zulu fuzzer
Python
125
star
79

WinShareEnum

Windows Share Enumerator
C#
121
star
80

memscan

Searches for strings, regex, credit card numbers of magnetic stripe card tracks in a Windows process's memory space
C#
120
star
81

ebpf

eBPF - extended Berkeley Packet Filter tooling
Python
116
star
82

cq

Python
115
star
83

argumentinjectionhammer

A Burp Extension designed to identify argument injection vulnerabilities.
Python
114
star
84

DroppedConnection

Python
113
star
85

SCOMDecrypt

SCOMDecrypt is a tool to decrypt stored RunAs credentials from SCOM servers
C#
112
star
86

GOATCasino

This is an intentionally vulnerable smart contract truffle deployment aimed at allowing those interested in smart contract security to exploit a wide variety of issues in a safe environment.
JavaScript
112
star
87

OneLogicalMyth_Shell

A HTA shell to assist with breakout assessments.
HTML
111
star
88

BLE-Replay

BLE-Replay is a Bluetooth Low Energy (BLE) peripheral assessment tool
Python
110
star
89

ccs

Python
107
star
90

web3-decoder

Python
106
star
91

WindowsDACLEnumProject

A collection of tools to enumerate and analyse Windows DACLs
C++
105
star
92

DIBF

Windows NT ioctl bruteforcer and modular fuzzer
C++
103
star
93

raccoon

Salesforce object access auditor
Python
103
star
94

go-pillage-registries

Pentester-focused Docker registry tool to enumerate and pull images
Go
103
star
95

cloud_ip_ranges

Identify IP addresses owned by public cloud providers
Python
101
star
96

DatajackProxy

Datajack Proxy allows you to intercept TLS traffic in native x86 applications across platforms
JavaScript
100
star
97

pcap-burp

Pcap importer for Burp
Java
100
star
98

jwt-reauth

Java
100
star
99

KilledProcessCanary

A canary designed to minimize the impact from certain Ransomware actors
C#
99
star
100

Berserko

Burp Suite extension to perform Kerberos authentication
Java
99
star