4 Commits

Author SHA1 Message Date
ethan zhou
de1caabee7 Merge remote-tracking branch 'revyl/feat/config-file' into integration/merge-all
# Conflicts:
#	README.md
#	go.mod
#	go.sum
2026-06-26 18:34:21 -07:00
ethan zhou
766cae07a8 Add .greenlight.yml config for the code scan
Lets teams tune the scanner project-wide (complementing the per-line
`// greenlight:ignore` directive): disable a rule, override its severity, or
ignore paths.

```yaml
rules:
  hardcoded-ipv4: { severity: info }
  platform-reference: { enabled: false }
ignore: [vendor, "*.generated.ts", src/legacy]
```

- New internal/codescan/config.go: loads .greenlight.yml/.greenlight.yaml from
  the project root and applies rule enable/disable, PatternRule severity
  overrides, and path-ignore globs (bare dir names, basename globs, path
  prefixes).
- Strict validation: unknown rule ids, invalid severities, severity overrides on
  rule types that can't honor them, and typo'd YAML fields (KnownFields) all
  error clearly instead of being silently ignored.
- Scanner gains NewScannerWithConfig; codescan + preflight auto-discover the
  file, and `codescan --config <path>` points at an explicit one.
- Applies to the code scan (the rule engine); documented as such.
- Tests for load/validate, apply (disable + override), and the ignore matcher.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 16:30:28 -07:00
ethan zhou
f112d33570 Parse IPA plists for real (binary + XML) instead of string-matching
Tier 2 feature. The IPA inspector read Info.plist / PrivacyInfo.xcprivacy as a
string and grepped for keys. Production builds ship BINARY plists (bplist00), so
the empty-purpose-string and ATS checks were dead, the bundle id was never
extracted, and version/icon checks false-fired on essentially every real IPA.

- Parse both plists with howett.net/plist (auto-detects binary vs XML) into a
  map; read CFBundleIdentifier, version keys, NSAppTransportSecurity, and the
  usage-description strings from actual values.
- Read zip entries with io.ReadAll under a 16 MiB cap instead of a single
  rc.Read into a header-sized buffer (the old read truncated Deflate'd entries
  and trusted UncompressedSize64 -- a decompression-bomb vector).
- Treat a compiled Assets.car as a valid icon source, so apps whose icons live
  in the asset catalog no longer get a false "No app icon" CRITICAL.
- Only warn about CFBundleDisplayName when CFBundleName is also absent; simplify
  the framework privacy-manifest path; drop dead arch-detection code.
- Tests build in-memory IPAs with binary and XML plist fixtures.

Adds howett.net/plist v1.0.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:18:27 -07:00
Landseer100
fc68ef1ce3 Initial release: standalone greenlight CLI
Pre-submission compliance scanner for the Apple App Store.

Fixes:
- Implement antiPatternsGlobal two-pass scanning (rules like missing-att,
  social-login-no-apple now correctly check anti-patterns across all project
  files instead of only the current file)
- Remove dead printFooter() in scan.go (handled by report.go)
- Remove no-op checkAppIconExists() (icon checks handled by app.json parser)
- Fix all go vet warnings (redundant newlines in Println calls)

Adds MIT license, CI workflow, and updated .gitignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 14:54:57 -08:00