Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
47f4b62
GitHub Action: add matrix syntax for aarch64
cfc4n Jun 12, 2022
a18c2ae
GitHub Action: add ubuntu 22.04 config.
cfc4n Jun 13, 2022
bc84591
add github action for CI/CD aarch64
cfc4n Jun 13, 2022
d18fbca
GitHub Action: fix syntax.
cfc4n Jun 13, 2022
6de675b
GitHub Action: fix syntax.
cfc4n Jun 13, 2022
8322489
GitHub Action: fix syntax Input required and not supplied: run
cfc4n Jun 13, 2022
865c964
GitHub Action: fix syntax Input required and not supplied: run
cfc4n Jun 13, 2022
4cd8fce
GitHub Action: update go-c-cpp.yml
cfc4n Jun 14, 2022
9b91d29
GitHub Action: downgrade ubuntu version 20.04 from 22.04
cfc4n Jun 14, 2022
487c755
GitHub Action: for debug
cfc4n Jun 14, 2022
05ba544
GitHub Action: for debug
cfc4n Jun 14, 2022
6fb5fb9
GitHub Action: for debug
cfc4n Jun 14, 2022
1b82577
GitHub Action: for debug
cfc4n Jun 14, 2022
6726d5b
Merge branch 'arm64-architecture' of github.com:ehids/ecapture into a…
cfc4n Jun 14, 2022
ffcc8a8
GitHub Action: for debug
cfc4n Jun 14, 2022
996190a
GitHub Action: for debug
cfc4n Jun 14, 2022
269b4a5
GitHub Action: for debug
cfc4n Jun 14, 2022
afcffb5
GitHub Action: for debug....f*ck github action
cfc4n Jun 14, 2022
c324fa6
GitHub Action: for debug....ing
cfc4n Jun 14, 2022
0fa9f0b
GitHub Action: for debug....ing
cfc4n Jun 14, 2022
50ce5da
GitHub Action: for debug....ing
cfc4n Jun 14, 2022
f18e5fd
GitHub Action: for debug....ing
cfc4n Jun 14, 2022
00731df
GitHub Action: for debug....ing
cfc4n Jun 14, 2022
1f981db
update codeql version.
cfc4n Jun 16, 2022
fb1e556
add arm64 vmlinux_510.h
cfc4n Jun 16, 2022
a3d0615
add x86 directory
cfc4n Jun 16, 2022
0af955a
reset BPFHEADER vaule
cfc4n Jun 16, 2022
0c51b1f
fix include header path.
cfc4n Jun 16, 2022
cfe082a
update eCapture Version format string.
cfc4n Jun 16, 2022
502ff24
Merge pull request #75 from ehids/arm64-architecture
cfc4n Jun 16, 2022
45def5a
update git branch name.
cfc4n Jun 16, 2022
07d8ed0
typos of GitHub action
cfc4n Jun 16, 2022
0984d8d
update git branch name.
cfc4n Jun 16, 2022
5829182
use ${GITHUB_REF_NAME} replace ${GITHUB_REF}
cfc4n Jun 16, 2022
889c8b9
update git branch name.
cfc4n Jun 16, 2022
91372ce
fixed: outputing blank text on linux 4.18 #81
cfc4n Jun 17, 2022
e4fdd68
Merge pull request #82 from ehids/outputing-blank-text
cfc4n Jun 17, 2022
4ad549d
New feature: update ebpfmanager package to 0.3.0
cfc4n Jun 17, 2022
0fb6991
update golang version to 1.17.4
cfc4n Jun 17, 2022
77659a1
Merge pull request #83 from ehids/ebpfmanager-v0_3_0
cfc4n Jun 17, 2022
a499344
New feature: #80 event filter by uid
cfc4n Jun 17, 2022
3215a54
Merge pull request #84 from ehids/bash-filter-by-uid
cfc4n Jun 17, 2022
4f7a72b
New feature: #85 event filter by uid
cfc4n Jun 17, 2022
1e4e410
Merge pull request #86 from ehids/ssltls-filter-by-uid
cfc4n Jun 17, 2022
8dc7839
New feature: #87 support Android 12+
cfc4n Jun 18, 2022
126b037
New feature: #87 support Android 12+ (openssl module)
cfc4n Jun 18, 2022
445fdf5
Merge pull request #88 from ehids/support-android
cfc4n Jun 18, 2022
a328e33
fixed: #92 github checkout error while a PR sent.
cfc4n Jun 19, 2022
530ab65
add set-safe-directory argument.
cfc4n Jun 19, 2022
e1b745d
add set-safe-directory argument in container.
cfc4n Jun 19, 2022
f5c283a
add ecapture help command
cfc4n Jun 19, 2022
ce85b39
Merge pull request #93 from ehids/error-pathspec
cfc4n Jun 19, 2022
8b18f1f
update release tar.gz filename.
cfc4n Jun 19, 2022
15e7389
update version string.
cfc4n Jun 19, 2022
0c746fb
fix variable define.
cfc4n Jun 19, 2022
ee5fded
add release_notes.txt
cfc4n Jun 19, 2022
92a6d78
add changelog for GitHub action
cfc4n Jun 19, 2022
2659bbd
add android release script
cfc4n Jun 19, 2022
73e4398
revert codeql-analysis.yml config.
cfc4n Jun 19, 2022
c6e6262
fixed: tar.fz archive's name.
cfc4n Jun 19, 2022
81819dd
update: release upload script
cfc4n Jun 19, 2022
c62cbac
update: append checksum info.
cfc4n Jun 19, 2022
264bd4e
add: gh command help url
cfc4n Jun 19, 2022
195ff60
Merge pull request #94 from ehids/auto-release-android-gki
cfc4n Jun 19, 2022
46d2d04
PRE RELEASE v0.1.10
cfc4n Jun 19, 2022
9840418
RELEASE v0.1.10
cfc4n Jun 19, 2022
9ce698b
RELEASE v0.1.10 (update release date)
cfc4n Jun 19, 2022
92747ac
RELEASE v0.1.10 (update release date)
cfc4n Jun 19, 2022
8c84bec
RELEASE v0.1.10 (update release date)
cfc4n Jun 19, 2022
87d818e
Directly search so in search path when /usr/bin/curl is not exist
tiann Jun 20, 2022
b7381e9
Merge pull request #97 from tiann/master
cfc4n Jun 20, 2022
4d1751f
add golangci-lint Action yaml
cfc4n Jun 20, 2022
1142d70
golang-line: notice fixed.
cfc4n Jun 20, 2022
8787375
golang-line: notice fixed.
cfc4n Jun 20, 2022
8e6845b
update golangci-lint block location.
cfc4n Jun 20, 2022
5f71c17
update golangci-lint block location.
cfc4n Jun 20, 2022
bfce3e8
Merge pull request #99 from ehids/golangci-lint
cfc4n Jun 20, 2022
01c14dd
Ignore build artifacts
chenhengqi Jun 21, 2022
010baaa
pkg: Add proc package
chenhengqi Jun 21, 2022
cbb6674
Add chinese name 旁观者.
cfc4n Jun 21, 2022
88dec83
Merge pull request #103 from ehids/add-chinese-name
cfc4n Jun 21, 2022
7c94e79
build: change tar.gz file path in checksum.txt
cfc4n Jun 21, 2022
ebb1464
Merge pull request #104 from ehids/checksum-path
cfc4n Jun 21, 2022
a95854a
Support Go binaries introspection
chenhengqi Jun 21, 2022
2232413
Merge pull request #100 from chenhengqi/golang-https
cfc4n Jun 22, 2022
c425dea
New Feature: support Android without GKI (kernel version > 4.18)
cfc4n Jun 22, 2022
6a07d2f
change BPF config detect logic.
cfc4n Jun 22, 2022
57fb4ef
typos.
cfc4n Jun 22, 2022
0385e24
Merge pull request #107 from ehids/android-without-gki
cfc4n Jun 22, 2022
a77c8db
fixed :#108 tls module cannot to capture payload on Aarch64 kernel 4.18
huzai9527 Jun 24, 2022
c90cacf
Merge pull request #109 from huzai9527/master
cfc4n Jun 24, 2022
2f21911
fixed #108: ip address lost on aarch64 kernel 4.18
cfc4n Jun 25, 2022
e083d55
Merge pull request #111 from ehids/aarch64-lost_payload
cfc4n Jun 25, 2022
900665e
New feature: add payload parser.
cfc4n Jun 28, 2022
2a42149
add payload parser.
cfc4n Jul 1, 2022
4a649ef
add Testdata for unit Testing.
cfc4n Jul 1, 2022
9d0031f
update unit Testing.
cfc4n Jul 1, 2022
db33f79
add parser type for http_request
cfc4n Jul 2, 2022
7ebb4fd
rollback text context
cfc4n Jul 2, 2022
b342b64
hard code parser type.
cfc4n Jul 2, 2022
6381875
parser http_request works.
cfc4n Jul 3, 2022
7baef54
http_response parser works.
cfc4n Jul 3, 2022
1b06240
remove method: Body()
cfc4n Jul 3, 2022
0dff170
fixed : invalid memory address `gzip reader decode failed`
cfc4n Jul 3, 2022
12c37af
remove unused files.
cfc4n Jul 3, 2022
a3ab892
change logger to go SDK log from zap.logger
cfc4n Jul 3, 2022
2d3e88b
fixed: flag accessed but not defined: savefile
cfc4n Jul 3, 2022
ffc2ef4
improve: change ievent Interface to event_process package from user p…
cfc4n Jul 3, 2022
a6abb0e
unit testing...
cfc4n Jul 3, 2022
5558183
logger output format.
cfc4n Jul 3, 2022
67983eb
Merge pull request #113 from ehids/payload-decoder
cfc4n Jul 3, 2022
64d9390
document: message friendly
cfc4n Jul 3, 2022
463c36e
Merge pull request #119 from ehids/msg-firendly
cfc4n Jul 3, 2022
2ad87a4
Release v0.2.0
cfc4n Jul 3, 2022
0dce220
Merge branch 'master' of github.com:ehids/ecapture
cfc4n Jul 3, 2022
302dddb
Release v0.2.0
cfc4n Jul 3, 2022
6de35fa
pkg : fix Kernel config read failed, error:Config not found #117
cfc4n Jul 5, 2022
5633f2e
workflow: disable go test on qemu
cfc4n Jul 5, 2022
c96bffd
Merge pull request #123 from ehids/config-read-failed
cfc4n Jul 5, 2022
d8964fa
user : output message friendly.
cfc4n Jul 5, 2022
d983714
Merge pull request #124 from ehids/122-android-hook-failed
cfc4n Jul 5, 2022
544c54d
Release v0.2.1
cfc4n Jul 5, 2022
09216f1
workflows: build failed on aarch 64 ubuntu : 'linux/kconfig.h' file n…
cfc4n Jul 7, 2022
1849e98
workflows: rollback filename of `make script` in qemu Action
cfc4n Jul 7, 2022
1b14984
Merge pull request #126 from ehids/aarch64-kconfig-file-not-found
cfc4n Jul 7, 2022
dad9610
ebpf: remove detection of BPF config when running at container #127
cfc4n Jul 7, 2022
c87fe4e
workflows: rollback `ecapture -h` while CI script works at qemu docker.
cfc4n Jul 7, 2022
a74fe43
print /proc/1/cgroup info
cfc4n Jul 7, 2022
0a9a4ce
pkg/util : add k8s/k3s container detection.
cfc4n Jul 8, 2022
a6d3af3
pkg/util : add detection
cfc4n Jul 8, 2022
ba8aa06
pkg/util : turn off `ecapture -v` with Android version.
cfc4n Jul 8, 2022
7639dbe
* : Makefile shell running,with a unexcepted result: lost DKERNEL_LES…
cfc4n Jul 8, 2022
3c07671
Merge pull request #132 from ehids/makefile-shell
cfc4n Jul 8, 2022
6c39ce8
Merge pull request #128 from ehids/remove-detection-bpf
cfc4n Jul 8, 2022
ad0a0e3
Release v0.2.2
cfc4n Jul 8, 2022
1606daf
add v0.2.2 changelog.
cfc4n Jul 8, 2022
af48f54
all : refactor event_processor EventType.
cfc4n Jul 10, 2022
b5490c7
cmd : format output string.
cfc4n Jul 10, 2022
45791be
Merge pull request #134 from ehids/event_processor-tls
cfc4n Jul 10, 2022
c625866
fixed #138 : You have an error in your yaml syntax on line 79
cfc4n Jul 15, 2022
2bfa528
Merge pull request #139 from ehids/yaml-syntax
cfc4n Jul 16, 2022
018abc0
support : #27 capture openssl master key .
cfc4n Jul 19, 2022
1f0239f
make format
cfc4n Jul 19, 2022
508a0ba
go tidy , remove unused packages.
cfc4n Jul 19, 2022
0fd4317
save master key to file ecapture_masterkey_[%d].log
cfc4n Jul 20, 2022
f280144
Merge pull request #140 from ehids/openssl-masterkey
cfc4n Jul 20, 2022
d9f115b
release 0.3.0 , Support:tls master secret captured.
cfc4n Jul 20, 2022
a723bd8
update CHANGELOG.md
cfc4n Jul 20, 2022
eecf74d
user : add TLS 1.3 master secret event.
cfc4n Jul 22, 2022
eda0c38
improve TLS 1.3 master secret.
cfc4n Jul 23, 2022
3c971eb
improve: get SESSION_CIPHER->cipher->id for tls 1.3
cfc4n Jul 23, 2022
e4dfc84
get all master_secrets of tls 1.3 ,sent to userspace by ebpf map.
cfc4n Jul 23, 2022
df7c545
update CHANGELOG.md
cfc4n Jul 20, 2022
bb99e96
user : add TLS 1.3 master secret event.
cfc4n Jul 22, 2022
efeb434
improve TLS 1.3 master secret.
cfc4n Jul 23, 2022
ef014d3
improve: get SESSION_CIPHER->cipher->id for tls 1.3
cfc4n Jul 23, 2022
3067080
get all master_secrets of tls 1.3 ,sent to userspace by ebpf map.
cfc4n Jul 23, 2022
d7f3eed
user : fix format string args miss.
cfc4n Jul 23, 2022
edeecec
pkg : add hkdf package.
cfc4n Jul 25, 2022
bd6fa89
user : improve TLS 1.3 master secrets save to logfile.
cfc4n Jul 25, 2022
f4933b0
user : set transcript by event.CipherId
cfc4n Jul 26, 2022
4f77669
user : update transcript by event.CipherId
cfc4n Jul 26, 2022
b089ce0
pkg: rename hkdf expandLable function name to DeriveSecret.
cfc4n Jul 27, 2022
7300085
user : use constants from hkdf package.
cfc4n Jul 27, 2022
145dd36
Merge branch 'master' of github.com:ehids/ecapture
cfc4n Jul 27, 2022
fab8669
cli : change write-file command flag to log-file .
cfc4n Jul 28, 2022
541685c
cli : add -w, -i flags into tls module.
cfc4n Jul 28, 2022
2387854
user : disable gossl module when gobin not setting.
cfc4n Jul 28, 2022
270ef13
cli : rename constant name ErrorGoBINNotFound to ErrorGoBINNotSET.
cfc4n Jul 28, 2022
d13fec9
kern : add openssl_tc submodule.
cfc4n Jul 28, 2022
9b88333
kern : capture rawpacket from TC eBPF program.
cfc4n Jul 30, 2022
9b604d3
user : echo String() or StringHex() by CLI argument.
cfc4n Jul 30, 2022
fb955f4
user : support gossl StringHex() feature.
cfc4n Jul 30, 2022
cb4b8f2
cli/cmd : clean up all probe while process exit. (#150)
cfc4n Aug 1, 2022
ffdf9c6
user : fix println call has possible formatting directive %s
cfc4n Aug 1, 2022
03dbfe4
kern : add port filter for TC probe.
cfc4n Aug 2, 2022
283dbaf
user : add pcap writer.
cfc4n Aug 2, 2022
ce62a82
Merge branch 'master' into pcapng-files
cfc4n Aug 2, 2022
42cb345
Merge branch 'master' into pcapng-files
cfc4n Aug 2, 2022
def9373
go.sum : revert go-bindata package
cfc4n Aug 2, 2022
c90747c
cli/cmd : fix variable name.
cfc4n Aug 2, 2022
e6dfa38
user : remove return value.
cfc4n Aug 2, 2022
1cf4ba5
user : improve TCP packet captured.
cfc4n Aug 3, 2022
c31a460
user : check error, return value of `unix.ClockGettime`.
cfc4n Aug 3, 2022
620e7f6
Merge pull request #148 from ehids/pcapng-files
cfc4n Aug 3, 2022
327a5de
user : Support writing pcapng files with Decryption Secrets Block (DSB).
cfc4n Aug 5, 2022
5463cf6
go.mod : go mod tidy
cfc4n Aug 5, 2022
5fff92e
kern : support BTF disabled.
cfc4n Aug 6, 2022
7c78aea
user : remove SSL_write|read_ex Hooks.
cfc4n Aug 6, 2022
c588b04
user : filter Ifname
cfc4n Aug 6, 2022
188a8ad
user : add tcPackets locker.
cfc4n Aug 6, 2022
b1cf0ba
user : revert ifname filter.
cfc4n Aug 6, 2022
0a7abd6
user : fix DSB lost error.
cfc4n Aug 7, 2022
f9c0daa
images : update docs/images.
cfc4n Aug 7, 2022
53c9666
docs : update README.md
cfc4n Aug 7, 2022
3bc9df8
user : update master key filename.
cfc4n Aug 7, 2022
914dffd
docs : update golang version.
cfc4n Aug 7, 2022
b28ab31
docs : release 0.4.0,support pcapng file
cfc4n Aug 7, 2022
06934b6
kern : define variable target_port always.
cfc4n Aug 8, 2022
d31c01c
workflows : build nocore version for Android.
cfc4n Aug 8, 2022
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
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Linux Server/Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Kernel Version [e.g. 5.10]
- Version [e.g. 0.1.3-20220313-69c1e0]
**Linux Server/Android (please complete the following information):**

- OS: [e.g. Ubuntu 21.04]
- Arch: [e.g. arm_aarch64]
- Kernel Version: [e.g. 5.10]
- Version: [e.g. 0.1.3-20220313-69c1e0]

**Additional context**
Add any other context about the problem here.
76 changes: 38 additions & 38 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,46 +37,46 @@ jobs:
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- uses: actions/setup-go@v3
with:
go-version: '1.16.14'
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17.4'
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
done
shell: bash
# 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
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
done
shell: bash
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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
# 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@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ 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
# ✏️ 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
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- run: |
make env
make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
267 changes: 247 additions & 20 deletions .github/workflows/go-c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,253 @@ on:
branches: [ master ]

jobs:
build:
build-on-ubuntu2004:
runs-on: ubuntu-20.04
name: build on ubuntu-20.04 x86_64
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.17.4'
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
done
shell: bash
- uses: actions/checkout@v3
- name: Build
run: |
make clean
make env
make
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
# version: v3.2.0

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: --disable-all -E errcheck

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

runs-on: ubuntu-latest
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
- name: Build NOCORE
run: |
make clean
make env
make nocore
- name: Test
run: go test -v ./...

build-on-ubuntu2204:
runs-on: ubuntu-22.04
name: build on ubuntu-22.04 x86_64
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.16.14'
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
done
shell: bash
- uses: actions/checkout@v2
- name: Build
run: make all
- name: Test
run: go test -v ./...
- uses: actions/setup-go@v3
with:
go-version: '1.17.4'
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-14 clang-14 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
shell: bash
- uses: actions/checkout@v3
- name: Build
run: |
make clean
make env
make
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
# version: v3.2.0

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: --disable-all -E errcheck

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
- name: Build NOCORE
run: |
make clean
make env
make nocore
- name: Test
run: go test -v ./...

build-on-ubuntu2204-arm64:
runs-on: ubuntu-22.04
name: build on ubuntu-22.04 arm64
# Run steps on a matrix of 3 arch/distro combinations
strategy:
matrix:
include:
- arch: aarch64
distro: ubuntu22.04
steps:
- uses: actions/checkout@v3
with:
set-safe-directory: '/source_code'
- name: Branch Name
run: |
echo running on branch ${{ github.ref_name }}
echo checkout directory ${GITHUB_WORKSPACE}
echo PWD directory ${PWD}
- name: Write File
uses: DamianReeves/write-file-action@v1.0
with:
path: ./bin/release_notes.txt
contents: |
"just for CI"
write-mode: append
- uses: uraimo/run-on-arch-action@v2
name: Build artifact
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}

