Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit d3a0b29

Browse files
committed
initial public release
1 parent 9c3aa0b commit d3a0b29

File tree

387 files changed

+43810
-28
lines changed

Some content is hidden

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

387 files changed

+43810
-28
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: Report errors or unexpected behavior
4+
labels: Issue-Bug
5+
---
6+
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
7+
<!-- Please search existing issues to avoid creating duplicates. -->
8+
9+
## Information
10+
11+
- Onefuzz version:
12+
- OS:
13+
14+
## Provide detailed reproduction steps (if any)
15+
16+
1.
17+
2.
18+
3.
19+
20+
### Expected result
21+
22+
_What is the expected result of the above steps?_
23+
24+
### Actual result
25+
26+
_What is the actual result of the above steps?_

.github/ISSUE_TEMPLATE/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Documentation Issue
3+
about: Report issues in our documentation
4+
title: ''
5+
labels: Issue-Docs
6+
assignees: ''
7+
8+
---
9+
10+
<!-- Briefly describe which document needs to be corrected and why. -->
11+
12+
## Provide a description of requested docs changes
13+
14+
_What is the purpose and what should be changed?_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
---
5+
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
6+
<!-- Please search existing issues to avoid creating duplicates. -->
7+
8+
<!-- Describe the feature you'd like. -->

.github/pull_request_template.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Summary of the Pull Request
2+
3+
_What is this about?_
4+
5+
## PR Checklist
6+
* [ ] Applies to work item: #xxx
7+
* [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/onefuzz) and sign the CLI.
8+
* [ ] Tests added/passed
9+
* [ ] Requires documentation to be updated
10+
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx
11+
12+
## Info on Pull Request
13+
14+
_What does this include?_
15+
16+
## Validation Steps Performed
17+
18+
_How does someone test & validate?_

.github/workflows/ci.yml

