Features: - 30+ Custom Skills (cognitive, development, UI/UX, autonomous agents) - RalphLoop autonomous agent integration - Multi-AI consultation (Qwen) - Agent management system with sync capabilities - Custom hooks for session management - MCP servers integration - Plugin marketplace setup - Comprehensive installation script Components: - Skills: always-use-superpowers, ralph, brainstorming, ui-ux-pro-max, etc. - Agents: 100+ agents across engineering, marketing, product, etc. - Hooks: session-start-superpowers, qwen-consult, ralph-auto-trigger - Commands: /brainstorm, /write-plan, /execute-plan - MCP Servers: zai-mcp-server, web-search-prime, web-reader, zread - Binaries: ralphloop wrapper Installation: ./supercharge.sh
106 lines
3.0 KiB
TypeScript
106 lines
3.0 KiB
TypeScript
import { describe, test } from 'bun:test';
|
|
import { assertAllowed, assertBlocked } from './helpers.ts';
|
|
|
|
describe('find -delete tests', () => {
|
|
test('find delete blocked', () => {
|
|
assertBlocked('find . -name "*.pyc" -delete', 'find -delete');
|
|
});
|
|
|
|
test('find name argument delete allowed', () => {
|
|
assertAllowed('find . -name -delete -print');
|
|
});
|
|
|
|
test('find exec echo delete allowed', () => {
|
|
assertAllowed('find . -exec echo -delete \\; -print');
|
|
});
|
|
|
|
test('find exec plus terminator mentions delete allowed', () => {
|
|
assertAllowed('find . -exec echo -delete + -print');
|
|
});
|
|
|
|
test('busybox find delete blocked', () => {
|
|
assertBlocked('busybox find . -name "*.pyc" -delete', 'find -delete');
|
|
});
|
|
|
|
test('find print allowed', () => {
|
|
assertAllowed('find . -name "*.pyc" -print');
|
|
});
|
|
|
|
test('echo mentions find delete allowed', () => {
|
|
assertAllowed('echo "find . -name *.pyc -delete"');
|
|
});
|
|
|
|
test('rg mentions find delete allowed', () => {
|
|
assertAllowed('rg "find .* -delete" file.txt');
|
|
});
|
|
|
|
test('python c system find delete blocked', () => {
|
|
assertBlocked(
|
|
'python -c "import os; os.system(\\"find . -delete\\")"',
|
|
'dangerous command in interpreter',
|
|
);
|
|
});
|
|
});
|
|
|
|
describe('find -exec rm tests', () => {
|
|
test('find exec rm rf blocked', () => {
|
|
assertBlocked('find . -exec rm -rf {} \\;', 'rm -rf');
|
|
});
|
|
|
|
test('find execdir rm rf blocked', () => {
|
|
assertBlocked('find /tmp -execdir rm -rf {} +', 'rm -rf');
|
|
});
|
|
|
|
test('find exec rm r force blocked', () => {
|
|
assertBlocked("find . -name '*.tmp' -exec rm -r --force {} \\;", 'rm -rf');
|
|
});
|
|
|
|
test('find exec rm recursive blocked', () => {
|
|
assertBlocked('find . -exec rm --recursive -f {} \\;', 'rm -rf');
|
|
});
|
|
|
|
test('find exec rm no force allowed', () => {
|
|
assertAllowed('find . -exec rm -r {} \\;');
|
|
});
|
|
|
|
test('find exec rm no recursive allowed', () => {
|
|
assertAllowed('find . -exec rm -f {} \\;');
|
|
});
|
|
|
|
test('find exec echo allowed', () => {
|
|
assertAllowed('find . -exec echo {} \\;');
|
|
});
|
|
|
|
test('find exec cat allowed', () => {
|
|
assertAllowed('find . -type f -exec cat {} +');
|
|
});
|
|
|
|
test('busybox find exec rm rf blocked', () => {
|
|
assertBlocked('busybox find . -exec rm -rf {} \\;', 'rm -rf');
|
|
});
|
|
|
|
test('find exec rm rf in bash c blocked', () => {
|
|
assertBlocked("bash -c 'find . -exec rm -rf {} \\;'", 'rm -rf');
|
|
});
|
|
|
|
test('find exec env rm rf blocked', () => {
|
|
assertBlocked('find . -exec env rm -rf {} ;', 'rm -rf');
|
|
});
|
|
|
|
test('find exec sudo rm rf blocked', () => {
|
|
assertBlocked('find . -exec sudo rm -rf {} ;', 'rm -rf');
|
|
});
|
|
|
|
test('find exec command rm rf blocked', () => {
|
|
assertBlocked('find . -exec command rm -rf {} ;', 'rm -rf');
|
|
});
|
|
|
|
test('find exec busybox rm rf blocked', () => {
|
|
assertBlocked('find . -exec busybox rm -rf {} ;', 'rm -rf');
|
|
});
|
|
|
|
test('find execdir env rm rf blocked', () => {
|
|
assertBlocked('find /tmp -execdir env rm -rf {} +', 'rm -rf');
|
|
});
|
|
});
|