All Projects → PaperMtn → Gitlab Watchman

PaperMtn / Gitlab Watchman

Licence: gpl-3.0
Monitoring GitLab for sensitive data shared publicly

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Gitlab Watchman

Slack Watchman
Monitoring your Slack workspaces for sensitive information
Stars: ✭ 159 (+25.2%)
Mutual labels:  monitoring, infosec, cybersecurity, redteam, red-team, blueteam, tools
github-watchman
Monitoring GitHub for sensitive data shared publicly
Stars: ✭ 60 (-52.76%)
Mutual labels:  cybersecurity, infosec, red-team, blueteam, redteam
NIST-to-Tech
An open-source listing of cybersecurity technology mapped to the NIST Cybersecurity Framework (CSF)
Stars: ✭ 61 (-51.97%)
Mutual labels:  cybersecurity, infosec, 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 (-37.8%)
Mutual labels:  cybersecurity, infosec, blueteam, redteam
1earn
ffffffff0x 团队维护的安全知识框架,内容包括不仅限于 web安全、工控安全、取证、应急、蓝队设施部署、后渗透、Linux安全、各类靶机writup
Stars: ✭ 3,715 (+2825.2%)
Mutual labels:  infosec, blueteam, redteam
Blue-Team-Notes
You didn't think I'd go and leave the blue team out, right?
Stars: ✭ 899 (+607.87%)
Mutual labels:  cybersecurity, infosec, blueteam
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 (-44.88%)
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 (-71.65%)
Mutual labels:  cybersecurity, red-team, redteam
OSINTBookmarks
OSINT Bookmarks for Firefox / Chrome / Edge / Safari
Stars: ✭ 34 (-73.23%)
Mutual labels:  cybersecurity, blueteam, redteam
dorothy
Dorothy is a tool to test security monitoring and detection for Okta environments
Stars: ✭ 85 (-33.07%)
Mutual labels:  cybersecurity, infosec, red-team
ReversePowerShell
Functions that can be used to gain Reverse Shells with PowerShell
Stars: ✭ 48 (-62.2%)
Mutual labels:  cybersecurity, red-team, redteam
Thecollective
The Collective. A repo for a collection of red-team projects found mostly on Github.
Stars: ✭ 85 (-33.07%)
Mutual labels:  cybersecurity, redteam, red-team
dummyDLL
Utility for hunting UAC bypasses or COM/DLL hijacks that alerts on the exported function that was consumed.
Stars: ✭ 35 (-72.44%)
Mutual labels:  infosec, blueteam, redteam
A Red Teamer Diaries
RedTeam/Pentest notes and experiments tested on several infrastructures related to professional engagements.
Stars: ✭ 382 (+200.79%)
Mutual labels:  cybersecurity, redteam, tools
Infosec reference
An Information Security Reference That Doesn't Suck; https://rmusser.net/git/admin-2/Infosec_Reference for non-MS Git hosted version.
Stars: ✭ 4,162 (+3177.17%)
Mutual labels:  infosec, red-team, blueteam
Nishang
Nishang - Offensive PowerShell for red team, penetration testing and offensive security.
Stars: ✭ 5,943 (+4579.53%)
Mutual labels:  infosec, redteam, red-team
goblin
一款适用于红蓝对抗中的仿真钓鱼系统
Stars: ✭ 844 (+564.57%)
Mutual labels:  cybersecurity, blueteam, redteam
Defaultcreds Cheat Sheet
One place for all the default credentials to assist the Blue/Red teamers activities on finding devices with default password 🛡️
Stars: ✭ 1,949 (+1434.65%)
Mutual labels:  infosec, cybersecurity, blueteam
Pidense
🍓📡🍍Monitor illegal wireless network activities. (Fake Access Points), (WiFi Threats: KARMA Attacks, WiFi Pineapple, Similar SSID, OPN Network Density etc.)
Stars: ✭ 358 (+181.89%)
Mutual labels:  monitoring, redteam, blueteam
Awesome Security Hardening
A collection of awesome security hardening guides, tools and other resources
Stars: ✭ 630 (+396.06%)
Mutual labels:  infosec, cybersecurity, blueteam

GitLab Watchman

Python 2.7 and 3 compatible PyPI version License: MIT

About GitLab Watchman

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

Features

It searches GitLab for internally shared projects and looks at:

  • Code
  • Commits
  • Wiki pages
  • Issues
  • Merge requests
  • Milestones

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
  • Tokens for services such as Heroku, PayPal and more
  • Passwords in plaintext
  • and more

Time based searching

You can run GitLab 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 GitLab Watchman to run regularly and only return results from your chosen timeframe.

Rules

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

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#
- blobs
- commits
- milestones
- wiki_blobs
- issues
- merge_requests
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 GitLab#
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

GitLab Watchman gives the following logging options:

  • Log file
  • Stdout
  • TCP stream

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, GitLab Watchman defaults to Stdout logging.

Requirements

GitLab versions

GitLab Watchman uses the v4 API, and works with GitLab Enterprise Edition versions:

  • 13.0 and above - Yes

  • GitLab.com - Yes

  • 12.0 - 12.10 - Maybe, untested but if using v4 of the API then it could work

GitLab Licence & Elasticsearch

To search the scopes:

  • blobs
  • wiki_blobs
  • commits

The GitLab instance must have Elasticsearch configured, and be running Enterprise Edition with a minimum GitLab Starter or Bronze Licence.

GitLab personal access token

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

You can create a personal access token in the GitLab GUI via Settings -> Access Tokens -> Add a personal access token

The token needs permission for the following scopes:

api

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.

GitLab URL

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

Providing token & URL

GitLab Watchman will first try to get the the GitLab token and URL from the environment variables GITLAB_WATCHMAN_TOKEN and GITLAB_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:

gitlab_watchman:
  token: abc123
  url: https://gitlab.example.com
  logging:
    file_logging:
      path:
    json_tcp:
      host:
      port:

GitLab 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 GitLab Watchman to the existing file.

Installation

Install via pip

pip install gitlab-watchman

Or via source

Usage

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

usage: gitlab-watchman [-h] --timeframe {d,w,m,a} --output
                   {file,stdout,stream} [--version] [--all] [--blobs]
                   [--commits] [--wiki-blobs] [--issues] [--merge-requests]
                   [--milestones] [--comments]

Monitoring GitLab 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
  --blobs               Search code blobs
  --commits             Search commits
  --wiki-blobs          Search wiki blobs
  --issues              Search issues
  --merge-requests      Search merge requests
  --milestones          Search milestones
  --comments            Search comments

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 {file,stdout,stream}
                        Where to send results

You can run GitLab Watchman to look for everything, and output to default Stdout:

gitlab-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:

gitlab-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 GitLab.

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].