Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Vulnerabilities #37

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1c3ec19
fix: requirements.txt to reduce vulnerabilities
snyk-bot Nov 13, 2021
05834ff
fix: Dockerfile to reduce vulnerabilities
snyk-bot Nov 14, 2021
ec48b9a
Merge pull request #2 from 4k4xs4pH1r3/snyk-fix-8309bb15f8a0d95dcc148…
4k4xs4pH1r3 Nov 14, 2021
85345d9
fix: requirements.txt to reduce vulnerabilities
snyk-bot Nov 14, 2021
a02f6ad
Merge pull request #3 from 4k4xs4pH1r3/snyk-fix-75a2a4e6d16e13b65761c…
4k4xs4pH1r3 Nov 14, 2021
5b4b011
Merge pull request #1 from 4k4xs4pH1r3/snyk-fix-bc25f2a4d0daf849cc28d…
4k4xs4pH1r3 Nov 14, 2021
eb0aa88
Create SECURITY.md
4k4xs4pH1r3 Nov 14, 2021
6bb6092
Create codeql-analysis.yml
4k4xs4pH1r3 Nov 14, 2021
16946f5
Create anchore-analysis.yml
4k4xs4pH1r3 Nov 14, 2021
8d0cc95
Create kubesec-analysis.yml
4k4xs4pH1r3 Nov 14, 2021
26de9ed
Create semgrep-analysis.yml
4k4xs4pH1r3 Nov 14, 2021
8ccec17
Create snyk-container-analysis.yml
4k4xs4pH1r3 Nov 14, 2021
8de8e9f
Create snyk-infrastructure-analysis.yml
4k4xs4pH1r3 Nov 14, 2021
228facf
Create trivy-analysis.yml
4k4xs4pH1r3 Nov 14, 2021
ed15563
Add .whitesource configuration file
mend-bolt-for-github[bot] Dec 30, 2021
ba00fdd
fix: Dockerfile to reduce vulnerabilities
snyk-bot Feb 2, 2022
fbbe4c4
Merge pull request #6 from 4k4xs4pH1r3/snyk-fix-47d7be2a36a7df6496ae6…
4k4xs4pH1r3 Feb 2, 2022
47a8392
fix: Dockerfile to reduce vulnerabilities
snyk-bot Feb 2, 2022
be08ebf
Merge pull request #7 from 4k4xs4pH1r3/snyk-fix-237b9365c92df6570b446…
4k4xs4pH1r3 Feb 2, 2022
c6de418
fix: Dockerfile to reduce vulnerabilities
snyk-bot Feb 2, 2022
fc4ffb5
Merge pull request #8 from 4k4xs4pH1r3/snyk-fix-237b9365c92df6570b446…
4k4xs4pH1r3 Feb 2, 2022
ad133fe
Merge pull request #4 from 4k4xs4pH1r3/whitesource/configure
4k4xs4pH1r3 Feb 23, 2022
d1e932d
Bump requests from 2.24.0 to 2.31.0
dependabot[bot] May 23, 2023
7cd2434
Merge pull request #10 from 4k4xs4pH1r3/dependabot/pip/requests-2.31.0
4k4xs4pH1r3 Jul 20, 2023
549efb7
Merge branch 'vchinnipilli:master' into master
4k4xs4pH1r3 Jul 20, 2023
8b09b88
Bump urllib3 from 1.26.5 to 1.26.18
dependabot[bot] Oct 18, 2023
8673a83
Merge pull request #12 from 4k4xs4pH1r3/dependabot/pip/urllib3-1.26.18
4k4xs4pH1r3 Apr 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/anchore-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow checks out code, builds an image, performs a container image
# vulnerability scan with Anchore's Grype tool, and integrates the results with GitHub Advanced Security
# code scanning feature. For more information on the Anchore scan action usage
# and parameters, see https://github.com/anchore/scan-action. For more
# information on Anchore's container image scanning tool Grype, see
# https://github.com/anchore/grype
name: Anchore Container Scan

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '17 18 * * 0'

jobs:
Anchore-Build-Scan:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag localbuild/testimage:latest
- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
uses: anchore/scan-action@main
with:
image: "localbuild/testimage:latest"
acs-report-enable: true
- name: Upload Anchore Scan Report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '44 23 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
41 changes: 41 additions & 0 deletions .github/workflows/kubesec-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Kubesec

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '37 17 * * 5'

