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
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ The firewall implements comprehensive logging at two levels:

- `src/squid-config.ts` - Generates Squid config with custom `firewall_detailed` logformat
- `containers/agent/setup-iptables.sh` - Configures iptables LOG rules for rejected traffic
- `src/squid-config.test.ts` - Tests for logging configuration
- `src/squid-config-features.test.ts` - Tests for logging configuration

### Squid Log Format

Expand Down Expand Up @@ -293,7 +293,7 @@ Both use `--log-uid` flag to capture process UID.

Run tests:
```bash
npm test -- squid-config.test.ts
npm test -- squid-config-features.test.ts
```

Manual testing:
Expand Down
4 changes: 2 additions & 2 deletions src/domain-patterns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
parseDomainList,
isDomainMatchedByPattern,
parseDomainWithProtocol,
DOMAIN_CHAR_PATTERN,
} from './domain-patterns';

describe('parseDomainWithProtocol', () => {
Expand Down Expand Up @@ -94,8 +95,7 @@ describe('isWildcardPattern', () => {
});
});

// Pattern constant for the safer domain character class (matches the implementation)
const DOMAIN_CHAR_PATTERN = '[a-zA-Z0-9.-]*';
// Pattern constant imported from domain-patterns.ts (shared source of truth)

describe('wildcardToRegex', () => {
describe('basic conversions', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/domain-patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function isWildcardPattern(domain: string): boolean {
* Uses character class instead of .* to prevent catastrophic backtracking (ReDoS).
* Per RFC 1035, valid domain characters are: letters, digits, hyphens, and dots.
*/
const DOMAIN_CHAR_PATTERN = '[a-zA-Z0-9.-]*';
export const DOMAIN_CHAR_PATTERN = '[a-zA-Z0-9.-]*';

/**
* Convert a wildcard pattern to a Squid-compatible regex pattern
Expand Down
Loading
Loading