Skip to content

Commit 5c79b43

Browse files
committed
v3.0.0
0 parents  commit 5c79b43

472 files changed

Lines changed: 33837 additions & 0 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# EditorConfig helps maintain consistent coding styles
2+
# https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.sh]
13+
indent_style = space
14+
indent_size = 4
15+
16+
[*.bash]
17+
indent_style = space
18+
indent_size = 4
19+
20+
[*.bats]
21+
indent_style = space
22+
indent_size = 4
23+
24+
[Makefile]
25+
indent_style = tab
26+
27+
[*.md]
28+
trim_trailing_whitespace = false
29+
30+
[*.yml]
31+
indent_style = space
32+
indent_size = 2
33+
34+
[*.yaml]
35+
indent_style = space
36+
indent_size = 2
37+
38+
[*.json]
39+
indent_style = space
40+
indent_size = 2
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in OpenClaw Security Audit
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
15+
1. Run command `...`
16+
2. See error
17+
18+
## Expected Behavior
19+
20+
What you expected to happen.
21+
22+
## Actual Behavior
23+
24+
What actually happened.
25+
26+
## Environment
27+
28+
- **OS**: [e.g., Ubuntu 22.04, macOS 14.0]
29+
- **Bash version**: [output of `bash --version`]
30+
- **OpenClawAudit version**: [e.g., 3.0.0]
31+
32+
## Output
33+
34+
```
35+
Paste relevant output here
36+
```
37+
38+
## Additional Context
39+
40+
Add any other context about the problem here.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new security check or feature
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Problem Statement
10+
11+
A clear description of the problem or security gap this feature would address.
12+
13+
## Proposed Solution
14+
15+
Describe the feature or security check you'd like to see added.
16+
17+
## Detection Logic
18+
19+
If proposing a new security check, describe how it should detect the issue:
20+
21+
```bash
22+
# Pseudo-code or example logic
23+
if [[ some_condition ]]; then
24+
log_fail "Check Name" "Issue detected" risk_score
25+
fi
26+
```
27+
28+
## Prevention/Remediation
29+
30+
What fix should be suggested when the issue is detected?
31+
32+
## References
33+
34+
- Link to relevant security research
35+
- CVE numbers if applicable
36+
- Related issues or PRs
37+
38+
## Additional Context
39+
40+
Any other context, screenshots, or examples.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Description
2+
3+
Brief description of the changes in this PR.
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix (non-breaking change that fixes an issue)
8+
- [ ] New feature (non-breaking change that adds functionality)
9+
- [ ] New security check
10+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
11+
- [ ] Documentation update
12+
- [ ] Test improvement
13+
14+
## Related Issues
15+
16+
Fixes #(issue number)
17+
18+
## Checklist
19+
20+
- [ ] I have read the [CONTRIBUTING](CONTRIBUTING.md) guide
21+
- [ ] My code follows the project's style guidelines
22+
- [ ] I have added tests that prove my fix/feature works
23+
- [ ] All new and existing tests pass (`make test`)
24+
- [ ] I have updated documentation as needed
25+
- [ ] ShellCheck passes on my changes
26+
27+
## Testing
28+
29+
Describe how you tested these changes:
30+
31+
```bash
32+
# Commands run to- [ ] I have run `./openclaw-security-audit.sh --json` and verified the output format logicable, add screenshots or command output showing the changes.
33+
```
34+
35+
## Screenshots/Output
36+
37+
If applicable, add screenshots or command output showing the changes.

.github/workflows/test.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
test:
11+
name: Run Tests
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
24+
- name: Install dependencies (Ubuntu)
25+
if: runner.os == 'Linux'
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y jq
29+
30+
- name: Install dependencies (macOS)
31+
if: runner.os == 'macOS'
32+
run: |
33+
brew install jq || true
34+
35+
- name: Make scripts executable
36+
run: |
37+
chmod +x openclaw-security-audit.sh
38+
chmod +x test/bats/bin/bats
39+
chmod +x test/bats/libexec/bats-core/*
40+
find test -name "*.bash" -exec chmod +x {} \;
41+
find test -name "*.sh" -exec chmod +x {} \;
42+
43+
- name: Run unit tests
44+
run: make test-unit
45+
46+
- name: Run integration tests
47+
run: make test-integration
48+
49+
- name: Run output tests
50+
run: make test-output
51+
52+
shellcheck:
53+
name: ShellCheck
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Install ShellCheck
61+
run: sudo apt-get install -y shellcheck
62+
63+
- name: Run ShellCheck on main script
64+
run: shellcheck --severity=warning openclaw-security-audit.sh
65+
66+
- name: Run ShellCheck on test helper
67+
run: shellcheck --severity=warning test/test_helper/common-setup.bash || true
68+
69+
audit-self-test:
70+
name: Self Audit Test
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@v4
76+
77+
- name: Install jq
78+
run: sudo apt-get install -y jq
79+
80+
- name: Run security audit (JSON mode)
81+
run: |
82+
chmod +x openclaw-security-audit.sh
83+
# Script may exit 1 (failures) or 2 (warnings) - that's expected on CI
84+
./openclaw-security-audit.sh --json > audit-results.json || true
85+
echo "=== Audit Results ==="
86+
cat audit-results.json
87+
88+
- name: Validate JSON output
89+
run: |
90+
if ! jq . audit-results.json > /dev/null 2>&1; then
91+
echo "ERROR: Invalid JSON output"
92+
cat audit-results.json
93+
exit 1
94+
fi
95+
echo "JSON output is valid"
96+
97+
- name: Check for required fields
98+
run: |
99+
echo "Checking required fields..."
100+
jq -e '.version' audit-results.json > /dev/null && echo " - version: OK"
101+
jq -e '.timestamp' audit-results.json > /dev/null && echo " - timestamp: OK"
102+
jq -e '.summary.pass >= 0' audit-results.json > /dev/null && echo " - summary.pass: OK"
103+
jq -e '.summary.fail >= 0' audit-results.json > /dev/null && echo " - summary.fail: OK"
104+
jq -e '.summary.warn >= 0' audit-results.json > /dev/null && echo " - summary.warn: OK"
105+
jq -e '.summary.skip >= 0' audit-results.json > /dev/null && echo " - summary.skip: OK"
106+
jq -e '.summary.risk_score >= 0' audit-results.json > /dev/null && echo " - summary.risk_score: OK"
107+
echo "All required fields present"
108+
109+
- name: Display summary
110+
run: |
111+
echo "=== Summary ==="
112+
jq '.summary' audit-results.json

.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Test artifacts
2+
/tmp/bats-*
3+
test/.bats-*
4+
*.bats.swp
5+
audit-results.json
6+
7+
# Editor files
8+
*.swp
9+
*.swo
10+
*~
11+
.*.swp
12+
13+
# macOS
14+
.DS_Store
15+
.AppleDouble
16+
.LSOverride
17+
._*
18+
19+
# IDE
20+
.idea/
21+
.vscode/
22+
*.sublime-*
23+
*.code-workspace
24+
25+
# Temporary files
26+
*.tmp
27+
*.temp
28+
*.log
29+
*.bak
30+
31+
# Coverage reports
32+
coverage/
33+
.coverage
34+
*.gcov
35+
*.gcda
36+
*.gcno
37+
38+
# Build artifacts
39+
dist/
40+
build/
41+
42+
# Local configuration
43+
.env
44+
.env.local
45+
*.local

0 commit comments

Comments
 (0)