Skip to content

Commit ca8052a

Browse files
Add comprehensive security configuration
- Add SECURITY.md with vulnerability reporting policy - Add CONTRIBUTING.md with contribution guidelines - Add CODE_OF_CONDUCT.md with community standards - Add GitHub issue and PR templates - Add CODEOWNERS for automatic review assignments - Add dependabot.yml for automated dependency updates - Enhance CI workflow with security audits and proper permissions - Add safety and pip-audit for vulnerability scanning - Remove '|| true' from lint checks to enforce code quality
1 parent b0b608b commit ca8052a

File tree

10 files changed

+573
-4
lines changed

10 files changed

+573
-4
lines changed

.github/CODEOWNERS

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Global owners
2+
* @VirtualAgentics
3+
4+
# Core application code
5+
/src/ @VirtualAgentics
6+
/src/contextforge_memory/ @VirtualAgentics
7+
8+
# API specification
9+
/openapi/ @VirtualAgentics
10+
11+
# Documentation
12+
/docs/ @VirtualAgentics
13+
README.md @VirtualAgentics
14+
CONTRIBUTING.md @VirtualAgentics
15+
SECURITY.md @VirtualAgentics
16+
CODE_OF_CONDUCT.md @VirtualAgentics
17+
18+
# Client libraries
19+
/clients/ @VirtualAgentics
20+
21+
# CI/CD and GitHub workflows
22+
/.github/ @VirtualAgentics
23+
24+
# Dependencies and requirements
25+
requirements.txt @VirtualAgentics
26+
pyproject.toml @VirtualAgentics
27+
28+
# Configuration files
29+
Makefile @VirtualAgentics
30+
.gitignore @VirtualAgentics
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: ['bug', 'needs-triage']
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Description
11+
<!-- A clear and concise description of what the bug is -->
12+
13+
## To Reproduce
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
## Expected Behavior
21+
<!-- A clear and concise description of what you expected to happen -->
22+
23+
## Actual Behavior
24+
<!-- A clear and concise description of what actually happened -->
25+
26+
## Environment
27+
<!-- Please complete the following information -->
28+
- OS: [e.g. Ubuntu 20.04, Windows 10, macOS 12.0]
29+
- Python version: [e.g. 3.11.0]
30+
- ContextForge Memory version: [e.g. 0.1.0]
31+
- Installation method: [e.g. pip, from source]
32+
33+
## Configuration
34+
<!-- If applicable, add your configuration details -->
35+
```yaml
36+
# Add any relevant configuration here
37+
```
38+
39+
## Error Messages
40+
<!-- If applicable, add any error messages or stack traces -->
41+
```
42+
Paste error messages here
43+
```
44+
45+
## Additional Context
46+
<!-- Add any other context about the problem here -->
47+
48+
## Possible Solution
49+
<!-- If you have ideas on how to fix the bug, please describe them here -->
50+
51+
## Checklist
52+
- [ ] I have searched existing issues to ensure this is not a duplicate
53+
- [ ] I have provided all the requested information
54+
- [ ] I have tested this on the latest version
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: ['enhancement', 'needs-triage']
6+
assignees: ''
7+
8+
---
9+
10+
## Feature Description
11+
<!-- A clear and concise description of the feature you'd like to see -->
12+
13+
## Problem Statement
14+
<!-- Is your feature request related to a problem? Please describe -->
15+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
16+
17+
## Proposed Solution
18+
<!-- A clear and concise description of what you want to happen -->
19+
20+
## Alternative Solutions
21+
<!-- A clear and concise description of any alternative solutions or features you've considered -->
22+
23+
## Use Case
24+
<!-- Describe the specific use case for this feature -->
25+
<!-- Who would use this feature? What problem would it solve? -->
26+
27+
## API Design (if applicable)
28+
<!-- If this involves API changes, describe the proposed API design -->
29+
```python
30+
# Example of how the new API might look
31+
client.new_feature(param1="value", param2=123)
32+
```
33+
34+
## Implementation Considerations
35+
<!-- Any thoughts on how this might be implemented -->
36+
- [ ] Backward compatibility considerations
37+
- [ ] Performance implications
38+
- [ ] Security considerations
39+
- [ ] Documentation requirements
40+
41+
## Additional Context
42+
<!-- Add any other context or screenshots about the feature request here -->
43+
44+
## Priority
45+
<!-- How important is this feature to you? -->
46+
- [ ] Critical - blocking current work
47+
- [ ] High - would significantly improve workflow
48+
- [ ] Medium - nice to have
49+
- [ ] Low - minor improvement
50+
51+
## Checklist
52+
- [ ] I have searched existing issues to ensure this is not a duplicate
53+
- [ ] I have provided all the requested information
54+
- [ ] I have considered the impact on existing functionality

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## Description
2+
<!-- Provide a brief description of the changes in this PR -->
3+
4+
## Type of Change
5+
<!-- Mark the relevant option with an "x" -->
6+
- [ ] Bug fix (non-breaking change which fixes an issue)
7+
- [ ] New feature (non-breaking change which adds functionality)
8+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
9+
- [ ] Documentation update
10+
- [ ] Performance improvement
11+
- [ ] Code refactoring
12+
13+
## Related Issues
14+
<!-- Link to any related issues using "Fixes #123" or "Closes #123" -->
15+
<!-- Example: Fixes #123 -->
16+
17+
## Testing
18+
<!-- Describe the tests you ran to verify your changes -->
19+
- [ ] All existing tests pass
20+
- [ ] New tests added for new functionality
21+
- [ ] Manual testing completed
22+
- [ ] Smoke tests pass
23+
24+
### Test Commands
25+
```bash
26+
# Add any specific test commands you ran
27+
python -m pytest
28+
ruff check src
29+
black src
30+
```
31+
32+
## Checklist
33+
<!-- Mark completed items with an "x" -->
34+
- [ ] My code follows the project's style guidelines
35+
- [ ] I have performed a self-review of my own code
36+
- [ ] I have commented my code, particularly in hard-to-understand areas
37+
- [ ] I have made corresponding changes to the documentation
38+
- [ ] My changes generate no new warnings or errors
39+
- [ ] I have added tests that prove my fix is effective or that my feature works
40+
- [ ] New and existing unit tests pass locally with my changes
41+
- [ ] Any dependent changes have been merged and published
42+
43+
## Screenshots (if applicable)
44+
<!-- Add screenshots to help explain your changes -->
45+
46+
## Additional Notes
47+
<!-- Add any additional notes, considerations, or context about the PR -->
48+
49+
## Breaking Changes
50+
<!-- If this is a breaking change, describe what breaks and how to migrate -->
51+
<!-- Example: The `old_function()` has been renamed to `new_function()`. Update your code accordingly. -->
52+
53+
## Performance Impact
54+
<!-- If applicable, describe any performance implications of your changes -->
55+
56+
## Security Considerations
57+
<!-- If applicable, describe any security implications of your changes -->

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for pip
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "09:00"
10+
timezone: "UTC"
11+
open-pull-requests-limit: 10
12+
reviewers:
13+
- "VirtualAgentics"
14+
assignees:
15+
- "VirtualAgentics"
16+
commit-message:
17+
prefix: "deps"
18+
include: "scope"
19+
labels:
20+
- "dependencies"
21+
- "python"
22+
# Allow both direct and indirect dependency updates
23+
allow:
24+
- dependency-type: "direct"
25+
- dependency-type: "indirect"
26+
# Ignore specific dependencies if needed
27+
ignore:
28+
# Add specific packages to ignore here if needed
29+
# - dependency-name: "package-name"

