Skip to content

Commit d06cd2d

Browse files
authored
Merge pull request #9 from PaperMtn/develop
Release Version 3.0.0
2 parents fdf78d8 + 9027ea2 commit d06cd2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1280
-1797
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
__pycache__
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.Python
6+
env
7+
venv
8+
dist
9+
signatures
10+
watchman-signatures
11+
pip-log.txt
12+
pip-delete-this-directory.txt
13+
.tox
14+
.coverage
15+
.coverage.*
16+
.cache
17+
nosetests.xml
18+
coverage.xml
19+
*.cover
20+
*.log
21+
.git
22+
.mypy_cache
23+
.pytest_cache
24+
.hypothesis
25+
*.csv

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@ A clear and concise description of what you want to happen.
1717
A clear and concise description of any alternative solutions or features you've considered.
1818

1919
**Additional context**
20-
<<<<<<< HEAD
2120
Add any other context or screenshots about the feature request here.
22-
=======
23-
Add any other context or screenshots about the feature request here.
24-
>>>>>>> 500caddadff50ff27d7100a970f2971515df6f4b
21+

.github/workflows/dockerpublish.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
1-
name: Docker Image Publish
1+
name: ci
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
branches: [ master ]
66

77
jobs:
8-
github-cache:
8+
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v2
13-
- name: Set up QEMU
14-
uses: docker/setup-qemu-action@v1
15-
- name: Set up Docker Buildx
16-
uses: docker/setup-buildx-action@v1
17-
- name: Cache Docker layers
18-
uses: actions/cache@v2
19-
with:
20-
path: /tmp/.buildx-cache
21-
key: ${{ runner.os }}-buildx-${{ github.sha }}
22-
restore-keys: |
23-
${{ runner.os }}-buildx-
24-
- name: Login to DockerHub
25-
uses: docker/login-action@v1
11+
-
12+
name: Checkout
13+
uses: actions/checkout@v3
14+
-
15+
name: Login to Docker Hub
16+
uses: docker/login-action@v2
2617
with:
2718
username: ${{ secrets.DOCKERHUB_USERNAME }}
2819
password: ${{ secrets.DOCKERHUB_TOKEN }}
29-
- name: Build and push
30-
uses: docker/build-push-action@v2
20+
-
21+
name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v2
23+
-
24+
name: Build and push
25+
uses: docker/build-push-action@v4
3126
with:
3227
context: .
3328
file: ./Dockerfile
3429
push: true
35-
tags: papermountain/gitlab-watchman:latest
36-
cache-from: type=local,src=/tmp/.buildx-cache
37-
cache-to: type=local,dest=/tmp/.buildx-cache
30+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/gitlab-watchman:latest

