This commit is contained in:
2026-05-08 23:46:17 +10:00
commit 10c8cfaa0f
71 changed files with 2139 additions and 0 deletions
@@ -0,0 +1,7 @@
# Security Review Crew Agents Configuration
security_reviewer:
role: Application Security Engineer
goal: Identify security vulnerabilities and ensure security best practices are followed
backstory: You are an experienced security engineer specialized in application security. You have extensive experience in penetration testing, code security analysis, and helping organizations build secure software.
verbose: true
allow_delegation: false
@@ -0,0 +1,16 @@
# Security Review Crew Tasks Configuration
security_review_task:
description: |
Review the code changes in the pull request for security vulnerabilities and compliance with security best practices.
PR Title: {pr_title}
PR Description: {pr_description}
Files to review: {files}
Context: {context}
expected_output: |
A detailed security review report including:
- Summary of security-related changes
- Identified vulnerabilities (if any)
- Security best practices violations (if any)
- Suggestions for improving security posture
- Overall security rating (e.g., Secure, Needs Improvement)
agent: security_reviewer
@@ -0,0 +1,51 @@
from crewai import CrewBase, Agent, Task, Crew
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters
import os
from typing import Dict, Any
class SecurityReviewCrew(CrewBase):
"""Security Review Crew for conducting security reviews."""
agents_config = "config/agents.yaml"
tasks_config = "config/tasks.yaml"
def __init__(self):
super().__init__()
# Trivy uses native MCP server, so we don't need to configure a wrapper.
# However, we might need to set up connection parameters if required by the native server.
# For now, we assume the native Trivy MCP server is available at a known address or via stdio.
# We'll leave the MCP server configuration empty and rely on the native server being available.
self.trivy_server_params = None # Placeholder for if we need to configure stdio parameters
@Agent
def security_reviewer(self) -> Agent:
"""Application Security Engineer agent for security review."""
return Agent(
config=self.agents_config["security_reviewer"],
tools=[], # Tools will be added via MCP adapter in the task
verbose=True
)
@Task
def security_review_task(self) -> Task:
"""Task for conducting security review."""
return Task(
config=self.tasks_config["security_review_task"],
)
@Crew
def crew(self) -> Crew:
"""Create the Security Review crew."""
# If we had an MCP server to wrap, we would create an adapter here.
# Since Trivy is native, we don't add any tools via MCPServerAdapter.
# However, the native server should be available in the MCP ecosystem.
# We'll assume the tools are automatically available or will be handled differently.
return Crew(
agents=[self.security_reviewer()],
tasks=[self.security_review_task()],
process="sequential",
verbose=True,
# No additional tools from MCP wrapper for Trivy (native)
)