jobs:
lint:
name: Kubesec
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Run kubesec scanner
uses: controlplaneio/kubesec-action@43d0ddff5ffee89a6bb9f29b64cd865411137b14
with:
input: file.yaml # specify configuration file to scan here
format: template
template: template/sarif.tpl
output: kubesec-results.sarif
exit-code: "0"

- name: Upload Kubesec scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: kubesec-results.sarif
37 changes: 37 additions & 0 deletions .github/workflows/semgrep-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow file requires a free account on Semgrep.dev to
# manage rules, file ignores, notifications, and more.
#
# See https://semgrep.dev/docs

name: Semgrep

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '16 16 * * 4'

jobs:
semgrep:
name: Scan
runs-on: ubuntu-latest
steps:
# Checkout project source
- uses: actions/checkout@v2

# Scan code using project's configuration on https://semgrep.dev/manage
- uses: returntocorp/semgrep-action@v1
with:
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
publishDeployment: ${{ secrets.SEMGREP_DEPLOYMENT_ID }}
generateSarif: "1"

# Upload SARIF file generated in previous step
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: semgrep.sarif
if: always()
43 changes: 43 additions & 0 deletions .github/workflows/snyk-container-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# A sample workflow which checks out the code, builds a container
# image using Docker and scans that image for vulnerabilities using
# Snyk. The results are then uploaded to GitHub Security Code Scanning
#
# For more examples, including how to limit scans to only high-severity
# issues, monitor images for newly disclosed vulnerabilities in Snyk and
# fail PR checks for new vulnerabilities, see https://github.com/snyk/actions/

name: Snyk Container

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '27 4 * * 4'

jobs:
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build a Docker image
run: docker build -t your/image-to-test .
- name: Run Snyk to check Docker image for vulnerabilities
# Snyk can be used to break the build when it detects vulnerabilities.
# In this case we want to upload the issues to GitHub Code Scanning
continue-on-error: true
uses: snyk/actions/docker@master
env:
# In order to use the Snyk Action you will need to have a Snyk API token.
# More details in https://github.com/snyk/actions#getting-your-snyk-token
# or you can signup for free at https://snyk.io/login
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: your/image-to-test
args: --file=Dockerfile
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: snyk.sarif
42 changes: 42 additions & 0 deletions .github/workflows/snyk-infrastructure-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# A sample workflow which checks out your Infrastructure as Code Configuration files,
# such as Kubernetes, Helm & Terraform and scans them for any security issues.
# The results are then uploaded to GitHub Security Code Scanning
#
# For more examples, including how to limit scans to only high-severity issues
# and fail PR checks, see https://github.com/snyk/actions/

name: Snyk Infrastructure as Code

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '36 8 * * 2'

jobs:
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Snyk to check configuration files for security issues
# Snyk can be used to break the build when it detects security issues.
# In this case we want to upload the issues to GitHub Code Scanning
continue-on-error: true
uses: snyk/actions/iac@master
env:
# In order to use the Snyk Action you will need to have a Snyk API token.
# More details in https://github.com/snyk/actions#getting-your-snyk-token
# or you can signup for free at https://snyk.io/login
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
# Add the path to the configuration file that you would like to test.
# For example `deployment.yaml` for a Kubernetes deployment manifest
# or `main.tf` for a Terraform configuration file
file: your-file-to-test.yaml
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: snyk.sarif
36 changes: 36 additions & 0 deletions .github/workflows/trivy-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '21 10 * * 3'

jobs:
build:
name: Build
runs-on: "ubuntu-18.04"
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build an image from Dockerfile
run: |
docker build -t docker.io/my-organization/my-app:${{ github.sha }} .

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: 'trivy-results.sarif'
12 changes: 12 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scanSettings": {
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "LOW"
}
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8.0-slim as builder
FROM python:3.11-rc-slim as builder
RUN apt-get update -y \
&& apt-get clean -y
WORKDIR /kubestriker
Expand All @@ -7,7 +7,7 @@ RUN pip install --upgrade pip \
&& pip install kubestriker


FROM python:3.8.0-slim
FROM python:3.11-rc-slim
LABEL maintainer="vasant kumar chinnipilli"
COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
COPY --from=builder /kubestriker /kubestriker
Expand Down
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ progress==1.5
prompt-toolkit==1.0.15
SelectMenu
pyfiglet==0.8.post1
PyYAML==5.3.1
requests==2.24.0
urllib3==1.25.10
PyYAML==5.4
requests==2.31.0
urllib3==1.26.18
websocket-client==0.53.0