Skip to content

Commit

Permalink
Merge pull request #1 from PaperMtn/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
PaperMtn authored Apr 3, 2022
2 parents b54b845 + 2498ae5 commit 8b70acf
Show file tree
Hide file tree
Showing 73 changed files with 292 additions and 71 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/dockerpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Docker Image Publish

on:
release:
types: [published]

jobs:
github-cache:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
papermountain/slack-watchman-eg
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
9 changes: 5 additions & 4 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10]
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
Expand All @@ -36,8 +36,9 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test setup & install
run: |
pip install build
python3 -m build
pip install build twine
python3 -m build
twine check dist/*.whl
python3 -m pip install dist/*.whl
- name: Test rules
run: |
Expand All @@ -52,7 +53,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10]
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
python-version: '3.x'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install build
python3 -m pip install --upgrade pip twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ '__token__' }}
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.1.0 - 2022-04-02
### Added
- Docker image now available from the Docker hub, or by building from source.
- Support for Python 3.7
- New logo to play nicely with dark mode
### Fixed
- More errors when importing packages

## 1.0.2 - 2021-12-30
### Fixed
- Error when importing packages
Expand Down
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM alpine/git AS initlayer
WORKDIR /workdir
RUN git clone -b develop https://github.com/PaperMtn/slack-watchman-enterprise-grid.git

FROM python:buster
RUN addgroup --gid 1000 slack-watchman-enterprise-grid
RUN useradd -u 1000 -g 1000 slack-watchman-enterprise-grid
RUN mkdir /home/slack-watchman-enterprise-grid
COPY --from=initlayer /workdir/slack-watchman-enterprise-grid /home/slack-watchman-enterprise-grid
RUN chown -R slack-watchman-enterprise-grid: /home/slack-watchman-enterprise-grid
WORKDIR /home/slack-watchman-enterprise-grid

RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install requests build PyYAML numpy
RUN python3 -m build
RUN python3 -m pip install dist/*.whl

USER slack-watchman-enterprise-grid

ENTRYPOINT ["/usr/local/bin/slack-watchman-eg"]
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<img src="https://i.imgur.com/86TiciX.png" width="550">
<img src="https://i.imgur.com/VPgx6ra.png" width="550">

# Slack Watchman for Enterprise Grid
![Python 2.7 and 3 compatible](https://img.shields.io/pypi/pyversions/slack-watchman-eg)
![PyPI version](https://img.shields.io/pypi/v/slack-watchman-eg.svg)
![License: MIT](https://img.shields.io/pypi/l/slack-watchman-eg.svg)


## About Slack Watchman for Enterprise Grid

Slack Watchman for Enterprise Grid uses the Slack Enterprise Grid DLP API to look for potentially sensitive data exposed in your Slack Enterprise.
Expand Down Expand Up @@ -120,7 +121,22 @@ python3 -m pip build
python3 -m pip install --force-reinstall dist/*.whl
```

Scripts for building and installing from source for Mac, Linux and Windows are in the `scripts` directory
## Docker Image

Slack Watchman for Enterprise Grid is also available from the Docker hub as a Docker image:

`docker pull papermountain/slack-watchman-eg:latest`

You can then run Slack Watchman for Enterprise Grid in a container, making sure you pass the required environment variables:

```
// help
docker run --rm papermountain/slack-watchman-eg -h
// scan all
docker run --rm -e SLACK_WATCHMAN_EG_TOKENN=xoxp... papermountain/slack-watchman-eg --hours 1 --cores 8
docker run --rm --env-file .env papermountain/slack-watchman-eg --hours 1 --cores 8
```

## Usage
```
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
requests
PyYAML
numpy
3 changes: 0 additions & 3 deletions scripts/nix_install.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/win_install.ps1

This file was deleted.

3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ classifiers =
Intended Audience :: Information Technology
Topic :: Security
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand All @@ -23,7 +24,7 @@ package_dir =
= src
include_package_data = True
packages = find_namespace:
python_requires = >=3.8
python_requires = >=3.7
install_requires =
requests
PyYAML
Expand Down
Empty file added src/signatures/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions src/signatures/competitive/archive_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- blank
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/competitive/budget_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- blank
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/competitive/excel_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- blank
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/competitive/powerpoint_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- blank
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/competitive/word_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- blank
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/bank_cards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- '4111 1111 1111 1111'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/cusip_numbers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- 'Apple Inc 037833100'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/cv_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- blank
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/date_of_birth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- '2020-12-01'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/drivers_licence_uk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- 'Drivers licence: FARME100165AB5EW'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/iban_numbers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- 'XX00 1234 5678 9012 3456 7890 1234 5678 90'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/itin_numbers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- '999997406'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/mastercard_datacash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- '99000000'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/ni_numbers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- 'NI Number: AA123456C'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/passport_numbers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- 'Passport cb676767677'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/compliance/ssn_us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- 111-22-3333
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/security/access_tokens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- 'ACCESS_TOKEN: 123456789abcdefg123456789123456789'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/security/aws_api_tokens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- AbCdEfGh1234567890AbAbAb+aAb1111111111+=
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/security/azure_api_tokens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- '"accessToken": "123123123123123123123123123123123123"'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/security/azure_service_account_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- '"accessToken": "123123123123123123123123123123123123"'
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/security/bearer_tokens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- 'Authorization: ''Bearer ABABAB1111111ABABAB++__..--..abcdefg'''
Expand Down
2 changes: 2 additions & 0 deletions src/signatures/security/certificate_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locations:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- blank
Expand Down
Loading

0 comments on commit 8b70acf

Please sign in to comment.