Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
68 changes: 68 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Bug Report
about: Report a bug or unexpected behavior
title: '[BUG] '
labels: bug
assignees: ''
---

## Bug Description

A clear and concise description of what the bug is.

## Steps to Reproduce

1. Create a template with '...'
2. Run command '....'
3. See error

## Expected Behavior

A clear and concise description of what you expected to happen.

## Actual Behavior

A clear and concise description of what actually happened.

## Minimal Reproducible Example

**Template** (`example.tmpl`):
```
# Paste your template here
```

**Command:**
```bash
# Paste the exact command you ran
tmpltool example.tmpl
```

**Environment Variables (if applicable):**
```bash
# List any environment variables you set
export VAR_NAME="value"
```

**Output/Error:**
```
# Paste the actual output or error message
```

## Environment

- **tmpltool version:** [e.g., 1.2.0] (run `tmpltool --version`)
- **OS:** [e.g., Ubuntu 22.04, macOS 14.0, Windows 11]
- **Installation method:** [e.g., GitHub releases, Docker, built from source]
- **Docker version (if applicable):** [e.g., 24.0.5]

## Additional Context

Add any other context about the problem here. For example:
- Does it work with `--trust` flag?
- Does it happen only with specific file types?
- Screenshots, if applicable
- Related issues or discussions

## Possible Solution (Optional)

If you have an idea of how to fix this, please describe it here.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Question or Discussion
url: https://github.com/bordeux/tmpltool/discussions
about: Ask questions or discuss ideas in GitHub Discussions
- name: Tera Template Engine Docs
url: https://keats.github.io/tera/docs/
about: Official Tera template engine documentation
57 changes: 57 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Documentation Issue
about: Report missing, unclear, or incorrect documentation
title: '[DOCS] '
labels: documentation
assignees: ''
---

## Documentation Issue

**What part of the documentation is affected?**
- [ ] README.md
- [ ] Function reference
- [ ] Examples
- [ ] Code comments
- [ ] Contributing guide
- [ ] Other: _____________

**Link or section:**
Provide a link or describe which section of the documentation is affected.

## Problem

Describe what's missing, unclear, or incorrect in the documentation.

**Current documentation:**
```
# Quote or describe the current documentation
```

**What's wrong with it:**
- [ ] Missing information
- [ ] Incorrect information
- [ ] Unclear/confusing
- [ ] Out of date
- [ ] Broken link
- [ ] Typo/grammar
- [ ] Other: _____________

## Suggested Improvement

**What should be added/changed:**
```
# Describe or provide the corrected documentation
```

**Why this is important:**
Explain why this documentation improvement matters (e.g., helps new users, clarifies confusion, etc.)

## Additional Context

Add any other context, screenshots, or examples here.

## Willingness to Contribute

- [ ] I'm willing to submit a PR to fix this documentation
- [ ] I'm just reporting the issue
74 changes: 74 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
name: Feature Request
about: Suggest a new feature or enhancement
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

## Feature Description

A clear and concise description of the feature you'd like to see.

## Problem or Use Case

**Is your feature request related to a problem?**
Describe the problem or limitation you're facing. For example:
- "I'm always frustrated when..."
- "It's difficult to..."
- "I need to manually..."

**What are you trying to accomplish?**
Describe your use case and why this feature would be valuable.

## Proposed Solution

Describe the solution you'd like. How should this feature work?

**Example usage:**
```bash
# Show how you'd like to use this feature
tmpltool --new-flag template.tmpl
```

**Example template:**
```
{# Show template syntax if applicable #}
{{ new_function(arg="value") }}
```

**Expected output:**
```
# What output do you expect?
```

## Alternatives Considered

Describe any alternative solutions or features you've considered.

## Additional Context

Add any other context, screenshots, or examples about the feature request here.

**Related to:**
- [ ] New custom function
- [ ] New command-line option
- [ ] Improvement to existing feature
- [ ] Documentation enhancement
- [ ] Performance improvement
- [ ] Other (please describe)

## Priority

How important is this feature to you?
- [ ] Critical - Blocking my workflow
- [ ] High - Would significantly improve my workflow
- [ ] Medium - Nice to have
- [ ] Low - Small improvement

## Willingness to Contribute

- [ ] I'm willing to submit a PR for this feature
- [ ] I can help with testing
- [ ] I can help with documentation
- [ ] I'm just suggesting the idea
169 changes: 169 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Security Policy

## Supported Versions

We release security updates for the following versions:

| Version | Supported |
| ------- | ------------------ |
| 1.2.x | :white_check_mark: |
| 1.1.x | :white_check_mark: |
| 1.0.x | :x: |
| < 1.0 | :x: |

