From d1df2c31c5552503ab6179f9f2223b41ec0052b5 Mon Sep 17 00:00:00 2001 From: taylanbakircioglu Date: Sun, 29 Mar 2026 21:41:41 +0300 Subject: [PATCH] chore: sanitize internal references in code examples and documentation Made-with: Cursor --- api/openapi-spec.yaml | 2 +- backend/database/neo4j.py | 2 +- backend/routers/communications.py | 2 +- backend/routers/simulation.py | 4 ++-- deployment/manual-rbac/README.md | 2 +- deployment/manual-rbac/flowfish-cluster-rbac.yaml | 6 +++--- frontend/src/pages/IntegrationHub.tsx | 4 ++-- frontend/src/pages/Map.tsx | 6 +++--- pipelines/scripts/prepare-manifests.sh | 2 +- scripts/fix-gadget-rbac.sh | 2 +- scripts/fix-gadget-storage.sh | 6 +++--- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/api/openapi-spec.yaml b/api/openapi-spec.yaml index e4a29e5..e25bacc 100644 --- a/api/openapi-spec.yaml +++ b/api/openapi-spec.yaml @@ -1263,7 +1263,7 @@ paths: type: string - name: annotation_key in: query - description: "Annotation key to match. Supports * wildcard (e.g. example.com/*)" + description: "Annotation key to match. Supports * wildcard (e.g. mycompany.com/*)" schema: type: string - name: annotation_value diff --git a/backend/database/neo4j.py b/backend/database/neo4j.py index 092f0e8..c5c70d0 100644 --- a/backend/database/neo4j.py +++ b/backend/database/neo4j.py @@ -823,7 +823,7 @@ class Neo4jService: both nodes and edges by matching the VID prefix. VID Format: {analysis_id}:{cluster_id}:{namespace}:{workload} - Example: "26:1:prod-payments:payments-pod-xyz" + Example: "26:1:prod-cardapi:cardapi-pod-xyz" Deletion is done by: 1. Matching all nodes where n.id STARTS WITH '{analysis_id}:' diff --git a/backend/routers/communications.py b/backend/routers/communications.py index bd16a08..4d515fc 100644 --- a/backend/routers/communications.py +++ b/backend/routers/communications.py @@ -1360,7 +1360,7 @@ async def find_pod_dependencies( owner_name: Optional[str] = Query(None, description="Deployment/StatefulSet/DaemonSet name to search"), label_key: Optional[str] = Query(None, description="Label key to match"), label_value: Optional[str] = Query(None, description="Label value to match"), - annotation_key: Optional[str] = Query(None, description="Annotation key to match (supports * wildcard, e.g. example.com/*)"), + annotation_key: Optional[str] = Query(None, description="Annotation key to match (supports * wildcard, e.g. mycompany.com/*)"), annotation_value: Optional[str] = Query(None, description="Annotation value to match (supports * wildcard: * for any, prefix* for startsWith)"), ip: Optional[str] = Query(None, description="Pod IP to search"), depth: int = Query(1, ge=1, le=5, description="Traversal depth"), diff --git a/backend/routers/simulation.py b/backend/routers/simulation.py index 3ee760b..dff9261 100644 --- a/backend/routers/simulation.py +++ b/backend/routers/simulation.py @@ -344,7 +344,7 @@ def classify_endpoint_kind(name: str, namespace: str, original_kind: str) -> str Returns: - "Pod" for actual Kubernetes pods (e.g., backend-7686dccc6b-x8bqm) - "Service" for Kubernetes services - - "ExternalIP" for external IP addresses (10.x.x.x, 192.168.x.x) + - "ExternalIP" for external IP addresses (10.180.x.x, 192.168.x.x) - "ClusterIP" for cluster-internal IPs (10.128.x.x, 10.129.x.x, 10.130.x.x, 10.131.x.x) - "ExternalDNS" for external DNS names (*.bank, api.*, etc.) - "ClusterService" for internal cluster services (*.svc.cluster.local) @@ -607,7 +607,7 @@ def deduplicate_services(services: list) -> list: """Extract the base service name for deduplication""" import re - # Handle DNS-style names like 10-128-22-163.harbor-core.prod-registry.svc.cluster.local + # Handle DNS-style names like 10-128-22-163.harbor-core.prod-harbor-ha.svc.cluster.local if '.svc.cluster.local' in name: parts = name.split('.') if len(parts) >= 2: diff --git a/deployment/manual-rbac/README.md b/deployment/manual-rbac/README.md index 9e8a079..c108e96 100644 --- a/deployment/manual-rbac/README.md +++ b/deployment/manual-rbac/README.md @@ -23,7 +23,7 @@ Bu dizindeki RBAC kaynakları **cluster admin** tarafından manuel olarak uygula NS=flowfish # Tüm RBAC'ı uygula -cat <<'EOF' | sed "s/flowfish/$NS/g" | oc apply -f - +cat <<'EOF' | sed "s/namespace: flowfish/namespace: $NS/g" | oc apply -f - # ============================================ # 1. Inspektor Gadget ClusterRole # ============================================ diff --git a/deployment/manual-rbac/flowfish-cluster-rbac.yaml b/deployment/manual-rbac/flowfish-cluster-rbac.yaml index 7c71696..49a77ed 100644 --- a/deployment/manual-rbac/flowfish-cluster-rbac.yaml +++ b/deployment/manual-rbac/flowfish-cluster-rbac.yaml @@ -1,10 +1,10 @@ # Flowfish Cluster RBAC -# Cross-namespace permissions required for kubectl-gadget +# kubectl-gadget için gerekli cross-namespace izinler # -# Usage: +# Uygulama: # oc apply -f flowfish-cluster-rbac.yaml # -# Replace NAMESPACE with your target namespace +# NAMESPACE değişkenini kendi namespace'inizle değiştirin --- apiVersion: rbac.authorization.k8s.io/v1 diff --git a/frontend/src/pages/IntegrationHub.tsx b/frontend/src/pages/IntegrationHub.tsx index 3f32e8d..bca9dfd 100644 --- a/frontend/src/pages/IntegrationHub.tsx +++ b/frontend/src/pages/IntegrationHub.tsx @@ -484,9 +484,9 @@ const IntegrationHub: React.FC = () => { - + diff --git a/frontend/src/pages/Map.tsx b/frontend/src/pages/Map.tsx index 87a58e0..c8c3b86 100644 --- a/frontend/src/pages/Map.tsx +++ b/frontend/src/pages/Map.tsx @@ -455,7 +455,7 @@ const isInternalTraffic = (node: DependencyNode): boolean => { const isDomainName = (name: string): boolean => { if (!name) return false; // Domain pattern: contains dot, has letters, doesn't start/end with dot - // Examples: amazon.com, api.azure.com, srv-prod-01.company.local + // Examples: amazon.com, api.azure.com, mail01.company.local const domainPattern = /^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)+$/; // Must have at least one letter (to distinguish from IP) const hasLetter = /[a-zA-Z]/.test(name); @@ -463,7 +463,7 @@ const isDomainName = (name: string): boolean => { }; // Check if name is a server hostname (datacenter server, not domain) -// Examples: srv-prod-01, build-server-02, db-server-01 +// Examples: srv-prod-01, web-staging-02, db-server-01 const isServerHostname = (name: string): boolean => { if (!name) return false; // Server hostname patterns: @@ -578,7 +578,7 @@ const isPublicEndpoint = (node: DependencyNode): boolean => { // 2. CRITICAL: If IP is PRIVATE, this CANNOT be a public endpoint! // Trust IP classification over domain name - private IP = internal network - // Example: name="api.example.local", ip="10.194.30.5" → NOT PUBLIC (private IP!) + // Example: name="api.internal.local", ip="10.194.30.5" → NOT PUBLIC (private IP!) // This prevents .bank gTLD domains with private IPs from being classified as public if (ip && isPrivateIP(ip)) return false; diff --git a/pipelines/scripts/prepare-manifests.sh b/pipelines/scripts/prepare-manifests.sh index 723e32f..e3249d4 100755 --- a/pipelines/scripts/prepare-manifests.sh +++ b/pipelines/scripts/prepare-manifests.sh @@ -36,7 +36,7 @@ for manifest in *.yaml; do sed -i -e "s|env-flowfish|${DEPLOYMENT_ENV}-flowfish|g" $manifest # Company placeholders - sed -i -e "s|company\.example\.com|${COMPANY_DOMAIN}|g" $manifest + sed -i -e "s|company\.com\.tr|${COMPANY_NAME}.com.tr|g" $manifest # Database hosts sed -i -e "s|{{POSTGRES_HOST}}|${POSTGRES_HOST}|g" $manifest diff --git a/scripts/fix-gadget-rbac.sh b/scripts/fix-gadget-rbac.sh index 81437cc..d30e451 100755 --- a/scripts/fix-gadget-rbac.sh +++ b/scripts/fix-gadget-rbac.sh @@ -27,7 +27,7 @@ # - cluster-admin privileges (for ClusterRole modification) # # Examples: -# ./fix-gadget-rbac.sh staging-flowfish +# ./fix-gadget-rbac.sh bmprod-flowfish # ./fix-gadget-rbac.sh flowfish # diff --git a/scripts/fix-gadget-storage.sh b/scripts/fix-gadget-storage.sh index 8c98eda..05e6003 100755 --- a/scripts/fix-gadget-storage.sh +++ b/scripts/fix-gadget-storage.sh @@ -23,9 +23,9 @@ # - cluster-admin privileges (for DaemonSet modification) # # Examples: -# ./fix-gadget-storage.sh prod-flowfish # emptyDir (default) -# ./fix-gadget-storage.sh prod-flowfish standard-rwo # PVC with StorageClass -# ./fix-gadget-storage.sh staging-flowfish standard # PVC with StorageClass +# ./fix-gadget-storage.sh prod-flowfish # emptyDir (default) +# ./fix-gadget-storage.sh prod-flowfish ibm02-csi-rwo # PVC with StorageClass +# ./fix-gadget-storage.sh bmprod-flowfish standard # PVC with StorageClass # set -e