.github/workflows/github_release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [ '3.10' ]
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install flake8
24+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25+
- name: Lint with flake8
26+
run: |
27+
# stop the build if there are Python syntax errors or undefined names
28+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
- name: Test setup & install
32+
run: |
33+
pip install build twine
34+
python3 -m build
35+
twine check dist/*.whl
36+
python3 -m pip install dist/*.whl
37+
- name: Extract release notes
38+
id: extract-release-notes
39+
uses: ffurrer2/extract-release-notes@v1
40+
with:
41+
changelog_file: CHANGELOG.md
42+
- name: Retrieve version
43+
run: |
44+
echo "TAG_NAME=$(gitlab-watchman -v | awk '{match($0, /[0-9]+\.[0-9]+\.[0-9]+/); print substr($0, RSTART, RLENGTH)}')" >> $GITHUB_OUTPUT
45+
id: version
46+
- name: Release
47+
uses: ncipollo/release-action@v1
48+
with:
49+
artifacts: "dist/*.tar.gz"
50+
body: ${{ steps.extract-release-notes.outputs.release_notes }}
51+
tag: ${{ steps.version.outputs.TAG_NAME }}
52+
name: GitLab Watchman - ${{ steps.version.outputs.TAG_NAME }}

.github/workflows/pythonpackage.yml

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ['3.7', '3.8', '3.9', '3.10']
18+
python-version: ['3.10']
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -36,38 +36,10 @@ jobs:
3636
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3737
- name: Test setup & install
3838
run: |
39-
pip install build
40-
python3 -m build
39+
pip install build twine
40+
python3 -m build
41+
twine check dist/*.whl
4142
python3 -m pip install dist/*.whl
42-
- name: Test rules
43-
run: |
44-
python3 -m unittest tests/test_signatures.py
45-
- name: Test run
46-
run: |
47-
gitlab-watchman --version
48-
gitlab-watchman --help
49-
50-
build-windows:
51-
52-
runs-on: windows-latest
53-
strategy:
54-
matrix:
55-
python-version: ['3.7', '3.8', '3.9', '3.10']
56-
57-
steps:
58-
- uses: actions/checkout@v2
59-
- name: Set up Python ${{ matrix.python-version }}
60-
uses: actions/setup-python@v2
61-
with:
62-
python-version: ${{ matrix.python-version }}
63-
- name: Install dependencies
64-
run: |
65-
python -m pip install --upgrade pip
66-
pip install build
67-
- name: Test setup & install
68-
run: |
69-
python -m build
70-
pip install --find-links=dist\ gitlab-watchman
7143
- name: Test run
7244
run: |
7345
gitlab-watchman --version

.github/workflows/pythonpublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
name: Upload Python Package
55

66
on:
7-
release:
8-
types: [published]
7+
push:
8+
branches: [ master ]
99

1010
jobs:
1111
deploy:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,5 @@ venv.bak/
123123
.mypy_cache/
124124
.dmypy.json
125125
dmypy.json
126+
watchman-signatures/
127+
*.csv

CHANGELOG.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
## 2.0.0 - 2022-04-01
1+
## [3.0.0] - 2023-05-15
2+
This major version release brings multiple updates to GitLab Watchman in usability, functionality and behind the scenes improvements.
3+
### Added
4+
- Support for centralised signatures from the [Watchman Signatures repository](https://github.com/PaperMtn/watchman-signatures)
5+
- This makes it much easier to keep the signature base for all Watchman applications up to date, and to add functionality to GitLab Watchman with new signatures. New signatures are downloaded, and updates to existing signatures are applied, at runtime, meaning GitLab Watchman will always be using the most up to date signatures.
6+
- Major UI overhaul
7+
- A lot of feedback said GitLab Watchman was hard to read. This version introduces new terminal optimised logging as a logging option, as well as JSON formatting. This formatting is now the default when running with no output option selected, and is a lot easier for humans to read. Also, colours!
8+
- Enumeration options added
9+
- GitLab Watchman now gathers more information from an instance. Useful if your use case is more red than blue...
10+
- Instance metadata output to terminal
11+
- Information on the user you are authenticated as, and the token you are using, including what permissions it has.
12+
- All instance users output to CSV
13+
- All instance projects output to CSV
14+
- All instance groups output to CSV
15+
- Option choose between verbose or succinct logging when using JSON output. Default is succinct.
16+
- Debug logging option
17+
### Removed
18+
- Local/custom signatures - Centralised signatures mean that user-created custom signatures can't be used with GitLab Watchman for Enterprise Grid anymore. If you have made a signature you think would be good for sharing with the community, feel free to add it to the Watchman Signatures repository, so it can be used in all Watchman applications
19+
20+
## [2.0.0] - 2022-03-22
221
### Added:
322
- New scopes for finding exposed data in:
423
- notes
@@ -19,7 +38,7 @@
1938
- The --output flag is no longer required, and therefore not supported
2039

2140

22-
## 1.4.0 - 2020-12-24
41+
## [1.4.0] - 2020-12-24
2342
### Added:
2443
- Refactor of rules into directories for easier management
2544
- Multiprocessing implemented for searching for matches. GitLab Watchman now splits regex filtering between the cores available on the device, meaning the more cores you have, the faster searching should run.
@@ -36,7 +55,7 @@
3655
- Microsoft NuGet keys
3756

3857

39-
## 1.3.0 - 2020-12-12
58+
## [1.3.0] - 2020-12-12
4059
### Added:
4160
- Add more information about the namespaces a project is in to logs
4261
- Added owner details of that namespace, for groups and users
@@ -50,7 +69,7 @@
5069
### Removed:
5170
- Enhanced logging that includes nested information, such as namespace owners, means that CSV logging is no longer practical. CSV logging has been removed and JSON via STDOUT is now the default option.
5271

53-
## 1.2.0 - 2020-11-16
72+
## [1.2.0] - 2020-11-16
5473
### Added:
5574
- More data on namespaces added to logs
5675
- Better search queries for existing rules to filter out false positives
@@ -61,12 +80,12 @@
6180
### Fixed:
6281
- Bug on outputting match string for blobs/wiki-blobs
6382

64-
## 1.1.0 - 2020-11-14
83+
## [1.1.0] - 2020-11-14
6584
### Fixed
6685
- Retry added for occasional Requests HTTPSConnectionPool error
6786

6887
### Added
6988
- Exact regex string match added to output from message searches
7089

71-
## 1.0.0 - 2020-10-01
90+
## [1.0.0] - 2020-10-01
7291
Release

CONTRIBUTING.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ The two main areas where you can contribute are:
66
- Signature files
77
- Additional functionality
88

9-
10-
## Adding new signatures
11-
GitLab Watchman runs using YAML signature files that are stored in the `signature` directory. They define what to search Slack for, and are the heart of the application.
12-
13-
Instructions on how to create your own signature files can be found in `docs\signatures.md`
14-
15-
If you do write your own signatures, please contribute them to the project by creating a pull request.
16-
17-
189
## Additional functionality
1910
You can make recommendations for new functionality via raising issues using the feature request template. Even better, you could contribute the additional functionality yourself and create a pull request for the changes to be added to a future release.
2011

Dockerfile

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
FROM alpine/git AS initlayer
2-
WORKDIR /workdir
3-
RUN git clone https://github.com/PaperMtn/gitlab-watchman.git
4-
5-
FROM python:buster
6-
RUN addgroup --gid 1000 gitlab-watchman
7-
RUN useradd -u 1000 -g 1000 gitlab-watchman
8-
RUN mkdir /home/gitlab-watchman
9-
COPY --from=initlayer /workdir/gitlab-watchman /home/gitlab-watchman
10-
RUN chown -R gitlab-watchman: /home/gitlab-watchman
11-
WORKDIR /home/gitlab-watchman
12-
13-
RUN python3 -m pip install --upgrade pip
14-
RUN python3 -m pip install requests build PyYAML
15-
RUN python3 -m build
16-
RUN python3 -m pip install dist/*.whl
17-
18-
USER gitlab-watchman
19-
20-
ENTRYPOINT ["/usr/local/bin/gitlab-watchman"]
1+
# syntax=docker/dockerfile:1
2+
3+
FROM python:3.10
4+
COPY . /opt/gitlab-watchman
5+
WORKDIR /opt/gitlab-watchman
6+
ENV PYTHONPATH=/opt/gitlab-watchman GITLAB_WATCHMAN_TOKEN="" GITLAB_WATCHMAN_URL=""
7+
RUN pip3 install -r requirements.txt build && \
8+
chmod -R 700 . && \
9+
python3 -m build && \
10+
python3 -m pip install dist/*.whl
11+
STOPSIGNAL SIGINT
12+
WORKDIR /opt/gitlab-watchman
13+
ENTRYPOINT ["gitlab-watchman"]

MANIFEST.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)