## Reporting a Vulnerability

**Please do not report security vulnerabilities through public GitHub issues.**

If you discover a security vulnerability in tmpltool, please report it by emailing the maintainers. You can find the contact information in the repository.

### What to Include

Please include the following information in your report:

- **Description** of the vulnerability
- **Steps to reproduce** the issue
- **Potential impact** of the vulnerability
- **Suggested fix** (if you have one)
- **Your contact information** for follow-up

### Response Timeline

- **Initial Response:** We aim to respond to security reports within 48 hours
- **Confirmation:** We will confirm the vulnerability within 5 business days
- **Fix Timeline:** We will work on a fix and aim to release a patch within 14 days for critical vulnerabilities
- **Disclosure:** We will coordinate with you on the disclosure timeline

## Security Best Practices for tmpltool

When using tmpltool, please follow these security best practices:

### 1. Trust Mode (`--trust`)

**⚠️ WARNING:** Only use `--trust` mode with templates you completely trust.

```bash
# ✗ DANGEROUS - Don't use --trust with untrusted templates
tmpltool --trust untrusted_template.tmpl

# ✓ SAFE - Use without --trust for untrusted templates
tmpltool untrusted_template.tmpl
```

**Why?** Trust mode disables security restrictions:
- Can read any file on the system (e.g., `/etc/passwd`, SSH keys)
- Can access parent directories (`../`)
- Can read sensitive configuration files

**Only use `--trust` when:**
- You wrote the template yourself
- You've reviewed and audited the template
- You trust the template source completely
- You need to access system files intentionally

### 2. Template Security

**Avoid processing untrusted templates without review:**

```bash
# ✗ DANGEROUS - Don't process templates from untrusted sources
curl https://untrusted-site.com/template.tmpl | tmpltool

# ✓ SAFE - Review templates before using them
curl https://trusted-site.com/template.tmpl -o template.tmpl
# Review the template
cat template.tmpl
# Then use it
tmpltool template.tmpl
```

**What to check in templates:**
- File system access attempts
- Unexpected environment variable usage
- Suspicious patterns or obfuscation

### 3. Environment Variables

**Be careful with sensitive environment variables:**

```bash
# ✗ DANGEROUS - Don't expose secrets in environment
export DATABASE_PASSWORD="secret123"
tmpltool template.tmpl # Template could leak this

# ✓ BETTER - Use secure secret management
# Load secrets only when needed and clear them after use
```

**Best practices:**
- Don't put secrets in environment variables if possible
- Use dedicated secret management tools
- Clear sensitive env vars after use
- Review templates for `filter_env(pattern="*")` which could expose all env vars

### 4. Filesystem Access

**Default security (without `--trust`):**
- ✓ Only relative paths allowed
- ✓ No access to parent directories (`..`)
- ✓ No absolute paths (`/etc/passwd`)
- ✓ Restricted to current working directory

**With `--trust` mode:**
- ⚠️ Full filesystem access
- ⚠️ Can read any file the user can access
- ⚠️ No restrictions

### 5. Docker Security

When using Docker:

```bash
# ✓ SAFE - Mount only necessary directories
docker run --rm -v $(pwd):/workspace -w /workspace tmpltool template.tmpl

# ✗ DANGEROUS - Don't mount entire filesystem
docker run --rm -v /:/host tmpltool template.tmpl
```

## Known Security Considerations

### 1. Template Injection

tmpltool uses the Tera template engine. While Tera is designed to be safe, be aware that:
- Templates have access to environment variables via `get_env()`
- Templates can read files via filesystem functions
- Trust mode disables all security restrictions

### 2. Filesystem Access

Filesystem functions enforce security by default:
- `read_file()` - Restricted to relative paths
- `file_exists()` - Restricted to relative paths
- `list_dir()` - Restricted to relative paths
- `glob()` - Restricted to current directory

Use `--trust` only when necessary and with caution.

### 3. Environment Variable Exposure

Functions like `filter_env(pattern="*")` can expose all environment variables. Review templates carefully to ensure they don't leak sensitive information.

## Security Updates

Security updates will be:
1. Developed privately
2. Tested thoroughly
3. Released as patch versions (e.g., 1.2.1)
4. Announced in release notes with `[SECURITY]` tag
5. Added to this SECURITY.md file

## Security Hall of Fame

We'd like to thank the following people for responsibly disclosing security issues:

<!-- Names will be added here as vulnerabilities are reported and fixed -->

---

**Remember:** Security is everyone's responsibility. If you see something, say something!
Loading