+236
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
env:
5+
CARGO_TERM_COLOR: always
6+
7+
jobs:
8+
agent:
9+
runs-on: "${{ matrix.os }}"
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/cache@v2
13+
env:
14+
cache-name: cache-rust-target
15+
with:
16+
path: |
17+
src/agent/target
18+
~/.cargo/registry
19+
~/.cargo/git
20+
~/.cargo/bin
21+
~/.cache/sccache
22+
key: agent-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
23+
restore-keys: |
24+
agent-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
25+
agent-${{ runner.os }}
26+
- name: Linux Prereqs
27+
run: |
28+
sudo apt-get -y update
29+
sudo apt-get -y install libssl1.0-dev libunwind-dev
30+
if: "${{ runner.os == 'Linux' }}"
31+
- run: src/ci/agent.sh
32+
shell: bash
33+
- uses: actions/[email protected]
34+
with:
35+
name: build-artifacts
36+
path: artifacts
37+
strategy:
38+
matrix:
39+
os:
40+
- ubuntu-18.04
41+
- windows-2019
42+
azcopy:
43+
runs-on: ubuntu-18.04
44+
steps:
45+
- uses: actions/checkout@v2
46+
- run: src/ci/azcopy.sh
47+
- uses: actions/[email protected]
48+
with:
49+
name: build-artifacts
50+
path: artifacts
51+
cli:
52+
needs:
53+
- onefuzztypes
54+
runs-on: windows-2019
55+
steps:
56+
- uses: actions/checkout@v2
57+
- run: src/ci/set-versions.sh
58+
- uses: actions/setup-python@v2
59+
with:
60+
python-version: 3.7
61+
- uses: actions/[email protected]
62+
with:
63+
name: build-artifacts
64+
path: artifacts
65+
- name: Build
66+
shell: bash
67+
run: |
68+
set -ex
69+
ls artifacts
70+
cd src/cli
71+
pip install -r requirements-dev.txt
72+
pip-licenses -uf json > onefuzz/data/licenses.json
73+
python setup.py sdist bdist_wheel
74+
pip install -r ./requirements.txt ../../artifacts/sdk/*.whl
75+
pip install six
76+
pyinstaller onefuzz/__main__.py --onefile --name onefuzz --additional-hooks-dir extra/pyinstaller --hidden-import='pkg_resources.py2_warn' --exclude-module tkinter --exclude-module PySide2 --exclude-module PIL.ImageDraw --exclude-module Pillow
77+
./dist/onefuzz.exe --version
78+
mkdir -p ${GITHUB_WORKSPACE}/artifacts/windows-cli/
79+
mkdir -p ${GITHUB_WORKSPACE}/artifacts/sdk/
80+
cp dist/*.tar.gz dist/*.whl ${GITHUB_WORKSPACE}/artifacts/sdk/
81+
cp dist/onefuzz.exe ${GITHUB_WORKSPACE}/artifacts/windows-cli/
82+
- uses: actions/[email protected]
83+
with:
84+
name: build-artifacts
85+
path: artifacts
86+
- name: lint
87+
run: |
88+
cd src/cli
89+
pip install -r requirements-lint.txt
90+
flake8 .
91+
isort --profile black ./onefuzz ./examples/ ./tests/ --check
92+
mypy . --ignore-missing-imports
93+
pytest -v tests
94+
95+
# set a minimum confidence to ignore known false positives
96+
vulture --min-confidence 61 onefuzz
97+
onefuzztypes:
98+
runs-on: ubuntu-18.04
99+
steps:
100+
- uses: actions/checkout@v2
101+
- run: src/ci/set-versions.sh
102+
- uses: actions/setup-python@v2
103+
with:
104+
python-version: 3.7
105+
- run: src/ci/onefuzztypes.sh
106+
- uses: actions/[email protected]
107+
with:
108+
name: build-artifacts
109+
path: artifacts
110+
proxy:
111+
runs-on: ubuntu-18.04
112+
steps:
113+
- uses: actions/checkout@v2
114+
- uses: actions/cache@v2
115+
env:
116+
cache-name: cache-rust-proxy
117+
with:
118+
path: |
119+
src/proxy-manager/target
120+
~/.cargo/registry
121+
~/.cargo/git
122+
~/.cargo/bin
123+
~/.cache/sccache
124+
key: proxy-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
125+
restore-keys: |
126+
proxy-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
127+
proxy-${{ runner.os }}
128+
- run: src/ci/proxy.sh
129+
- uses: actions/[email protected]
130+
with:
131+
name: build-artifacts
132+
path: artifacts
133+
service:
134+
needs:
135+
- onefuzztypes
136+
runs-on: ubuntu-18.04
137+
steps:
138+
- uses: actions/checkout@v2
139+
- run: src/ci/set-versions.sh
140+
- uses: actions/setup-python@v2
141+
with:
142+
python-version: 3.7
143+
- uses: actions/[email protected]
144+
with:
145+
name: build-artifacts
146+
path: artifacts
147+
- name: Build Service
148+
run: |
149+
cd src/api-service/__app__
150+
echo ${GITHUB_RUN_ID} | tee onefuzzlib/build.id
151+
echo ${GITHUB_SHA} | tee onefuzzlib/git.version
152+
pip install --target="./.python_packages/lib/site-packages" -r ./requirements.txt ${GITHUB_WORKSPACE}/artifacts/sdk/onefuzztypes-*.whl
153+
zip -r api-service.zip .
154+
mkdir -p ${GITHUB_WORKSPACE}/artifacts/service
155+
cp api-service.zip ${GITHUB_WORKSPACE}/artifacts/service
156+
- uses: actions/[email protected]
157+
with:
158+
name: build-artifacts
159+
path: artifacts
160+
- name: lint
161+
run: |
162+
cd src/api-service
163+
rm -rf __app__/.python_packages
164+
pip install ${GITHUB_WORKSPACE}/artifacts/sdk/onefuzztypes-*.whl
165+
pip install -r __app__/requirements.txt
166+
pip install -r requirements-dev.txt
167+
pytest
168+
flake8 .
169+
isort --profile black ./__app__/ ./tests --check
170+
mypy __app__
171+
172+
# set a minimum confidence to ignore known false positives
173+
vulture --min-confidence 61 __app__
174+
afl:
175+
runs-on: ubuntu-18.04
176+
steps:
177+
- uses: actions/checkout@v2
178+
- run: src/ci/afl.sh
179+
- uses: actions/[email protected]
180+
with:
181+
name: build-artifacts
182+
path: artifacts
183+
radamsa-linux:
184+
runs-on: ubuntu-18.04
185+
steps:
186+
- uses: actions/checkout@v2
187+
- run: src/ci/radamsa-linux.sh
188+
- uses: actions/[email protected]
189+
with:
190+
name: build-artifacts
191+
path: artifacts
192+
package:
193+
needs:
194+
- agent
195+
- azcopy
196+
- cli
197+
- onefuzztypes
198+
- proxy
199+
- service
200+
- afl
201+
- radamsa-linux
202+
runs-on: ubuntu-18.04
203+
steps:
204+
- uses: actions/checkout@v2
205+
- uses: actions/[email protected]
206+
with:
207+
name: build-artifacts
208+
path: artifacts
209+
- name: Package Onefuzz
210+
run: |
211+
set -ex
212+
find artifacts
213+
mkdir release-artifacts
214+
cp -r src/runtime-tools src/deployment/tools
215+
cp artifacts/azcopy/azcopy artifacts/azcopy/ThirdPartyNotice.txt src/deployment/tools/linux
216+
cp artifacts/azcopy/azcopy.exe artifacts/azcopy/ThirdPartyNotice.txt src/deployment/tools/win64
217+
cp artifacts/agent/onefuzz-supervisor.exe src/deployment/tools/win64/
218+
cp artifacts/agent/onefuzz-agent.exe src/deployment/tools/win64/
219+
cp artifacts/agent/onefuzz-supervisor src/deployment/tools/linux/
220+
cp artifacts/agent/onefuzz-agent src/deployment/tools/linux/
221+
cp artifacts/proxy/onefuzz-proxy-manager src/deployment/tools/linux/
222+
cp artifacts/service/api-service.zip src/deployment
223+
cp -r artifacts/third-party src/deployment
224+
cp -r src/agent/script/linux/libfuzzer-coverage src/deployment/tools/linux/libfuzzer-coverage
225+
cp -r src/agent/script/win64/libfuzzer-coverage src/deployment/tools/win64/libfuzzer-coverage
226+
echo $GITHUB_RUN_ID | tee src/deployment/.build.id
227+
echo $GITHUB_SHA | tee src/deployment/.sha
228+
cp CURRENT_VERSION src/deployment/VERSION
229+
(cd src/deployment ; zip -r onefuzz-deployment-$(cat VERSION).zip . )
230+
cp src/deployment/onefuzz-deployment*zip release-artifacts
231+
cp -r artifacts/sdk release-artifacts
232+
cp -r artifacts/windows-cli/onefuzz.exe release-artifacts/onefuzz-cli-$(cat CURRENT_VERSION).exe
233+
- uses: actions/[email protected]
234+
with:
235+
name: release-artifacts
236+
path: release-artifacts

.gitignore

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
# Generated by Cargo
2-
# will have compiled files and executables
3-
/target/
4-
5-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7-
Cargo.lock
8-
9-
# These are backup files generated by rustfmt
10-
**/*.rs.bk
1+
.env
2+
.vscode
3+
.mypy_cache/
4+
.idea
5+
**/.direnv
6+
**/.envrc

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## 1.0.0
8+
### Added
9+
* Initial public release

CURRENT_VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

0 commit comments

Comments
 (0)