# Not required, but speeds up builds
githubToken: ${{ github.token }}

# Create an artifacts directory
setup: |
mkdir -p "${PWD}/artifacts"

# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
--volume "${GITHUB_WORKSPACE}:/source_code"

# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
artifact_name: ecapture-${{ steps.get_tags.outputs.VERSION }}

# The shell to run commands with in the container
shell: /bin/sh

# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
uname -a
apt-get update
apt-get install --yes wget git golang build-essential pkgconf libelf-dev llvm-14 clang-14 linux-tools-generic linux-tools-common
# Produce a binary artifact and place it in the mounted volume
run: |
uname -a
date
export PATH=$PATH:/usr/local/bin
for tool in "clang" "llc" "llvm-strip"
do
rm -f /usr/bin/$tool
ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
clang --version
which bpftool
echo "cat /proc/1/cgroup:"
cat /proc/1/cgroup
echo "cat /proc/1/sched:"
cat /proc/1/sched
git config --global --add safe.directory /source_code
cd /source_code
echo "-------------------start: Create ecapture.tar.gz of Linux -------------------"
make env
make clean
make
echo "-------------------ecapture --help-------------------"
bin/ecapture -v
echo "-------------------create tar.gz file-------------------"
UNAME_M=`uname -m`
OUTPUT_DIR="./bin"
SNAPSHOT_VERSION=${{ steps.get_tags.outputs.VERSION }}
echo "#${SNAPSHOT_VERSION}#"
if [ -z "${SNAPSHOT_VERSION}" ]; then
SNAPSHOT_VERSION="v0.0.0"
fi
TAR_DIR=ecapture-${SNAPSHOT_VERSION}-linux-${UNAME_M}
RELEASE_NOTES=${OUTPUT_DIR}/release_notes.txt
OUT_ARCHIVE=${OUTPUT_DIR}/${artifact_name}-linux-${{ matrix.arch }}.tar.gz
mkdir -p ${TAR_DIR}
cp LICENSE ${TAR_DIR}/LICENSE
cp CHANGELOG.md ${TAR_DIR}/CHANGELOG.md
cp README.md ${TAR_DIR}/README.md
cp README_CN.md ${TAR_DIR}/README_CN.md
cp ${OUTPUT_DIR}/ecapture ${TAR_DIR}/ecapture
cp ${OUTPUT_DIR}/release_notes.txt ${TAR_DIR}/release_notes.txt
tar -czf ${OUT_ARCHIVE} ${TAR_DIR}
cp ${OUT_ARCHIVE} "/artifacts/"
echo "-------------------end: Create ecapture.tar.gz of Linux -------------------"
echo "-------------------start: Create ecapture.tar.gz of Android kernel CO:RE -------------------"
make env
make clean
ANDROID=1 make
echo "-------------------ecapture --help-------------------"
echo "bin/ecapture -v"
echo "-------------------create tar.gz file-------------------"
UNAME_M=`uname -m`
OUTPUT_DIR="./bin"
SNAPSHOT_VERSION=${{ steps.get_tags.outputs.VERSION }}
echo "#${SNAPSHOT_VERSION}#"
if [ -z "${SNAPSHOT_VERSION}" ]; then
SNAPSHOT_VERSION="v0.0.0"
fi
TAR_DIR=ecapture-${SNAPSHOT_VERSION}-android_gki-${UNAME_M}
RELEASE_NOTES=${OUTPUT_DIR}/release_notes.txt
OUT_ARCHIVE=${OUTPUT_DIR}/${artifact_name}-android_core-${{ matrix.arch }}.tar.gz
mkdir -p ${TAR_DIR}
cp LICENSE ${TAR_DIR}/LICENSE
cp CHANGELOG.md ${TAR_DIR}/CHANGELOG.md
cp README.md ${TAR_DIR}/README.md
cp README_CN.md ${TAR_DIR}/README_CN.md
cp ${OUTPUT_DIR}/ecapture ${TAR_DIR}/ecapture
cp ${OUTPUT_DIR}/release_notes.txt ${TAR_DIR}/release_notes.txt
tar -czf ${OUT_ARCHIVE} ${TAR_DIR}
cp ${OUT_ARCHIVE} "/artifacts/"
echo "-------------------end: Create ecapture.tar.gz of Android kernel CO:RE -------------------"
echo "Produced artifact at /artifacts/${artifact_name}"

- name: Show the artifact
# Items placed in /artifacts in the container will be in
# ${PWD}/artifacts on the host.
run: |
ls -al "${PWD}/artifacts"
Loading