All Projects → PaperMtn → github-watchman

PaperMtn / github-watchman

Licence: GPL-3.0 license
Monitoring GitHub for sensitive data shared publicly

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to github-watchman

Gitlab Watchman
Monitoring GitLab for sensitive data shared publicly
Stars: ✭ 127 (+111.67%)
Mutual labels:  cybersecurity, infosec, red-team, blueteam, redteam
MurMurHash
This little tool is to calculate a MurmurHash value of a favicon to hunt phishing websites on the Shodan platform.
Stars: ✭ 79 (+31.67%)
Mutual labels:  cybersecurity, infosec, blueteam, redteam, purpleteam
NIST-to-Tech
An open-source listing of cybersecurity technology mapped to the NIST Cybersecurity Framework (CSF)
Stars: ✭ 61 (+1.67%)
Mutual labels:  cybersecurity, infosec, blueteam, redteam, purpleteam
Slack Watchman
Monitoring your Slack workspaces for sensitive information
Stars: ✭ 159 (+165%)
Mutual labels:  cybersecurity, infosec, red-team, blueteam, redteam
dorothy
Dorothy is a tool to test security monitoring and detection for Okta environments
Stars: ✭ 85 (+41.67%)
Mutual labels:  cybersecurity, infosec, red-team, blue-team
Blue-Team-Notes
You didn't think I'd go and leave the blue team out, right?
Stars: ✭ 899 (+1398.33%)
Mutual labels:  cybersecurity, infosec, blueteam
ad-privileged-audit
Provides various Windows Server Active Directory (AD) security-focused reports.
Stars: ✭ 42 (-30%)
Mutual labels:  cybersecurity, blueteam, purpleteam
Powershell Red Team
Collection of PowerShell functions a Red Teamer may use to collect data from a machine
Stars: ✭ 155 (+158.33%)
Mutual labels:  cybersecurity, red-team, redteam
goblin
一款适用于红蓝对抗中的仿真钓鱼系统
Stars: ✭ 844 (+1306.67%)
Mutual labels:  cybersecurity, blueteam, redteam
OSINTBookmarks
OSINT Bookmarks for Firefox / Chrome / Edge / Safari
Stars: ✭ 34 (-43.33%)
Mutual labels:  cybersecurity, blueteam, redteam
pyc2bytecode
A Python Bytecode Disassembler helping reverse engineers in dissecting Python binaries by disassembling and analyzing the compiled python byte-code(.pyc) files across all python versions (including Python 3.10.*)
Stars: ✭ 70 (+16.67%)
Mutual labels:  cybersecurity, infosec, blueteam
Sherlock
This script is designed to help expedite a web application assessment by automating some of the assessment steps (e.g., running nmap, sublist3r, metasploit, etc.)
Stars: ✭ 36 (-40%)
Mutual labels:  cybersecurity, red-team, redteam
Awesome Security Hardening
A collection of awesome security hardening guides, tools and other resources
Stars: ✭ 630 (+950%)
Mutual labels:  cybersecurity, infosec, blueteam
Cypheroth
Automated, extensible toolset that runs cypher queries against Bloodhound's Neo4j backend and saves output to spreadsheets.
Stars: ✭ 179 (+198.33%)
Mutual labels:  cybersecurity, blueteam, redteam
ReversePowerShell
Functions that can be used to gain Reverse Shells with PowerShell
Stars: ✭ 48 (-20%)
Mutual labels:  cybersecurity, red-team, redteam
Thecollective
The Collective. A repo for a collection of red-team projects found mostly on Github.
Stars: ✭ 85 (+41.67%)
Mutual labels:  cybersecurity, red-team, redteam
Nishang
Nishang - Offensive PowerShell for red team, penetration testing and offensive security.
Stars: ✭ 5,943 (+9805%)
Mutual labels:  infosec, red-team, redteam
Snoop
Snoop — инструмент разведки на основе открытых данных (OSINT world)
Stars: ✭ 886 (+1376.67%)
Mutual labels:  infosec, blueteam, redteam
awesome-list-of-secrets-in-environment-variables
🦄🔒 Awesome list of secrets in environment variables 🖥️
Stars: ✭ 538 (+796.67%)
Mutual labels:  cybersecurity, red-team, blue-team
Awesome Cybersecurity Blueteam
💻🛡️ A curated collection of awesome resources, tools, and other shiny things for cybersecurity blue teams.
Stars: ✭ 2,091 (+3385%)
Mutual labels:  cybersecurity, infosec, blue-team

GitHub Watchman

Python 2.7 and 3 compatible PyPI version License: MIT

About GitHub Watchman

