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
8 changes: 4 additions & 4 deletions sast-engine/graph/parser_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ func parseDockerCompose(filePath string, graph *CodeGraph) error {

// Convert each service to a CodeGraph node
for serviceName, serviceNode := range composeGraph.Services {
node := convertComposeServiceToNode(serviceName, serviceNode, filePath, composeGraph)
node := convertComposeServiceToNode(serviceName, serviceNode, filePath)
graph.AddNode(node)
}

return nil
}

// convertComposeServiceToNode converts a docker-compose service to a CodeGraph Node.
func convertComposeServiceToNode(serviceName string, serviceNode *YAMLNode, filePath string, composeGraph *ComposeGraph) *Node {
func convertComposeServiceToNode(serviceName string, serviceNode *YAMLNode, filePath string) *Node {
// Generate unique ID with line number (YAML doesn't provide column, default to 1)
// For YAML, we don't have exact line numbers from the parser, so we use a hash
// Format: "compose:<file>:<service>"
Expand All @@ -177,13 +177,13 @@ func convertComposeServiceToNode(serviceName string, serviceNode *YAMLNode, file

// Extract service properties and store in MethodArgumentsValue
// This allows DSL rules to query service configuration
node.MethodArgumentsValue = extractComposeServiceProperties(serviceName, serviceNode, composeGraph)
node.MethodArgumentsValue = extractComposeServiceProperties(serviceNode)

return node
}

// extractComposeServiceProperties extracts properties from a docker-compose service.
func extractComposeServiceProperties(serviceName string, serviceNode *YAMLNode, composeGraph *ComposeGraph) []string {
func extractComposeServiceProperties(serviceNode *YAMLNode) []string {
props := []string{}

// Extract common security-relevant properties
Expand Down
Loading
Loading