-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
MaKyOtOx
committed
Jul 30, 2021
1 parent
f9c052c
commit 9ba9a05
Showing
7 changed files
with
27 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.4.33 // PatrowlEngines | ||
1.4.34 // PatrowlEngines |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
FROM alpine:latest | ||
MAINTAINER Patrowl.io "[email protected]" | ||
LABEL Name="SHHGit\ \(Patrowl engine\)" Version="1.4.28" | ||
LABEL Name="SHHGit\ \(Patrowl engine\)" Version="1.4.30" | ||
|
||
# Create the target repo | ||
RUN mkdir -p /opt/patrowl-engines/shhgit | ||
RUN mkdir -p /opt/patrowl-engines/shhgit/results | ||
RUN mkdir -p /opt/patrowl-engines/shhgit/data | ||
RUN mkdir -p /opt/patrowl-engines/shhgit/libs | ||
|
||
# Set the working directory | ||
WORKDIR /opt/patrowl-engines/shhgit | ||
# Install any needed packages specified in requirements.txt | ||
RUN apk add --update --no-cache \ | ||
python3 python3-dev py3-pip \ | ||
gcc libc-dev libffi-dev make git \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
# Clone sast-git-leaks | ||
WORKDIR /opt/patrowl-engines/shhgit/libs | ||
RUN git clone https://github.com/leboncoin/sast-git-leaks/ | ||
RUN ls -al | ||
RUN ls -al sast-git-leaks | ||
RUN sed -e 's/sast_git_leaks.tools/libs.sast_git_leaks.sast_git_leaks.tools/g' sast-git-leaks/config/variables.py > sast-git-leaks/config/variables.py.bak && mv sast-git-leaks/config/variables.py.bak sast-git-leaks/config/variables.py | ||
|
||
# Copy the current directory contents into the container at / | ||
WORKDIR /opt/patrowl-engines/shhgit | ||
COPY __init__.py . | ||
COPY engine-shhgit.py . | ||
COPY libs . | ||
COPY libs/github.py libs/github.py | ||
COPY libs/git_leaks.py libs/git_leaks.py | ||
COPY shhgit.json.sample shhgit.json | ||
COPY requirements.txt . | ||
COPY README.md . | ||
COPY VERSION . | ||
|
||
# Install any needed packages specified in requirements.txt | ||
RUN mkdir -p results | ||
RUN mkdir -p data | ||
RUN apk add --update --no-cache \ | ||
python3 python3-dev py3-pip \ | ||
gcc libc-dev libffi-dev make \ | ||
&& rm -rf /var/cache/apk/* | ||
# Install python requirements | ||
RUN pip3 install --upgrade pip | ||
RUN pip3 install --trusted-host pypi.python.org -r requirements.txt | ||
RUN pip3 install --trusted-host pypi.python.org -r libs/sast_git_leaks/requirements.txt | ||
|
||
# TCP port exposed by the container (NAT) | ||
EXPOSE 5025 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.4.29 | ||
1.4.30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,11 @@ | |
Licensed under the Apache License | ||
Written by Fabien Martinez <[email protected]> | ||
''' | ||
import logging | ||
|
||
from github import Github | ||
|
||
|
||
def get_repositories(logger, github_account, organization): | ||
"""Retrieve repositories from a Github organization.""" | ||
try: | ||
repositories = github_account.get_organization(organization).get_repos() | ||
except Exception as e: | ||
|
@@ -20,6 +19,7 @@ def get_repositories(logger, github_account, organization): | |
|
||
|
||
def get_github_repositories(logger, github_account): | ||
"""Retrieve repositories.""" | ||
github = Github(github_account['github_key']) | ||
if github_account['is_internal']: | ||
github = Github( | ||
|