buildanything 1.8.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +9 -3
- package/CHANGELOG.md +57 -0
- package/README.md +2 -2
- package/agents/a11y-architect.md +166 -0
- package/agents/business-model.md +80 -29
- package/agents/code-architect.md +75 -0
- package/agents/code-reviewer.md +255 -0
- package/agents/code-simplifier.md +64 -0
- package/agents/design-brand-guardian.md +293 -53
- package/agents/design-critic.md +139 -0
- package/agents/design-inclusive-visuals-specialist.md +6 -19
- package/agents/design-ui-designer.md +335 -56
- package/agents/design-ux-architect.md +403 -55
- package/agents/design-ux-researcher.md +264 -49
- package/agents/engineering-ai-engineer.md +26 -36
- package/agents/engineering-backend-architect.md +185 -36
- package/agents/engineering-data-engineer.md +225 -43
- package/agents/engineering-devops-automator.md +227 -74
- package/agents/engineering-frontend-developer.md +210 -34
- package/agents/engineering-mobile-app-builder.md +6 -1
- package/agents/engineering-rapid-prototyper.md +30 -9
- package/agents/engineering-security-engineer.md +263 -61
- package/agents/engineering-senior-developer.md +128 -19
- package/agents/engineering-sre.md +84 -0
- package/agents/engineering-technical-writer.md +285 -41
- package/agents/feature-intel.md +110 -0
- package/agents/ios-app-review-guardian.md +19 -2
- package/agents/ios-foundation-models-specialist.md +20 -2
- package/agents/ios-storekit-specialist.md +9 -2
- package/agents/ios-swift-architect.md +28 -1
- package/agents/ios-swift-search.md +8 -1
- package/agents/ios-swift-ui-design.md +33 -1
- package/agents/marketing-app-store-optimizer.md +246 -64
- package/agents/planner.md +216 -0
- package/agents/pr-test-analyzer.md +63 -0
- package/agents/product-feedback-synthesizer.md +8 -2
- package/agents/refactor-cleaner.md +102 -0
- package/agents/security-reviewer.md +128 -0
- package/agents/silent-failure-hunter.md +54 -0
- package/agents/swift-build-resolver.md +119 -0
- package/agents/swift-reviewer.md +112 -0
- package/agents/tech-feasibility.md +21 -1
- package/agents/testing-api-tester.md +236 -59
- package/agents/testing-evidence-collector.md +26 -1
- package/agents/testing-performance-benchmarker.md +21 -1
- package/agents/testing-reality-checker.md +6 -1
- package/agents/visual-research.md +116 -0
- package/bin/adapters/cycle-counter-tool.ts +155 -0
- package/bin/adapters/scribe-tool.ts +71 -0
- package/bin/adapters/state-save-tool.ts +130 -0
- package/bin/adapters/write-lease-tool.ts +127 -0
- package/bin/buildanything-runtime.js +15 -0
- package/bin/buildanything-runtime.ts +328 -0
- package/bin/setup.js +83 -8
- package/commands/add-feature.md +2 -0
- package/commands/build.md +782 -266
- package/commands/fix.md +1 -1
- package/commands/self-check.md +121 -0
- package/commands/setup.md +50 -9
- package/commands/ux-review.md +2 -2
- package/commands/verify.md +6 -9
- package/docs/migration/agents.yaml +729 -0
- package/docs/migration/phase-graph.yaml +1088 -0
- package/docs/migration/sdk-host-compat.md +18 -0
- package/hooks/compile-writer-owner-cache.ts +171 -0
- package/hooks/hooks.json +36 -0
- package/hooks/pre-tool-use +19 -0
- package/hooks/pre-tool-use.ts +776 -0
- package/hooks/record-mode-transitions.ts +178 -0
- package/hooks/session-start +71 -1
- package/hooks/subagent-start +17 -0
- package/hooks/subagent-start.ts +471 -0
- package/hooks/subagent-stop +17 -0
- package/hooks/subagent-stop.ts +153 -0
- package/package.json +24 -4
- package/protocols/architecture-schema.md +171 -0
- package/protocols/decision-log.md +131 -0
- package/protocols/ios-context.md +10 -11
- package/protocols/ios-phase-branches.md +208 -33
- package/protocols/launch-readiness.md +258 -0
- package/protocols/metric-loop.md +62 -2
- package/protocols/smoke-test.md +9 -1
- package/protocols/state-schema.json +388 -0
- package/protocols/state-schema.md +172 -0
- package/protocols/verify.md +62 -2
- package/protocols/visual-dna.md +185 -0
- package/protocols/web-phase-branches.md +222 -72
- package/skills/ios/_VENDORED.md +2 -0
- package/skills/ios/app-store-connect-metadata/SKILL.md +148 -0
- package/skills/ios/asc-privacy-manifest/SKILL.md +350 -0
- package/skills/ios/hig-components-content/SKILL.md +86 -0
- package/skills/ios/hig-components-content/references/activity-views.md +79 -0
- package/skills/ios/hig-components-content/references/charts.md +180 -0
- package/skills/ios/hig-components-content/references/collections.md +48 -0
- package/skills/ios/hig-components-content/references/color-wells.md +42 -0
- package/skills/ios/hig-components-content/references/image-views.md +82 -0
- package/skills/ios/hig-components-content/references/image-wells.md +34 -0
- package/skills/ios/hig-components-content/references/lockups.md +78 -0
- package/skills/ios/hig-components-content/references/web-views.md +36 -0
- package/skills/ios/hig-components-controls/SKILL.md +88 -0
- package/skills/ios/hig-components-controls/references/combo-boxes.md +40 -0
- package/skills/ios/hig-components-controls/references/controls.md +112 -0
- package/skills/ios/hig-components-controls/references/gauges.md +74 -0
- package/skills/ios/hig-components-controls/references/labels.md +92 -0
- package/skills/ios/hig-components-controls/references/pickers.md +128 -0
- package/skills/ios/hig-components-controls/references/rating-indicators.md +38 -0
- package/skills/ios/hig-components-controls/references/segmented-controls.md +94 -0
- package/skills/ios/hig-components-controls/references/sliders.md +92 -0
- package/skills/ios/hig-components-controls/references/steppers.md +40 -0
- package/skills/ios/hig-components-controls/references/text-fields.md +88 -0
- package/skills/ios/hig-components-controls/references/text-views.md +56 -0
- package/skills/ios/hig-components-controls/references/toggles.md +127 -0
- package/skills/ios/hig-components-controls/references/token-fields.md +48 -0
- package/skills/ios/hig-components-controls/references/virtual-keyboards.md +156 -0
- package/skills/ios/hig-components-dialogs/SKILL.md +76 -0
- package/skills/ios/hig-components-dialogs/references/action-sheets.md +74 -0
- package/skills/ios/hig-components-dialogs/references/alerts.md +158 -0
- package/skills/ios/hig-components-dialogs/references/digit-entry-views.md +32 -0
- package/skills/ios/hig-components-dialogs/references/popovers.md +81 -0
- package/skills/ios/hig-components-dialogs/references/sheets.md +157 -0
- package/skills/ios/hig-components-layout/SKILL.md +99 -0
- package/skills/ios/hig-components-layout/references/boxes.md +48 -0
- package/skills/ios/hig-components-layout/references/column-views.md +44 -0
- package/skills/ios/hig-components-layout/references/lists-and-tables.md +99 -0
- package/skills/ios/hig-components-layout/references/ornaments.md +56 -0
- package/skills/ios/hig-components-layout/references/outline-views.md +64 -0
- package/skills/ios/hig-components-layout/references/panels.md +75 -0
- package/skills/ios/hig-components-layout/references/scroll-views.md +123 -0
- package/skills/ios/hig-components-layout/references/sidebars.md +109 -0
- package/skills/ios/hig-components-layout/references/split-views.md +110 -0
- package/skills/ios/hig-components-layout/references/tab-bars.md +173 -0
- package/skills/ios/hig-components-layout/references/tab-views.md +68 -0
- package/skills/ios/hig-components-layout/references/windows.md +188 -0
- package/skills/ios/hig-components-menus/SKILL.md +81 -0
- package/skills/ios/hig-components-menus/references/action-button.md +61 -0
- package/skills/ios/hig-components-menus/references/buttons.md +261 -0
- package/skills/ios/hig-components-menus/references/context-menus.md +105 -0
- package/skills/ios/hig-components-menus/references/disclosure-controls.md +84 -0
- package/skills/ios/hig-components-menus/references/dock-menus.md +40 -0
- package/skills/ios/hig-components-menus/references/edit-menus.md +88 -0
- package/skills/ios/hig-components-menus/references/menus.md +171 -0
- package/skills/ios/hig-components-menus/references/pop-up-buttons.md +70 -0
- package/skills/ios/hig-components-menus/references/pull-down-buttons.md +77 -0
- package/skills/ios/hig-components-menus/references/the-menu-bar.md +303 -0
- package/skills/ios/hig-components-menus/references/toolbars.md +256 -0
- package/skills/ios/hig-components-search/SKILL.md +68 -0
- package/skills/ios/hig-components-search/references/page-controls.md +120 -0
- package/skills/ios/hig-components-search/references/path-controls.md +40 -0
- package/skills/ios/hig-components-search/references/search-fields.md +189 -0
- package/skills/ios/hig-components-status/SKILL.md +80 -0
- package/skills/ios/hig-components-status/references/activity-rings.md +105 -0
- package/skills/ios/hig-components-status/references/progress-indicators.md +116 -0
- package/skills/ios/hig-components-status/references/status-bars.md +38 -0
- package/skills/ios/hig-components-system/SKILL.md +88 -0
- package/skills/ios/hig-components-system/references/app-clips.md +387 -0
- package/skills/ios/hig-components-system/references/app-shortcuts.md +114 -0
- package/skills/ios/hig-components-system/references/complications.md +425 -0
- package/skills/ios/hig-components-system/references/home-screen-quick-actions.md +42 -0
- package/skills/ios/hig-components-system/references/live-activities.md +442 -0
- package/skills/ios/hig-components-system/references/notifications.md +153 -0
- package/skills/ios/hig-components-system/references/top-shelf.md +135 -0
- package/skills/ios/hig-components-system/references/watch-faces.md +40 -0
- package/skills/ios/hig-components-system/references/widgets.md +517 -0
- package/skills/ios/hig-foundations/SKILL.md +98 -0
- package/skills/ios/hig-foundations/references/accessibility.md +291 -0
- package/skills/ios/hig-foundations/references/app-icons.md +210 -0
- package/skills/ios/hig-foundations/references/branding.md +44 -0
- package/skills/ios/hig-foundations/references/color.md +274 -0
- package/skills/ios/hig-foundations/references/dark-mode.md +116 -0
- package/skills/ios/hig-foundations/references/icons.md +263 -0
- package/skills/ios/hig-foundations/references/images.md +176 -0
- package/skills/ios/hig-foundations/references/immersive-experiences.md +174 -0
- package/skills/ios/hig-foundations/references/inclusion.md +189 -0
- package/skills/ios/hig-foundations/references/layout.md +425 -0
- package/skills/ios/hig-foundations/references/materials.md +238 -0
- package/skills/ios/hig-foundations/references/motion.md +103 -0
- package/skills/ios/hig-foundations/references/privacy.md +231 -0
- package/skills/ios/hig-foundations/references/right-to-left.md +206 -0
- package/skills/ios/hig-foundations/references/sf-symbols.md +310 -0
- package/skills/ios/hig-foundations/references/spatial-layout.md +142 -0
- package/skills/ios/hig-foundations/references/typography.md +1146 -0
- package/skills/ios/hig-foundations/references/writing.md +91 -0
- package/skills/ios/hig-inputs/SKILL.md +94 -0
- package/skills/ios/hig-inputs/references/apple-pencil-and-scribble.md +148 -0
- package/skills/ios/hig-inputs/references/camera-control.md +107 -0
- package/skills/ios/hig-inputs/references/digital-crown.md +83 -0
- package/skills/ios/hig-inputs/references/eyes.md +120 -0
- package/skills/ios/hig-inputs/references/focus-and-selection.md +120 -0
- package/skills/ios/hig-inputs/references/game-controls.md +156 -0
- package/skills/ios/hig-inputs/references/gestures.md +208 -0
- package/skills/ios/hig-inputs/references/gyro-and-accelerometer.md +40 -0
- package/skills/ios/hig-inputs/references/keyboards.md +234 -0
- package/skills/ios/hig-inputs/references/nearby-interactions.md +70 -0
- package/skills/ios/hig-inputs/references/pointing-devices.md +237 -0
- package/skills/ios/hig-inputs/references/remotes.md +67 -0
- package/skills/ios/hig-inputs/references/spatial-interactions.md +70 -0
- package/skills/ios/hig-patterns/SKILL.md +104 -0
- package/skills/ios/hig-patterns/references/charting-data.md +81 -0
- package/skills/ios/hig-patterns/references/collaboration-and-sharing.md +86 -0
- package/skills/ios/hig-patterns/references/drag-and-drop.md +134 -0
- package/skills/ios/hig-patterns/references/entering-data.md +69 -0
- package/skills/ios/hig-patterns/references/feedback.md +67 -0
- package/skills/ios/hig-patterns/references/file-management.md +135 -0
- package/skills/ios/hig-patterns/references/going-full-screen.md +79 -0
- package/skills/ios/hig-patterns/references/launching.md +81 -0
- package/skills/ios/hig-patterns/references/live-viewing-apps.md +79 -0
- package/skills/ios/hig-patterns/references/loading.md +59 -0
- package/skills/ios/hig-patterns/references/managing-accounts.md +107 -0
- package/skills/ios/hig-patterns/references/managing-notifications.md +99 -0
- package/skills/ios/hig-patterns/references/modality.md +82 -0
- package/skills/ios/hig-patterns/references/multitasking.md +131 -0
- package/skills/ios/hig-patterns/references/offering-help.md +117 -0
- package/skills/ios/hig-patterns/references/onboarding.md +69 -0
- package/skills/ios/hig-patterns/references/playing-audio.md +124 -0
- package/skills/ios/hig-patterns/references/playing-haptics.md +280 -0
- package/skills/ios/hig-patterns/references/playing-video.md +180 -0
- package/skills/ios/hig-patterns/references/printing.md +50 -0
- package/skills/ios/hig-patterns/references/ratings-and-reviews.md +48 -0
- package/skills/ios/hig-patterns/references/searching.md +70 -0
- package/skills/ios/hig-patterns/references/settings.md +84 -0
- package/skills/ios/hig-patterns/references/undo-and-redo.md +58 -0
- package/skills/ios/hig-patterns/references/workouts.md +76 -0
- package/skills/ios/hig-platforms/SKILL.md +84 -0
- package/skills/ios/hig-platforms/references/designing-for-games.md +159 -0
- package/skills/ios/hig-platforms/references/designing-for-ios.md +66 -0
- package/skills/ios/hig-platforms/references/designing-for-ipados.md +64 -0
- package/skills/ios/hig-platforms/references/designing-for-macos.md +70 -0
- package/skills/ios/hig-platforms/references/designing-for-tvos.md +68 -0
- package/skills/ios/hig-platforms/references/designing-for-visionos.md +85 -0
- package/skills/ios/hig-platforms/references/designing-for-watchos.md +74 -0
- package/skills/ios/hig-project-context/SKILL.md +133 -0
- package/skills/ios/hig-technologies/SKILL.md +107 -0
- package/skills/ios/hig-technologies/references/airplay.md +125 -0
- package/skills/ios/hig-technologies/references/always-on.md +62 -0
- package/skills/ios/hig-technologies/references/apple-pay.md +441 -0
- package/skills/ios/hig-technologies/references/augmented-reality.md +247 -0
- package/skills/ios/hig-technologies/references/carekit.md +224 -0
- package/skills/ios/hig-technologies/references/carplay.md +119 -0
- package/skills/ios/hig-technologies/references/game-center.md +343 -0
- package/skills/ios/hig-technologies/references/generative-ai.md +110 -0
- package/skills/ios/hig-technologies/references/healthkit.md +120 -0
- package/skills/ios/hig-technologies/references/homekit.md +343 -0
- package/skills/ios/hig-technologies/references/icloud.md +52 -0
- package/skills/ios/hig-technologies/references/id-verifier.md +73 -0
- package/skills/ios/hig-technologies/references/imessage-apps-and-stickers.md +105 -0
- package/skills/ios/hig-technologies/references/in-app-purchase.md +263 -0
- package/skills/ios/hig-technologies/references/live-photos.md +54 -0
- package/skills/ios/hig-technologies/references/mac-catalyst.md +216 -0
- package/skills/ios/hig-technologies/references/machine-learning.md +394 -0
- package/skills/ios/hig-technologies/references/maps.md +221 -0
- package/skills/ios/hig-technologies/references/nfc.md +51 -0
- package/skills/ios/hig-technologies/references/photo-editing.md +40 -0
- package/skills/ios/hig-technologies/references/researchkit.md +134 -0
- package/skills/ios/hig-technologies/references/shareplay.md +142 -0
- package/skills/ios/hig-technologies/references/shazamkit.md +47 -0
- package/skills/ios/hig-technologies/references/sign-in-with-apple.md +288 -0
- package/skills/ios/hig-technologies/references/siri.md +523 -0
- package/skills/ios/hig-technologies/references/tap-to-pay-on-iphone.md +208 -0
- package/skills/ios/hig-technologies/references/voiceover.md +90 -0
- package/skills/ios/hig-technologies/references/wallet.md +420 -0
- package/skills/ios/ios-bootstrap/SKILL.md +16 -7
- package/skills/ios/swift-actor-persistence/SKILL.md +143 -0
- package/skills/ios/swift-concurrency-6-2/SKILL.md +216 -0
- package/skills/ios/swift-protocol-di-testing/SKILL.md +190 -0
- package/skills/ios/swiftui-design-tokens/SKILL.md +475 -0
- package/skills/ios/writing-for-interfaces/SKILL.md +75 -0
- package/skills/web/accessibility/SKILL.md +146 -0
- package/skills/web/aceternity-ui/SKILL.md +719 -0
- package/skills/web/aceternity-ui/metadata.json +10 -0
- package/skills/web/api-design/SKILL.md +523 -0
- package/skills/web/chart-accessibility/SKILL.md +332 -0
- package/skills/web/composition-patterns/AGENTS.md +946 -0
- package/skills/web/composition-patterns/README.md +60 -0
- package/skills/web/composition-patterns/SKILL.md +89 -0
- package/skills/web/composition-patterns/metadata.json +11 -0
- package/skills/web/composition-patterns/rules/_sections.md +29 -0
- package/skills/web/composition-patterns/rules/_template.md +24 -0
- package/skills/web/composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/skills/web/composition-patterns/rules/architecture-compound-components.md +112 -0
- package/skills/web/composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/skills/web/composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/skills/web/composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/skills/web/composition-patterns/rules/state-context-interface.md +191 -0
- package/skills/web/composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/skills/web/composition-patterns/rules/state-lift-state.md +125 -0
- package/skills/web/cost-aware-llm-pipeline/SKILL.md +183 -0
- package/skills/web/database-migrations/SKILL.md +429 -0
- package/skills/web/deployment-patterns/SKILL.md +427 -0
- package/skills/web/docker-patterns/SKILL.md +364 -0
- package/skills/web/e2e-testing/SKILL.md +326 -0
- package/skills/web/lighthouse-ci/SKILL.md +361 -0
- package/skills/web/mcp-server-patterns/SKILL.md +69 -0
- package/skills/web/next-best-practices/SKILL.md +153 -0
- package/skills/web/next-best-practices/async-patterns.md +87 -0
- package/skills/web/next-best-practices/bundling.md +180 -0
- package/skills/web/next-best-practices/data-patterns.md +297 -0
- package/skills/web/next-best-practices/debug-tricks.md +105 -0
- package/skills/web/next-best-practices/directives.md +73 -0
- package/skills/web/next-best-practices/error-handling.md +227 -0
- package/skills/web/next-best-practices/file-conventions.md +140 -0
- package/skills/web/next-best-practices/font.md +245 -0
- package/skills/web/next-best-practices/functions.md +108 -0
- package/skills/web/next-best-practices/hydration-error.md +91 -0
- package/skills/web/next-best-practices/image.md +173 -0
- package/skills/web/next-best-practices/metadata.md +301 -0
- package/skills/web/next-best-practices/parallel-routes.md +287 -0
- package/skills/web/next-best-practices/route-handlers.md +146 -0
- package/skills/web/next-best-practices/rsc-boundaries.md +159 -0
- package/skills/web/next-best-practices/runtime-selection.md +39 -0
- package/skills/web/next-best-practices/scripts.md +141 -0
- package/skills/web/next-best-practices/self-hosting.md +371 -0
- package/skills/web/next-best-practices/suspense-boundaries.md +67 -0
- package/skills/web/next-cache-components/SKILL.md +411 -0
- package/skills/web/postgres-best-practices/SKILL.md +14 -0
- package/skills/web/postgres-best-practices/references/schema-design.md +9 -0
- package/skills/web/react-best-practices/AGENTS.md +3810 -0
- package/skills/web/react-best-practices/README.md +123 -0
- package/skills/web/react-best-practices/SKILL.md +149 -0
- package/skills/web/react-best-practices/metadata.json +15 -0
- package/skills/web/react-best-practices/rules/_sections.md +46 -0
- package/skills/web/react-best-practices/rules/_template.md +28 -0
- package/skills/web/react-best-practices/rules/advanced-effect-event-deps.md +56 -0
- package/skills/web/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/skills/web/react-best-practices/rules/advanced-init-once.md +42 -0
- package/skills/web/react-best-practices/rules/advanced-use-latest.md +39 -0
- package/skills/web/react-best-practices/rules/async-api-routes.md +38 -0
- package/skills/web/react-best-practices/rules/async-cheap-condition-before-await.md +37 -0
- package/skills/web/react-best-practices/rules/async-defer-await.md +82 -0
- package/skills/web/react-best-practices/rules/async-dependencies.md +51 -0
- package/skills/web/react-best-practices/rules/async-parallel.md +28 -0
- package/skills/web/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/skills/web/react-best-practices/rules/bundle-analyzable-paths.md +63 -0
- package/skills/web/react-best-practices/rules/bundle-barrel-imports.md +60 -0
- package/skills/web/react-best-practices/rules/bundle-conditional.md +31 -0
- package/skills/web/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/skills/web/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/skills/web/react-best-practices/rules/bundle-preload.md +50 -0
- package/skills/web/react-best-practices/rules/client-event-listeners.md +74 -0
- package/skills/web/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/skills/web/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/skills/web/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/skills/web/react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/skills/web/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/skills/web/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/skills/web/react-best-practices/rules/js-cache-storage.md +70 -0
- package/skills/web/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/skills/web/react-best-practices/rules/js-early-exit.md +50 -0
- package/skills/web/react-best-practices/rules/js-flatmap-filter.md +60 -0
- package/skills/web/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/skills/web/react-best-practices/rules/js-index-maps.md +37 -0
- package/skills/web/react-best-practices/rules/js-length-check-first.md +49 -0
- package/skills/web/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/skills/web/react-best-practices/rules/js-request-idle-callback.md +105 -0
- package/skills/web/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/skills/web/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/skills/web/react-best-practices/rules/rendering-activity.md +26 -0
- package/skills/web/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/skills/web/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/skills/web/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/skills/web/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/skills/web/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/skills/web/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/skills/web/react-best-practices/rules/rendering-resource-hints.md +85 -0
- package/skills/web/react-best-practices/rules/rendering-script-defer-async.md +68 -0
- package/skills/web/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/skills/web/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/skills/web/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/skills/web/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/skills/web/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/skills/web/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/skills/web/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/skills/web/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/skills/web/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/skills/web/react-best-practices/rules/rerender-memo.md +44 -0
- package/skills/web/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/skills/web/react-best-practices/rules/rerender-no-inline-components.md +82 -0
- package/skills/web/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/skills/web/react-best-practices/rules/rerender-split-combined-hooks.md +64 -0
- package/skills/web/react-best-practices/rules/rerender-transitions.md +40 -0
- package/skills/web/react-best-practices/rules/rerender-use-deferred-value.md +59 -0
- package/skills/web/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/skills/web/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/skills/web/react-best-practices/rules/server-auth-actions.md +96 -0
- package/skills/web/react-best-practices/rules/server-cache-lru.md +41 -0
- package/skills/web/react-best-practices/rules/server-cache-react.md +76 -0
- package/skills/web/react-best-practices/rules/server-dedup-props.md +65 -0
- package/skills/web/react-best-practices/rules/server-hoist-static-io.md +149 -0
- package/skills/web/react-best-practices/rules/server-no-shared-module-state.md +50 -0
- package/skills/web/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/skills/web/react-best-practices/rules/server-parallel-nested-fetching.md +34 -0
- package/skills/web/react-best-practices/rules/server-serialization.md +38 -0
- package/skills/web/seo/SKILL.md +154 -0
- package/skills/web/web-design-guidelines/SKILL.md +39 -0
- package/skills/web/zap-scan-config/SKILL.md +444 -0
- package/skills/web/zap-scan-config/assets/.gitkeep +9 -0
- package/skills/web/zap-scan-config/assets/github_action.yml +207 -0
- package/skills/web/zap-scan-config/assets/gitlab_ci.yml +226 -0
- package/skills/web/zap-scan-config/assets/zap_automation.yaml +196 -0
- package/skills/web/zap-scan-config/assets/zap_context.xml +192 -0
- package/skills/web/zap-scan-config/references/EXAMPLE.md +40 -0
- package/skills/web/zap-scan-config/references/api_testing_guide.md +475 -0
- package/skills/web/zap-scan-config/references/authentication_guide.md +431 -0
- package/skills/web/zap-scan-config/references/false_positive_handling.md +427 -0
- package/skills/web/zap-scan-config/references/owasp_mapping.md +255 -0
- package/src/lrr/aggregator.ts +80 -0
- package/src/orchestrator/hooks/context-header.ts +95 -0
- package/src/orchestrator/hooks/token-accounting-emitter.ts +77 -0
- package/src/orchestrator/hooks/token-accounting.ts +101 -0
- package/src/orchestrator/mcp/cycle-counter.ts +129 -0
- package/src/orchestrator/mcp/scribe.ts +283 -0
- package/src/orchestrator/mcp/state-save.ts +149 -0
- package/src/orchestrator/mcp/write-lease.ts +167 -0
- package/src/orchestrator/phase4-shared-context.ts +41 -0
- package/src/orchestrator/schemas/backward-edge.ts +46 -0
- package/agents/agentic-identity-trust.md +0 -121
- package/agents/data-consolidation-agent.md +0 -39
- package/agents/design-image-prompt-engineer.md +0 -105
- package/agents/design-visual-storyteller.md +0 -147
- package/agents/design-whimsy-injector.md +0 -89
- package/agents/engineering-autonomous-optimization-architect.md +0 -105
- package/agents/market-intel.md +0 -35
- package/agents/marketing-instagram-curator.md +0 -111
- package/agents/marketing-reddit-community-builder.md +0 -121
- package/agents/marketing-social-media-strategist.md +0 -74
- package/agents/marketing-tiktok-strategist.md +0 -123
- package/agents/marketing-twitter-engager.md +0 -124
- package/agents/marketing-wechat-official-account.md +0 -143
- package/agents/marketing-xiaohongshu-specialist.md +0 -136
- package/agents/marketing-zhihu-strategist.md +0 -160
- package/agents/product-behavioral-nudge-engine.md +0 -78
- package/agents/project-management-experiment-tracker.md +0 -102
- package/agents/report-distribution-agent.md +0 -43
- package/agents/risk-analysis.md +0 -45
- package/agents/sales-data-extraction-agent.md +0 -46
- package/agents/specialized-cultural-intelligence-strategist.md +0 -65
- package/agents/specialized-developer-advocate.md +0 -146
- package/agents/support-analytics-reporter.md +0 -133
- package/agents/support-executive-summary-generator.md +0 -64
- package/agents/support-finance-tracker.md +0 -145
- package/agents/support-legal-compliance-checker.md +0 -129
- package/agents/support-support-responder.md +0 -91
- package/agents/testing-accessibility-auditor.md +0 -110
- package/agents/testing-test-results-analyzer.md +0 -97
- package/agents/testing-tool-evaluator.md +0 -76
- package/agents/testing-workflow-optimizer.md +0 -99
- package/agents/user-research.md +0 -40
- package/protocols/brainstorm.md +0 -99
- package/protocols/design.md +0 -269
- package/protocols/planning.md +0 -87
- package/skills/ios/ios-hig/SKILL.md +0 -41
- package/skills/ios/ios-hig/references/accessibility.md +0 -81
- package/skills/ios/ios-hig/references/content.md +0 -142
- package/skills/ios/ios-hig/references/feedback.md +0 -123
- package/skills/ios/ios-hig/references/interaction.md +0 -199
- package/skills/ios/ios-hig/references/performance-platform.md +0 -129
- package/skills/ios/ios-hig/references/privacy-permissions.md +0 -181
- package/skills/ios/ios-hig/references/visual-design.md +0 -84
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dast-zap
|
|
3
|
+
description: >
|
|
4
|
+
Dynamic application security testing (DAST) using OWASP ZAP (Zed Attack Proxy) with passive and active scanning,
|
|
5
|
+
API testing, and OWASP Top 10 vulnerability detection. Use when: (1) Performing runtime security testing of web
|
|
6
|
+
applications and APIs, (2) Detecting vulnerabilities like XSS, SQL injection, and authentication flaws in deployed
|
|
7
|
+
applications, (3) Automating security scans in CI/CD pipelines with Docker containers, (4) Conducting authenticated
|
|
8
|
+
testing with session management, (5) Generating security reports with OWASP and CWE mappings for compliance.
|
|
9
|
+
version: 0.1.0
|
|
10
|
+
maintainer: SirAppSec
|
|
11
|
+
category: appsec
|
|
12
|
+
tags: [dast, zap, web-security, owasp, vulnerability-scanning, api-testing, penetration-testing]
|
|
13
|
+
frameworks: [OWASP, CWE]
|
|
14
|
+
dependencies:
|
|
15
|
+
tools: [docker]
|
|
16
|
+
optional: [python3, java]
|
|
17
|
+
references:
|
|
18
|
+
- https://www.zaproxy.org/docs/
|
|
19
|
+
- https://www.zaproxy.org/docs/docker/
|
|
20
|
+
- https://www.zaproxy.org/docs/desktop/start/features/
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# DAST with OWASP ZAP
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
OWASP ZAP (Zed Attack Proxy) is an open-source DAST tool that acts as a manipulator-in-the-middle proxy to intercept,
|
|
28
|
+
inspect, and test web application traffic for security vulnerabilities. ZAP provides automated passive and active
|
|
29
|
+
scanning, API testing capabilities, and seamless CI/CD integration for runtime security testing.
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
### Baseline Scan (Docker)
|
|
34
|
+
|
|
35
|
+
Run a quick passive security scan:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
docker run -t zaproxy/zap-stable zap-baseline.py -t https://target-app.com -r baseline-report.html
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Full Active Scan (Docker)
|
|
42
|
+
|
|
43
|
+
Perform comprehensive active vulnerability testing:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
docker run -t zaproxy/zap-stable zap-full-scan.py -t https://target-app.com -r full-scan-report.html
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### API Scan with OpenAPI Spec
|
|
50
|
+
|
|
51
|
+
Test APIs using OpenAPI/Swagger specification:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
docker run -v $(pwd):/zap/wrk/:rw -t zaproxy/zap-stable zap-api-scan.py \
|
|
55
|
+
-t https://api.target.com \
|
|
56
|
+
-f openapi \
|
|
57
|
+
-d /zap/wrk/openapi-spec.yaml \
|
|
58
|
+
-r /zap/wrk/api-report.html
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Core Workflow
|
|
62
|
+
|
|
63
|
+
### Step 1: Define Scan Scope and Target
|
|
64
|
+
|
|
65
|
+
Identify the target application URL and define scope:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Set target URL
|
|
69
|
+
TARGET_URL="https://target-app.com"
|
|
70
|
+
|
|
71
|
+
# For authenticated scans, prepare authentication context
|
|
72
|
+
# See references/authentication_guide.md for detailed setup
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Scope Considerations:**
|
|
76
|
+
- Exclude third-party domains and CDN URLs
|
|
77
|
+
- Include all application subdomains and API endpoints
|
|
78
|
+
- Respect scope limitations in penetration testing engagements
|
|
79
|
+
|
|
80
|
+
### Step 2: Run Passive Scanning
|
|
81
|
+
|
|
82
|
+
Execute passive scanning to analyze traffic without active attacks:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Baseline scan performs spidering + passive scanning
|
|
86
|
+
docker run -t zaproxy/zap-stable zap-baseline.py \
|
|
87
|
+
-t $TARGET_URL \
|
|
88
|
+
-r baseline-report.html \
|
|
89
|
+
-J baseline-report.json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**What Passive Scanning Detects:**
|
|
93
|
+
- Missing security headers (CSP, HSTS, X-Frame-Options)
|
|
94
|
+
- Information disclosure in responses
|
|
95
|
+
- Cookie security issues (HttpOnly, Secure flags)
|
|
96
|
+
- Basic authentication weaknesses
|
|
97
|
+
- Application fingerprinting data
|
|
98
|
+
|
|
99
|
+
### Step 3: Execute Active Scanning
|
|
100
|
+
|
|
101
|
+
Perform active vulnerability testing (requires authorization):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Full scan includes spidering + passive + active scanning
|
|
105
|
+
docker run -t zaproxy/zap-stable zap-full-scan.py \
|
|
106
|
+
-t $TARGET_URL \
|
|
107
|
+
-r full-scan-report.html \
|
|
108
|
+
-J full-scan-report.json \
|
|
109
|
+
-z "-config api.addrs.addr.name=.* -config api.addrs.addr.regex=true"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Active Scanning Coverage:**
|
|
113
|
+
- SQL Injection (SQLi)
|
|
114
|
+
- Cross-Site Scripting (XSS)
|
|
115
|
+
- Path Traversal
|
|
116
|
+
- Command Injection
|
|
117
|
+
- XML External Entity (XXE)
|
|
118
|
+
- Server-Side Request Forgery (SSRF)
|
|
119
|
+
- Security Misconfigurations
|
|
120
|
+
|
|
121
|
+
**WARNING:** Active scanning performs real attacks. Only run against applications you have explicit authorization to test.
|
|
122
|
+
|
|
123
|
+
### Step 4: Test APIs with Specifications
|
|
124
|
+
|
|
125
|
+
Scan REST, GraphQL, and SOAP APIs:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# OpenAPI/Swagger API scan
|
|
129
|
+
docker run -v $(pwd):/zap/wrk/:rw -t zaproxy/zap-stable zap-api-scan.py \
|
|
130
|
+
-t https://api.target.com \
|
|
131
|
+
-f openapi \
|
|
132
|
+
-d /zap/wrk/openapi.yaml \
|
|
133
|
+
-r /zap/wrk/api-report.html
|
|
134
|
+
|
|
135
|
+
# GraphQL API scan
|
|
136
|
+
docker run -v $(pwd):/zap/wrk/:rw -t zaproxy/zap-stable zap-api-scan.py \
|
|
137
|
+
-t https://api.target.com/graphql \
|
|
138
|
+
-f graphql \
|
|
139
|
+
-d /zap/wrk/schema.graphql \
|
|
140
|
+
-r /zap/wrk/graphql-report.html
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Consult `references/api_testing_guide.md` for advanced API testing patterns including authentication and rate limiting.
|
|
144
|
+
|
|
145
|
+
### Step 5: Handle Authentication
|
|
146
|
+
|
|
147
|
+
For testing authenticated application areas:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Use bundled script for authentication setup
|
|
151
|
+
python3 scripts/zap_auth_scanner.py \
|
|
152
|
+
--target $TARGET_URL \
|
|
153
|
+
--auth-type form \
|
|
154
|
+
--login-url https://target-app.com/login \
|
|
155
|
+
--username testuser \
|
|
156
|
+
--password-env ZAP_AUTH_PASSWORD \
|
|
157
|
+
--output auth-scan-report.html
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Authentication methods supported:
|
|
161
|
+
- Form-based authentication
|
|
162
|
+
- HTTP Basic/Digest authentication
|
|
163
|
+
- OAuth 2.0 flows
|
|
164
|
+
- API key/token authentication
|
|
165
|
+
- Script-based custom authentication
|
|
166
|
+
|
|
167
|
+
See `references/authentication_guide.md` for detailed authentication configuration.
|
|
168
|
+
|
|
169
|
+
### Step 6: Analyze Results and Generate Reports
|
|
170
|
+
|
|
171
|
+
Review findings by risk level:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Generate multiple report formats
|
|
175
|
+
docker run -v $(pwd):/zap/wrk/:rw -t zaproxy/zap-stable zap-full-scan.py \
|
|
176
|
+
-t $TARGET_URL \
|
|
177
|
+
-r /zap/wrk/report.html \
|
|
178
|
+
-J /zap/wrk/report.json \
|
|
179
|
+
-x /zap/wrk/report.xml
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Risk Levels:**
|
|
183
|
+
- **High**: Critical vulnerabilities requiring immediate remediation (SQLi, RCE, authentication bypass)
|
|
184
|
+
- **Medium**: Significant security weaknesses (XSS, CSRF, sensitive data exposure)
|
|
185
|
+
- **Low**: Security concerns with lower exploitability (information disclosure, minor misconfigurations)
|
|
186
|
+
- **Informational**: Security best practices and observations
|
|
187
|
+
|
|
188
|
+
Map findings to OWASP Top 10 using `references/owasp_mapping.md`.
|
|
189
|
+
|
|
190
|
+
## Automation & CI/CD Integration
|
|
191
|
+
|
|
192
|
+
### GitHub Actions Integration
|
|
193
|
+
|
|
194
|
+
Add ZAP scanning to GitHub workflows:
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
# .github/workflows/zap-scan.yml
|
|
198
|
+
name: ZAP Security Scan
|
|
199
|
+
on: [push, pull_request]
|
|
200
|
+
|
|
201
|
+
jobs:
|
|
202
|
+
zap_scan:
|
|
203
|
+
runs-on: ubuntu-latest
|
|
204
|
+
name: OWASP ZAP Baseline Scan
|
|
205
|
+
steps:
|
|
206
|
+
- name: Checkout
|
|
207
|
+
uses: actions/checkout@v2
|
|
208
|
+
|
|
209
|
+
- name: ZAP Baseline Scan
|
|
210
|
+
uses: zaproxy/action-baseline@v0.7.0
|
|
211
|
+
with:
|
|
212
|
+
target: 'https://staging.target-app.com'
|
|
213
|
+
rules_file_name: '.zap/rules.tsv'
|
|
214
|
+
cmd_options: '-a'
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Docker Automation Framework
|
|
218
|
+
|
|
219
|
+
Use YAML-based automation for advanced workflows:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Create automation config (see assets/zap_automation.yaml)
|
|
223
|
+
docker run -v $(pwd):/zap/wrk/:rw -t zaproxy/zap-stable \
|
|
224
|
+
zap.sh -cmd -autorun /zap/wrk/zap_automation.yaml
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
The bundled `assets/zap_automation.yaml` template includes:
|
|
228
|
+
- Environment configuration
|
|
229
|
+
- Spider and AJAX spider settings
|
|
230
|
+
- Passive and active scan policies
|
|
231
|
+
- Authentication configuration
|
|
232
|
+
- Report generation
|
|
233
|
+
|
|
234
|
+
### CI/CD Best Practices
|
|
235
|
+
|
|
236
|
+
- Use **baseline scans** for every commit/PR (low false positives)
|
|
237
|
+
- Run **full scans** on staging environments before production deployment
|
|
238
|
+
- Configure **API scans** for microservices and REST endpoints
|
|
239
|
+
- Set **failure thresholds** to break builds on high-severity findings
|
|
240
|
+
- Generate **SARIF reports** for GitHub Security tab integration
|
|
241
|
+
|
|
242
|
+
See `scripts/ci_integration.sh` for complete CI/CD integration examples.
|
|
243
|
+
|
|
244
|
+
## Security Considerations
|
|
245
|
+
|
|
246
|
+
- **Authorization**: Always obtain written authorization before scanning production systems or third-party applications
|
|
247
|
+
- **Rate Limiting**: Configure scan speed to avoid overwhelming target applications or triggering DDoS protections
|
|
248
|
+
- **Sensitive Data**: Never include production credentials in scan configurations; use environment variables or secrets management
|
|
249
|
+
- **Scan Timing**: Run active scans during maintenance windows or against dedicated testing environments
|
|
250
|
+
- **Legal Compliance**: Adhere to computer fraud and abuse laws; unauthorized scanning may be illegal
|
|
251
|
+
- **Audit Logging**: Log all scan executions, targets, findings, and remediation actions for compliance audits
|
|
252
|
+
- **Data Retention**: Sanitize scan reports before sharing; they may contain sensitive application data
|
|
253
|
+
- **False Positives**: Manually verify findings before raising security incidents; DAST tools generate false positives
|
|
254
|
+
|
|
255
|
+
## Bundled Resources
|
|
256
|
+
|
|
257
|
+
### Scripts (`scripts/`)
|
|
258
|
+
|
|
259
|
+
- `zap_baseline_scan.sh` - Automated baseline scanning with configurable targets and reporting
|
|
260
|
+
- `zap_full_scan.sh` - Comprehensive active scanning with exclusion rules
|
|
261
|
+
- `zap_api_scan.py` - API testing with OpenAPI/GraphQL specification support
|
|
262
|
+
- `zap_auth_scanner.py` - Authenticated scanning with multiple authentication methods
|
|
263
|
+
- `ci_integration.sh` - CI/CD integration examples for Jenkins, GitLab CI, GitHub Actions
|
|
264
|
+
|
|
265
|
+
### References (`references/`)
|
|
266
|
+
|
|
267
|
+
- `authentication_guide.md` - Complete authentication configuration for form-based, OAuth, and token authentication
|
|
268
|
+
- `owasp_mapping.md` - Mapping of ZAP alerts to OWASP Top 10 2021 and CWE classifications
|
|
269
|
+
- `api_testing_guide.md` - Advanced API testing patterns for REST, GraphQL, SOAP, and WebSocket
|
|
270
|
+
- `scan_policies.md` - Custom scan policy configuration for different application types
|
|
271
|
+
- `false_positive_handling.md` - Common false positives and verification techniques
|
|
272
|
+
|
|
273
|
+
### Assets (`assets/`)
|
|
274
|
+
|
|
275
|
+
- `zap_automation.yaml` - Automation framework configuration template
|
|
276
|
+
- `zap_context.xml` - Context configuration with authentication and session management
|
|
277
|
+
- `scan_policy_modern_web.policy` - Scan policy optimized for modern JavaScript applications
|
|
278
|
+
- `scan_policy_api.policy` - Scan policy for REST and GraphQL APIs
|
|
279
|
+
- `github_action.yml` - GitHub Actions workflow template
|
|
280
|
+
- `gitlab_ci.yml` - GitLab CI pipeline template
|
|
281
|
+
|
|
282
|
+
## Common Patterns
|
|
283
|
+
|
|
284
|
+
### Pattern 1: Progressive Scanning (Speed vs. Coverage)
|
|
285
|
+
|
|
286
|
+
Start with fast scans and progressively increase depth:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
# Stage 1: Quick baseline scan (5-10 minutes)
|
|
290
|
+
docker run -t zaproxy/zap-stable zap-baseline.py -t $TARGET_URL -r baseline.html
|
|
291
|
+
|
|
292
|
+
# Stage 2: Full spider + passive scan (15-30 minutes)
|
|
293
|
+
docker run -t zaproxy/zap-stable zap-baseline.py -t $TARGET_URL -r baseline.html -c baseline-rules.tsv
|
|
294
|
+
|
|
295
|
+
# Stage 3: Targeted active scan on critical endpoints (1-2 hours)
|
|
296
|
+
docker run -t zaproxy/zap-stable zap-full-scan.py -t $TARGET_URL -r full.html -c full-rules.tsv
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Pattern 2: API-First Testing
|
|
300
|
+
|
|
301
|
+
Prioritize API security testing:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
# 1. Test API endpoints with specification
|
|
305
|
+
docker run -v $(pwd):/zap/wrk/:rw -t zaproxy/zap-stable zap-api-scan.py \
|
|
306
|
+
-t https://api.target.com -f openapi -d /zap/wrk/openapi.yaml -r /zap/wrk/api.html
|
|
307
|
+
|
|
308
|
+
# 2. Run active scan on discovered API endpoints
|
|
309
|
+
# (ZAP automatically includes spidered API routes)
|
|
310
|
+
|
|
311
|
+
# 3. Test authentication flows
|
|
312
|
+
python3 scripts/zap_auth_scanner.py --target https://api.target.com --auth-type bearer --token-env API_TOKEN
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Pattern 3: Authenticated Web Application Testing
|
|
316
|
+
|
|
317
|
+
Test complete application including protected areas:
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# 1. Configure authentication context
|
|
321
|
+
# See assets/zap_context.xml for template
|
|
322
|
+
|
|
323
|
+
# 2. Run authenticated scan
|
|
324
|
+
python3 scripts/zap_auth_scanner.py \
|
|
325
|
+
--target https://app.target.com \
|
|
326
|
+
--auth-type form \
|
|
327
|
+
--login-url https://app.target.com/login \
|
|
328
|
+
--username testuser \
|
|
329
|
+
--password-env APP_PASSWORD \
|
|
330
|
+
--verification-url https://app.target.com/dashboard \
|
|
331
|
+
--output authenticated-scan.html
|
|
332
|
+
|
|
333
|
+
# 3. Review session-specific vulnerabilities (CSRF, privilege escalation)
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Pattern 4: CI/CD Security Gate
|
|
337
|
+
|
|
338
|
+
Implement ZAP as a security gate in deployment pipelines:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
# Run baseline scan and fail build on high-risk findings
|
|
342
|
+
docker run -t zaproxy/zap-stable zap-baseline.py \
|
|
343
|
+
-t https://staging.target.com \
|
|
344
|
+
-r baseline-report.html \
|
|
345
|
+
-J baseline-report.json \
|
|
346
|
+
--hook=scripts/ci_integration.sh
|
|
347
|
+
|
|
348
|
+
# Check exit code
|
|
349
|
+
if [ $? -ne 0 ]; then
|
|
350
|
+
echo "Security scan failed! High-risk vulnerabilities detected."
|
|
351
|
+
exit 1
|
|
352
|
+
fi
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## Integration Points
|
|
356
|
+
|
|
357
|
+
- **CI/CD**: GitHub Actions, GitLab CI, Jenkins, Azure DevOps, CircleCI
|
|
358
|
+
- **Issue Tracking**: Jira, GitHub Issues (via SARIF), ServiceNow
|
|
359
|
+
- **Security Tools**: Defect Dojo (vulnerability management), SonarQube, OWASP Dependency-Check
|
|
360
|
+
- **SDLC**: Pre-production testing phase, security regression testing, penetration testing preparation
|
|
361
|
+
- **Authentication**: Integrates with OAuth providers, SAML, API gateways, custom authentication scripts
|
|
362
|
+
- **Reporting**: HTML, JSON, XML, Markdown, SARIF (for GitHub Security), PDF (via custom scripts)
|
|
363
|
+
|
|
364
|
+
## Troubleshooting
|
|
365
|
+
|
|
366
|
+
### Issue: Docker Container Cannot Reach Target Application
|
|
367
|
+
|
|
368
|
+
**Solution**: For scanning applications running on localhost or in other containers:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
# Scanning host application from Docker container
|
|
372
|
+
# Use docker0 bridge IP instead of localhost
|
|
373
|
+
HOST_IP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
|
|
374
|
+
docker run -t zaproxy/zap-stable zap-baseline.py -t http://$HOST_IP:8080
|
|
375
|
+
|
|
376
|
+
# Scanning between containers - create shared network
|
|
377
|
+
docker network create zap-network
|
|
378
|
+
docker run --network zap-network -t zaproxy/zap-stable zap-baseline.py -t http://app-container:8080
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Issue: Scan Completes Too Quickly (Incomplete Coverage)
|
|
382
|
+
|
|
383
|
+
**Solution**: Increase spider depth and scan duration:
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
# Configure spider to crawl deeper
|
|
387
|
+
docker run -t zaproxy/zap-stable zap-baseline.py \
|
|
388
|
+
-t $TARGET_URL \
|
|
389
|
+
-r report.html \
|
|
390
|
+
-z "-config spider.maxDepth=10 -config spider.maxDuration=60"
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
For JavaScript-heavy applications, use AJAX spider or Automation Framework.
|
|
394
|
+
|
|
395
|
+
### Issue: High False Positive Rate
|
|
396
|
+
|
|
397
|
+
**Solution**: Create custom scan policy and rules file:
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
# Use bundled false positive handling guide
|
|
401
|
+
# See references/false_positive_handling.md
|
|
402
|
+
|
|
403
|
+
# Generate rules file to suppress false positives
|
|
404
|
+
# Format: alert_id URL_pattern parameter CWE_id WARN|IGNORE|FAIL
|
|
405
|
+
echo "10202 https://target.com/static/.* .* 798 IGNORE" >> .zap/rules.tsv
|
|
406
|
+
|
|
407
|
+
docker run -t zaproxy/zap-stable zap-baseline.py -t $TARGET_URL -c .zap/rules.tsv
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Issue: Authentication Session Expires During Scan
|
|
411
|
+
|
|
412
|
+
**Solution**: Configure session re-authentication:
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
# Use bundled authentication script with session monitoring
|
|
416
|
+
python3 scripts/zap_auth_scanner.py \
|
|
417
|
+
--target $TARGET_URL \
|
|
418
|
+
--auth-type form \
|
|
419
|
+
--login-url https://target.com/login \
|
|
420
|
+
--username testuser \
|
|
421
|
+
--password-env PASSWORD \
|
|
422
|
+
--re-authenticate-on 401,403 \
|
|
423
|
+
--verification-interval 300
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Issue: Scan Triggering Rate Limiting or WAF Blocking
|
|
427
|
+
|
|
428
|
+
**Solution**: Reduce scan aggressiveness:
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
# Slower scan with delays between requests
|
|
432
|
+
docker run -t zaproxy/zap-stable zap-baseline.py \
|
|
433
|
+
-t $TARGET_URL \
|
|
434
|
+
-r report.html \
|
|
435
|
+
-z "-config scanner.threadPerHost=1 -config scanner.delayInMs=1000"
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
## References
|
|
439
|
+
|
|
440
|
+
- [OWASP ZAP Documentation](https://www.zaproxy.org/docs/)
|
|
441
|
+
- [ZAP Docker Documentation](https://www.zaproxy.org/docs/docker/)
|
|
442
|
+
- [OWASP Top 10 2021](https://owasp.org/Top10/)
|
|
443
|
+
- [ZAP Automation Framework](https://www.zaproxy.org/docs/automate/automation-framework/)
|
|
444
|
+
- [GitHub Actions for ZAP](https://github.com/zaproxy/action-baseline)
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# GitHub Actions Workflow for OWASP ZAP Security Scanning
|
|
2
|
+
# Place this file in .github/workflows/zap-security-scan.yml
|
|
3
|
+
|
|
4
|
+
name: OWASP ZAP Security Scan
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main, develop]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [main]
|
|
11
|
+
schedule:
|
|
12
|
+
# Run weekly security scans on Sunday at 2 AM
|
|
13
|
+
- cron: '0 2 * * 0'
|
|
14
|
+
workflow_dispatch: # Allow manual triggering
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
security-events: write # For uploading SARIF reports
|
|
19
|
+
issues: write # For creating security issues
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
zap-baseline-scan:
|
|
23
|
+
name: ZAP Baseline Scan (PR/Push)
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
if: github.event_name == 'pull_request' || github.event_name == 'push'
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout code
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- name: Run ZAP Baseline Scan
|
|
32
|
+
uses: zaproxy/action-baseline@v0.10.0
|
|
33
|
+
with:
|
|
34
|
+
target: ${{ secrets.STAGING_URL }}
|
|
35
|
+
rules_file_name: '.zap/rules.tsv'
|
|
36
|
+
cmd_options: '-a -j'
|
|
37
|
+
fail_action: true
|
|
38
|
+
allow_issue_writing: false
|
|
39
|
+
|
|
40
|
+
- name: Upload ZAP Scan Report
|
|
41
|
+
uses: actions/upload-artifact@v4
|
|
42
|
+
if: always()
|
|
43
|
+
with:
|
|
44
|
+
name: zap-baseline-report
|
|
45
|
+
path: |
|
|
46
|
+
report_html.html
|
|
47
|
+
report_json.json
|
|
48
|
+
retention-days: 30
|
|
49
|
+
|
|
50
|
+
- name: Create Issue on Failure
|
|
51
|
+
if: failure()
|
|
52
|
+
uses: actions/github-script@v7
|
|
53
|
+
with:
|
|
54
|
+
script: |
|
|
55
|
+
github.rest.issues.create({
|
|
56
|
+
owner: context.repo.owner,
|
|
57
|
+
repo: context.repo.repo,
|
|
58
|
+
title: '🔒 ZAP Baseline Scan Found Security Issues',
|
|
59
|
+
body: 'ZAP baseline scan detected security vulnerabilities. Please review the scan report in the workflow artifacts.',
|
|
60
|
+
labels: ['security', 'automated']
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
zap-full-scan:
|
|
64
|
+
name: ZAP Full Active Scan (Staging)
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
if: github.ref == 'refs/heads/develop' || github.event_name == 'schedule'
|
|
67
|
+
|
|
68
|
+
steps:
|
|
69
|
+
- name: Checkout code
|
|
70
|
+
uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Run ZAP Full Scan
|
|
73
|
+
uses: zaproxy/action-full-scan@v0.8.0
|
|
74
|
+
with:
|
|
75
|
+
target: ${{ secrets.STAGING_URL }}
|
|
76
|
+
rules_file_name: '.zap/rules.tsv'
|
|
77
|
+
cmd_options: '-a -j -x report.xml'
|
|
78
|
+
fail_action: true
|
|
79
|
+
allow_issue_writing: true
|
|
80
|
+
issue_title: 'ZAP Full Scan: Security Vulnerabilities Detected'
|
|
81
|
+
|
|
82
|
+
- name: Upload ZAP Full Scan Report
|
|
83
|
+
uses: actions/upload-artifact@v4
|
|
84
|
+
if: always()
|
|
85
|
+
with:
|
|
86
|
+
name: zap-full-scan-report
|
|
87
|
+
path: |
|
|
88
|
+
report_html.html
|
|
89
|
+
report_json.json
|
|
90
|
+
report.xml
|
|
91
|
+
retention-days: 90
|
|
92
|
+
|
|
93
|
+
- name: Upload SARIF Report to GitHub Security
|
|
94
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
95
|
+
if: always()
|
|
96
|
+
with:
|
|
97
|
+
sarif_file: report.xml
|
|
98
|
+
|
|
99
|
+
zap-api-scan:
|
|
100
|
+
name: ZAP API Scan
|
|
101
|
+
runs-on: ubuntu-latest
|
|
102
|
+
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
|
103
|
+
|
|
104
|
+
steps:
|
|
105
|
+
- name: Checkout code
|
|
106
|
+
uses: actions/checkout@v4
|
|
107
|
+
|
|
108
|
+
- name: Run ZAP API Scan
|
|
109
|
+
uses: zaproxy/action-api-scan@v0.6.0
|
|
110
|
+
with:
|
|
111
|
+
target: ${{ secrets.API_URL }}
|
|
112
|
+
format: openapi
|
|
113
|
+
api_spec_file: './openapi.yaml'
|
|
114
|
+
cmd_options: '-a -j'
|
|
115
|
+
fail_action: true
|
|
116
|
+
|
|
117
|
+
- name: Upload API Scan Report
|
|
118
|
+
uses: actions/upload-artifact@v4
|
|
119
|
+
if: always()
|
|
120
|
+
with:
|
|
121
|
+
name: zap-api-scan-report
|
|
122
|
+
path: |
|
|
123
|
+
report_html.html
|
|
124
|
+
report_json.json
|
|
125
|
+
retention-days: 30
|
|
126
|
+
|
|
127
|
+
zap-authenticated-scan:
|
|
128
|
+
name: ZAP Authenticated Scan
|
|
129
|
+
runs-on: ubuntu-latest
|
|
130
|
+
if: github.ref == 'refs/heads/develop'
|
|
131
|
+
|
|
132
|
+
steps:
|
|
133
|
+
- name: Checkout code
|
|
134
|
+
uses: actions/checkout@v4
|
|
135
|
+
|
|
136
|
+
- name: Setup Python
|
|
137
|
+
uses: actions/setup-python@v5
|
|
138
|
+
with:
|
|
139
|
+
python-version: '3.11'
|
|
140
|
+
|
|
141
|
+
- name: Run Authenticated Scan
|
|
142
|
+
env:
|
|
143
|
+
APP_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
|
|
144
|
+
TARGET_URL: ${{ secrets.STAGING_URL }}
|
|
145
|
+
run: |
|
|
146
|
+
python3 scripts/zap_auth_scanner.py \
|
|
147
|
+
--target $TARGET_URL \
|
|
148
|
+
--auth-type form \
|
|
149
|
+
--login-url $TARGET_URL/login \
|
|
150
|
+
--username testuser \
|
|
151
|
+
--password-env APP_PASSWORD \
|
|
152
|
+
--output ./authenticated-scan-report.html
|
|
153
|
+
|
|
154
|
+
- name: Upload Authenticated Scan Report
|
|
155
|
+
uses: actions/upload-artifact@v4
|
|
156
|
+
if: always()
|
|
157
|
+
with:
|
|
158
|
+
name: zap-authenticated-scan-report
|
|
159
|
+
path: authenticated-scan-report.*
|
|
160
|
+
retention-days: 90
|
|
161
|
+
|
|
162
|
+
security-gate:
|
|
163
|
+
name: Security Gate Check
|
|
164
|
+
runs-on: ubuntu-latest
|
|
165
|
+
needs: [zap-baseline-scan]
|
|
166
|
+
if: always()
|
|
167
|
+
|
|
168
|
+
steps:
|
|
169
|
+
- name: Download Scan Results
|
|
170
|
+
uses: actions/download-artifact@v4
|
|
171
|
+
with:
|
|
172
|
+
name: zap-baseline-report
|
|
173
|
+
|
|
174
|
+
- name: Check Security Thresholds
|
|
175
|
+
run: |
|
|
176
|
+
# Install jq for JSON parsing
|
|
177
|
+
sudo apt-get update && sudo apt-get install -y jq
|
|
178
|
+
|
|
179
|
+
# Count high and medium findings
|
|
180
|
+
HIGH_COUNT=$(jq '[.site[].alerts[] | select(.risk == "High")] | length' report_json.json)
|
|
181
|
+
MEDIUM_COUNT=$(jq '[.site[].alerts[] | select(.risk == "Medium")] | length' report_json.json)
|
|
182
|
+
|
|
183
|
+
echo "High risk findings: $HIGH_COUNT"
|
|
184
|
+
echo "Medium risk findings: $MEDIUM_COUNT"
|
|
185
|
+
|
|
186
|
+
# Fail if thresholds exceeded
|
|
187
|
+
if [ "$HIGH_COUNT" -gt 0 ]; then
|
|
188
|
+
echo "❌ Security gate failed: $HIGH_COUNT high-risk vulnerabilities found"
|
|
189
|
+
exit 1
|
|
190
|
+
fi
|
|
191
|
+
|
|
192
|
+
if [ "$MEDIUM_COUNT" -gt 10 ]; then
|
|
193
|
+
echo "❌ Security gate failed: $MEDIUM_COUNT medium-risk vulnerabilities (max: 10)"
|
|
194
|
+
exit 1
|
|
195
|
+
fi
|
|
196
|
+
|
|
197
|
+
echo "✅ Security gate passed"
|
|
198
|
+
|
|
199
|
+
- name: Post Summary
|
|
200
|
+
if: always()
|
|
201
|
+
run: |
|
|
202
|
+
echo "## Security Scan Summary" >> $GITHUB_STEP_SUMMARY
|
|
203
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
204
|
+
echo "| Risk Level | Count |" >> $GITHUB_STEP_SUMMARY
|
|
205
|
+
echo "|------------|-------|" >> $GITHUB_STEP_SUMMARY
|
|
206
|
+
jq -r '.site[].alerts[] | .risk' report_json.json | sort | uniq -c | \
|
|
207
|
+
awk '{print "| " $2 " | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
|