Skip to content

Commit

Permalink
Merge pull request #287 from projectdiscovery/dev
Browse files Browse the repository at this point in the history
v2.0.6
  • Loading branch information
ehsandeep authored Mar 31, 2022
2 parents f197df5 + ac606db commit 51cdc9f
Show file tree
Hide file tree
Showing 54 changed files with 1,533 additions and 322 deletions.
12 changes: 9 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@ updates:
commit-message:
prefix: "chore"
include: "scope"
labels:
- "Type: Maintenance"

# Maintain dependencies for go modules
- package-ecosystem: "gomod"
directory: "/"
directory: "v2/"
schedule:
interval: "weekly"
interval: "daily"
target-branch: "dev"
commit-message:
prefix: "chore"
include: "scope"
labels:
- "Type: Maintenance"

# Maintain dependencies for docker
- package-ecosystem: "docker"
Expand All @@ -34,4 +38,6 @@ updates:
target-branch: "dev"
commit-message:
prefix: "chore"
include: "scope"
include: "scope"
labels:
- "Type: Maintenance"
34 changes: 25 additions & 9 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,43 @@ on:
pull_request:
workflow_dispatch:


jobs:
build:
name: Build Test
runs-on: ubuntu-latest
name: Test Builds
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # Todo: windows-latest, macOS-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Check out code
uses: actions/checkout@v3

- name: Install libpcap-dev
run: sudo apt install libpcap-dev

- name: Check out code
uses: actions/checkout@v2

- name: Test
run: go test .
working-directory: v2/cmd/naabu/
- name: Install nmap
run: sudo apt install nmap

- name: Build
run: go build .
working-directory: v2/cmd/naabu/

- name: Test
run: go test ./...
working-directory: v2/

# Todo
# - name: Integration Tests
# env:
# GH_ACTION: true
# run: bash run.sh
# working-directory: integration_tests/

- name: Race Condition Tests
run: go build -race .
working-directory: v2/cmd/naabu/
6 changes: 5 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: 🚨 CodeQL Analysis

on:
workflow_dispatch:
push:
pull_request:
branches:
- dev
Expand All @@ -22,8 +23,11 @@ jobs:
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]

steps:
- name: Install libpcap-dev
run: sudo apt install libpcap-dev

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get Github tag
id: meta
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 🧪 Functional Test
on:
push:
pull_request:
workflow_dispatch:

jobs:
functional:
name: Functional Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # Todo: windows-latest, macOS-latest

steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Check out code
uses: actions/checkout@v3

- name: Install required packages (libpcap-dev, nmap, simplehttpserver)
run: |
sudo apt install libpcap-dev
sudo apt install nmap
go install github.com/projectdiscovery/simplehttpserver/cmd/simplehttpserver@latest
- name: Run the simplehttpserver on 127.0.0.1:8000
run: |
export PATH=$PATH:$(go env GOPATH)/bin
simplehttpserver -listen 127.0.0.1:8000 &
- name: Functional Tests
run: |
chmod +x run.sh
bash run.sh
working-directory: v2/cmd/functional-test
12 changes: 10 additions & 2 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Install Dependences
run: sudo apt install libpcap-dev

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3.1.0
with:
version: latest
args: --timeout 5m
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
Expand All @@ -55,7 +55,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 👮🏼‍♂️ Sonarcloud
on:
push:
branches:
- master
- dev
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: "Set up Go"
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Install Dependences
run: sudo apt install libpcap-dev

- name: Run unit Tests
working-directory: v2/
run: |
go test -coverprofile=cov.out ./...
- name: Run Gosec Security Scanner
working-directory: v2/
run: |
go install github.com/securego/gosec/cmd/gosec@latest
gosec -no-fail -fmt=sonarqube -out report.json ./...
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
cmd/naabu/naabu*
v2/cmd/naabu/naabu*
vendor
vendor
v2/cmd/functional-test/naabu_dev
v2/cmd/functional-test/functional-test
v2/cmd/functional-test/naabu
v2/cmd/functional-test/*.cfg
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.17.2-alpine AS builder
FROM golang:1.18.0-alpine AS builder
RUN apk add build-base libpcap-dev
RUN go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest

FROM alpine:3.14
FROM alpine:3.15.2
RUN apk add nmap libpcap-dev bind-tools ca-certificates
COPY --from=builder /go/bin/naabu /usr/local/bin/naabu
ENTRYPOINT ["naabu"]
Loading

0 comments on commit 51cdc9f

Please sign in to comment.