.github/workflows/ci.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
pull_request:
66

7+
# Set minimal permissions for security
8+
permissions:
9+
contents: read
10+
security-events: write
11+
pull-requests: write
12+
713
jobs:
814
test:
915
runs-on: ubuntu-latest
@@ -12,22 +18,48 @@ jobs:
1218
- uses: actions/setup-python@v5
1319
with:
1420
python-version: '3.11'
15-
- name: Install
21+
- name: Install dependencies
1622
run: |
1723
python -m pip install --upgrade pip
1824
pip install -r requirements.txt
25+
pip install safety pip-audit
1926
- name: Lint
2027
run: |
21-
ruff check src || true
22-
- name: Import smoke
28+
ruff check src
29+
black --check src
30+
- name: Security audit
31+
run: |
32+
safety check
33+
pip-audit --desc --format=json --output=audit-results.json
34+
- name: Upload security audit results
35+
if: always()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: security-audit-results
39+
path: audit-results.json
40+
- name: Import smoke test
2341
run: |
2442
python - << 'PY'
2543
import importlib
2644
import sys
2745
sys.path.append('src')
2846
import contextforge_memory
2947
from contextforge_memory.main import app
30-
print('ok')
48+
print('Import smoke test: OK')
49+
PY
50+
- name: Basic functionality test
51+
run: |
52+
python - << 'PY'
53+
import sys
54+
sys.path.append('src')
55+
from contextforge_memory.main import app, _embed_text
56+
57+
# Test embedding function
58+
test_text = "test embedding"
59+
embedding = _embed_text(test_text)
60+
assert len(embedding) == 32, f"Expected 32 dimensions, got {len(embedding)}"
61+
assert all(0 <= x <= 1 for x in embedding), "Embeddings should be normalized to [0,1]"
62+
print('Basic functionality test: OK')
3163
PY
3264
3365

CODE_OF_CONDUCT.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
* Using welcoming and inclusive language
14+
* Being respectful of differing viewpoints and experiences
15+
* Gracefully accepting constructive criticism
16+
* Focusing on what is best for the community
17+
* Showing empathy towards other community members
18+
19+
Examples of unacceptable behavior include:
20+
21+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
* Trolling, insulting or derogatory comments, and personal or political attacks
23+
* Public or private harassment
24+
* Publishing others' private information, such as a physical or email address, without their explicit permission
25+
* Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36+
37+
## Enforcement
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [[email protected]](mailto:[email protected]). All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
49+
50+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
51+
52+
### 2. Warning
53+
**Community Impact**: A violation through a single incident or series of actions.
54+
55+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
56+
57+
### 3. Temporary Ban
58+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
59+
60+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
61+
62+
### 4. Permanent Ban
63+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
64+
65+
**Consequence**: A permanent ban from any sort of public interaction within the community.
66+
67+
## Attribution
68+
69+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
70+
71+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
72+
73+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
74+
75+
[homepage]: https://www.contributor-covenant.org
76+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
77+
[Mozilla CoC]: https://github.com/mozilla/diversity
78+
[FAQ]: https://www.contributor-covenant.org/faq
79+
[translations]: https://www.contributor-covenant.org/translations

0 commit comments

Comments
 (0)