GitHub Watchman is an application that uses the GitHub API to audit GitHub for sensitive data and credentials exposed internally.

Features

It searches GitHub for internally shared projects and looks at:

  • Code
  • Commits
  • Issues
  • Repositories

For the following data:

  • GCP keys and service account files
  • AWS keys
  • Azure keys and service account files
  • Google API keys
  • Slack API tokens & webhooks
  • Private keys (SSH, PGP, any other misc private key)
  • Exposed tokens (Bearer tokens, access tokens, client_secret etc.)
  • S3 config files
  • Passwords in plaintext
  • and more

Time based searching

You can run GitHub Watchman to look for results going back as far as:

  • 24 hours
  • 7 days
  • 30 days
  • All time

This means after one deep scan, you can schedule GitHub Watchman to run regularly and only return results from your chosen timeframe.

Rules

GitHub Watchman uses custom YAML rules to detect matches in GitHub.

They follow this format:

---
filename:
enabled: #[true|false]
meta:
  name:
  author:
  date:
  description: #what the search should find#
  severity: #rating out of 100#
scope: #what to search, any combination of the below#
- code
- commits
- issues
- repositories
test_cases:
  match_cases:
  - #test case that should match the regex#
  fail_cases:
  - #test case that should not match the regex#
strings:
- #search query to use in GitHub#
pattern: #Regex pattern to filter out false positives#

There are Python tests to ensure rules are formatted properly and that the Regex patterns work in the tests dir

More information about rules, and how you can add your own, is in the file docs/rules.md.

Logging

GitHub Watchman gives the following logging options:

  • CSV
  • Log file
  • Stdout
  • TCP stream

When using CSV logging, searches for rules are returned in separate CSV files, for all other methods of logging, results are output in JSON format, perfect for ingesting into a SIEM or other log analysis platform.

For file and TCP stream logging, configuration options need to be passed via .conf file or environment variable. See the file docs/logging.md for instructions on how to set it up.

If no logging option is given, GitHub Watchman defaults to CSV logging.

Requirements

GitHub versions

GitHub Watchman uses the v3 API, and works with GitHub Enterprise Server versions that support the v3 API.

GitHub Watchman also works with GitHub.com (Free, Pro and Team) using the API.

GitHub personal access token

To run GitHub Watchman, you will need a GitHub personal access token.

You can create a personal access token in the GitHub GUI via Settings -> Developer settings -> Personal access tokens

The token needs no specific scopes assigned, as it searches public repositories in the GitHub instance.

Note: Personal access tokens act on behalf of the user who creates them, so I would suggest you create a token using a service account, otherwise the app will have access to your private repositories.

GitHub URL

You also need to provide the URL of your GitHub instance.

Providing token & URL

GitHub Watchman will first try to get the the GitHub token and URL from the environment variables GITHUB_WATCHMAN_TOKEN and GITHUB_WATCHMAN_URL, if this fails they will be taken from .conf file (see below).

.conf file

Configuration options can be passed in a file named watchman.conf which must be stored in your home directory. The file should follow the YAML format, and should look like below:

github_watchman:
  token: abc123
  url: https://github.example.com
  logging:
    file_logging:
      path:
    json_tcp:
      host:
      port:

GitHub Watchman will look for this file at runtime, and use the configuration options from here. If you are not using the advanced logging features, leave them blank.

If you are having issues with your .conf file, run it through a YAML linter.

An example file is in docs/example.conf

Note If you use any other Watchman applications and already have a watchman.conf file, just append the conf data for GitHub Watchman to the existing file.

Installation

Install via pip

pip install github-watchman

Or via source

Usage

GitHub Watchman will be installed as a global command, use as follows:

usage: github-watchman [-h] --timeframe {d,w,m,a} --output
                   {csv,file,stdout,stream} [--version] [--all] [--code]
                   [--commits] [--issues] [--repositories]

Monitoring GitHub for sensitive data shared publicly

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --all                 Find everything
  --code                Search code
  --commits             Search commits
  --issues              Search issues
  --repositories        Search merge requests

required arguments:
  --timeframe {d,w,m,a}
                        How far back to search: d = 24 hours w = 7 days, m =
                        30 days, a = all time
  --output {csv,file,stdout,stream}
                        Where to send results


You can run GitHub Watchman to look for everything, and output to default CSV:

github-watchman --timeframe a --all

Or arguments can be grouped together to search more granularly. This will look for commits and milestones for the last 30 days, and output the results to a TCP stream:

github-watchman --timeframe m --commits --milestones --output stream

Other Watchman apps

You may be interested in some of the other apps in the Watchman family:

License

The source code for this project is released under the GNU General Public Licence. This project is not associated with GitHub.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].