chore: fleet audit — security, governance, and quality fixes (#1)
* fix: Dockerfile CMD path and chown for Docker proxy support * chore: remove legacy codeql.yml (ADR-011 GHAS migration) * chore: remove legacy gitleaks.yml (ADR-011 GHAS migration) * docs: add TOOLS.md with tool documentation
This commit is contained in:
42
.github/workflows/codeql.yml
vendored
42
.github/workflows/codeql.yml
vendored
@@ -1,42 +0,0 @@
|
||||
name: "CodeQL Security Analysis"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
schedule:
|
||||
# Run weekly on Monday at 6 AM UTC
|
||||
- cron: '0 6 * * 1'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze Code
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: ['javascript']
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
queries: security-extended # More thorough than default
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
30
.github/workflows/gitleaks.yml
vendored
30
.github/workflows/gitleaks.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Secret Scanning (Gitleaks)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['**']
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
name: Scan for secrets
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Full history for accurate scanning
|
||||
|
||||
- name: Install Gitleaks
|
||||
run: |
|
||||
curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.30.0/gitleaks_8.30.0_linux_x64.tar.gz | tar -xz
|
||||
sudo mv gitleaks /usr/local/bin/
|
||||
|
||||
- name: Run Gitleaks
|
||||
run: gitleaks detect --source . --verbose
|
||||
@@ -19,8 +19,9 @@ COPY --from=builder /app/dist ./dist
|
||||
COPY data/database.db ./data/database.db
|
||||
|
||||
# Security: non-root user
|
||||
RUN addgroup -S nodejs && adduser -S nodejs -G nodejs
|
||||
RUN addgroup -S nodejs && adduser -S nodejs -G nodejs \
|
||||
&& chown -R nodejs:nodejs /app/data
|
||||
USER nodejs
|
||||
|
||||
ENV NODE_ENV=production
|
||||
CMD ["node", "dist/src/http-server.js"]
|
||||
CMD ["node", "dist/http-server.js"]
|
||||
|
||||
109
TOOLS.md
Normal file
109
TOOLS.md
Normal file
@@ -0,0 +1,109 @@
|
||||
# Tools — Israel Law MCP
|
||||
|
||||
8 tools for searching and retrieving Israel legislation.
|
||||
|
||||
---
|
||||
|
||||
## 1. search_legislation
|
||||
|
||||
Full-text search across all Israel statutes and regulations.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
|------|------|----------|-------------|
|
||||
| `query` | string | Yes | Search query |
|
||||
| `limit` | number | No | Max results (default 10, max 50) |
|
||||
| `status` | string | No | Filter: `in_force`, `amended`, `repealed` |
|
||||
|
||||
**Returns:** Matching provisions with document context, snippets, and relevance scores.
|
||||
|
||||
---
|
||||
|
||||
## 2. get_provision
|
||||
|
||||
Retrieve the full text of a specific provision from a statute.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
|------|------|----------|-------------|
|
||||
| `document_id` | string | Yes | Statute identifier or title |
|
||||
| `section` | string | No | Section/article number |
|
||||
|
||||
**Returns:** Full provision text with document metadata.
|
||||
|
||||
---
|
||||
|
||||
## 3. list_sources
|
||||
|
||||
List all data sources with provenance metadata and database statistics.
|
||||
|
||||
**Returns:** Source authority, coverage scope, document/provision counts, and build date.
|
||||
|
||||
---
|
||||
|
||||
## 4. validate_citation
|
||||
|
||||
Validate a legal citation against the database (zero-hallucination check).
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
|------|------|----------|-------------|
|
||||
| `citation` | string | Yes | Citation string to validate |
|
||||
|
||||
**Returns:** Whether the cited document and provision exist, with warnings.
|
||||
|
||||
---
|
||||
|
||||
## 5. build_legal_stance
|
||||
|
||||
Build a comprehensive set of citations for a legal question.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
|------|------|----------|-------------|
|
||||
| `query` | string | Yes | Legal question or topic |
|
||||
| `limit` | number | No | Max results per category (default 5) |
|
||||
|
||||
**Returns:** Aggregated relevant provisions from multiple statutes.
|
||||
|
||||
---
|
||||
|
||||
## 6. format_citation
|
||||
|
||||
Format a legal citation per standard conventions.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
|------|------|----------|-------------|
|
||||
| `citation` | string | Yes | Citation to format |
|
||||
| `format` | string | No | `full`, `short`, or `pinpoint` |
|
||||
|
||||
**Returns:** Formatted citation string.
|
||||
|
||||
---
|
||||
|
||||
## 7. check_currency
|
||||
|
||||
Check whether a statute or provision is currently in force.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
|------|------|----------|-------------|
|
||||
| `document_id` | string | Yes | Statute identifier or title |
|
||||
| `provision_ref` | string | No | Optional provision reference |
|
||||
|
||||
**Returns:** Status (in_force/amended/repealed), dates, and warnings.
|
||||
|
||||
---
|
||||
|
||||
## 8. about
|
||||
|
||||
Server metadata, dataset statistics, and data freshness.
|
||||
|
||||
**Returns:** Document/provision counts, build date, source authority, and database version.
|
||||
Reference in New Issue
Block a user