Repository navigation
[P2] feat(security): Implement Suspicion Counter #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6e2d2ee
25c87ab
ce8dbec
e734f13
c278297
b0ed88e
b696914
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,7 @@ jobs: | |
| run: | | ||
| if [ -f go.work ]; then | ||
| echo "Building with go.work..." | ||
| go build ./... | ||
| go build all | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Using Useful? React with 👍 / 👎. |
||
| else | ||
| echo "Building individual modules..." | ||
| modules=( | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,8 @@ jobs: | |||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||
| steps: | ||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||
| with: | ||||||||||||||||
| lfs: true | ||||||||||||||||
|
Comment on lines
13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set Per the zizmor 🛡️ Proposed fix - uses: actions/checkout@v4
with:
lfs: true
+ persist-credentials: false📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[warning] 13-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 13-13: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| - name: Set up Go | ||||||||||||||||
| uses: actions/setup-go@v4 | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| package physics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // KalmanFilter implements a simple 1D Kalman filter for anomaly detection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type KalmanFilter struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q float64 // process noise covariance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| R float64 // measurement noise covariance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| P float64 // estimation error covariance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| X float64 // value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| K float64 // kalman gain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func NewKalmanFilter(q, r, p, initialValue float64) *KalmanFilter { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return &KalmanFilter{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Q: q, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| R: r, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| P: p, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| X: initialValue, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func (kf *KalmanFilter) Update(measurement float64) float64 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Prediction update | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // X = X | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // P = P + Q | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kf.P = kf.P + kf.Q | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Measurement update | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // K = P / (P + R) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kf.K = kf.P / (kf.P + kf.R) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // X = X + K * (measurement - X) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kf.X = kf.X + kf.K*(measurement-kf.X) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // P = (1 - K) * P | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kf.P = (1 - kf.K) * kf.P | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return kf.X | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard against division-by-zero / non-finite gain.
🛡️ Proposed guard func (kf *KalmanFilter) Update(measurement float64) float64 {
// Prediction update
// X = X
// P = P + Q
kf.P = kf.P + kf.Q
// Measurement update
- // K = P / (P + R)
- kf.K = kf.P / (kf.P + kf.R)
+ // K = P / (P + R)
+ denom := kf.P + kf.R
+ if denom <= 0 {
+ // Degenerate covariance; skip measurement update to avoid NaN/Inf.
+ return kf.X
+ }
+ kf.K = kf.P / denom
// X = X + K * (measurement - X)
kf.X = kf.X + kf.K*(measurement-kf.X)
// P = (1 - K) * P
kf.P = (1 - kf.K) * kf.P
return kf.X
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| module phoenix/agents/internal/security | ||
|
|
||
| go 1.25.0 | ||
|
|
||
| replace phoenix/security => ../../../07_security | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The local replacement path in Useful? React with 👍 / 👎. |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||||||||||||||||||
| package security | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import "sync" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| // ReputationManager tracks the trustworthiness of nodes in the swarm. | ||||||||||||||||||||||||||||
| type ReputationManager struct { | ||||||||||||||||||||||||||||
| mu sync.RWMutex | ||||||||||||||||||||||||||||
| Reputation map[string]float64 | ||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Expose the map only via methods to avoid unsynchronized access Because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Useful? React with 👍 / 👎. |
||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+7
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exported Line 8 exposes mutable shared state, so callers can write Suggested refactor type ReputationManager struct {
- mu sync.RWMutex
- Reputation map[string]float64
+ mu sync.RWMutex
+ reputation map[string]float64
}
func NewReputationManager() *ReputationManager {
return &ReputationManager{
- Reputation: make(map[string]float64),
+ reputation: make(map[string]float64),
}
}
func (rm *ReputationManager) Deduct(nodeID string, amount float64) {
rm.mu.Lock()
defer rm.mu.Unlock()
- rm.Reputation[nodeID] -= amount
+ rm.reputation[nodeID] -= amount
}
func (rm *ReputationManager) GetScore(nodeID string) float64 {
rm.mu.RLock()
defer rm.mu.RUnlock()
- return rm.Reputation[nodeID]
+ return rm.reputation[nodeID]
}Also applies to: 19-23 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| // NewReputationManager initializes with default scores. | ||||||||||||||||||||||||||||
| func NewReputationManager() *ReputationManager { | ||||||||||||||||||||||||||||
| return &ReputationManager{ | ||||||||||||||||||||||||||||
| Reputation: make(map[string]float64), | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| // Deduct reduces a node's reputation score for suspicious behavior. | ||||||||||||||||||||||||||||
| func (rm *ReputationManager) Deduct(nodeID string, amount float64) { | ||||||||||||||||||||||||||||
| rm.mu.Lock() | ||||||||||||||||||||||||||||
| defer rm.mu.Unlock() | ||||||||||||||||||||||||||||
| rm.Reputation[nodeID] -= amount | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reputation actions are not recorded in Phoenix Ledger. Line 22 mutates reputation with no evidence record or hash-chain update, so this misses the required audit trail. As per coding guidelines, 🤖 Prompt for AI AgentsReject negative deduction amounts. At Line 22, passing a negative Suggested fix func (rm *ReputationManager) Deduct(nodeID string, amount float64) {
+ if amount < 0 {
+ return // or panic/error depending on your error model
+ }
rm.mu.Lock()
defer rm.mu.Unlock()
rm.Reputation[nodeID] -= amount
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| // GetScore returns the current reputation of a node. | ||||||||||||||||||||||||||||
| func (rm *ReputationManager) GetScore(nodeID string) float64 { | ||||||||||||||||||||||||||||
| rm.mu.RLock() | ||||||||||||||||||||||||||||
| defer rm.mu.RUnlock() | ||||||||||||||||||||||||||||
| return rm.Reputation[nodeID] | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package security | ||
|
|
||
| import "testing" | ||
|
|
||
| func TestReputationDeduction(t *testing.T) { | ||
| rm := NewReputationManager() | ||
| rm.Reputation["node-1"] = 1.0 | ||
|
|
||
| rm.Deduct("node-1", 0.2) | ||
| score := rm.GetScore("node-1") | ||
| if score != 0.8 { | ||
| t.Errorf("Expected 0.8, got %f", score) | ||
| } | ||
|
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use tolerant float comparison in the assertion. Line 11 uses exact float equality, which is brittle for decimal arithmetic. Suggested fix import "testing"
+import "math"
@@
- if score != 0.8 {
+ if math.Abs(score-0.8) > 1e-9 {
t.Errorf("Expected 0.8, got %f", score)
}🤖 Prompt for AI Agents |
||
| } | ||
|
Comment on lines
+5
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required adversarial validation is missing from tests. This test only checks a single happy-path deduction. Issue 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import subprocess | ||
| import time | ||
|
|
||
| issues = [ | ||
| ("[LABS] [L0] Implement Foundations Labs", "Implement labs 00-08 defined in 01_research/stage_00_foundations/labs/phase_00_implementation_labs.md.\n\nTasks:\n- Lab 00: Number systems\n- Lab 01: Memory model\n- Lab 02: Sequential data structures\n- Lab 08: Problem-solving", "enhancement,needs-triage"), | ||
| ("[LABS] [L0] Implement Architecture Labs", "Implement labs defined in 01_research/stage_00_foundations/labs/phase_01_architecture_labs.md.\n\nTasks:\n- Assembly calling convention\n- Cache locality benchmark\n- False sharing analysis", "enhancement,needs-triage"), | ||
| ("[LABS] [L0] Implement Programming Labs", "Implement labs defined in 01_research/stage_00_foundations/labs/phase_02_low_level_programming_labs.md.\n\nTasks:\n- Heap allocator\n- ELF parser\n- Mini shell", "enhancement,needs-triage"), | ||
| ("[LABS] [L1] Implement OS Internals Labs", "Implement labs defined in 01_research/stage_01_system_internals/labs/phase_03_operating_systems_labs.md.\n\nTasks:\n- Process lifecycle\n- Scheduler\n- VFS", "enhancement,needs-triage"), | ||
| ("[LABS] [L2] Implement Linux Internals Labs", "Implement labs defined in 01_research/stage_02_linux_and_distros/labs/phase_04_linux_internals_labs.md.\n\nTasks:\n- Kernel build\n- Kernel module\n- Namespaces/cgroups", "enhancement,needs-triage"), | ||
| ("[LABS] [L3] Implement Networking Labs", "Implement labs defined in 01_research/stage_03_networking/labs/phase_05_networking_labs.md.\n\nTasks:\n- OSI/Encapsulation\n- DNS\n- TCP\n- Packet dissection", "enhancement,needs-triage"), | ||
| ("[SURFACE] Refactor Orchestrator State Handling", "The file agents/surface/orchestrator/service.py contains TODOs related to label management ('surface:todo').\n\nTasks:\n- Refactor state-to-label mapping.\n- Replace hardcoded TODO labels.", "bug,needs-triage"), | ||
| ("[L0] Foundations: Establish Problem-solving Lab Set", "Per 01_research/stage_00_foundations/labs/phase_00_implementation_labs.md, the Problem-solving lab (Lab 08) needs definition.\n\nTasks:\n- Define the lab requirements for the problem-solving set.", "research,needs-triage"), | ||
| ("[L1] Architecture: Document NUMA Topology Reasoning", "Document topology and locality rationale for PhoenixOS (01_research/stage_00_foundations/labs/phase_01_architecture_labs.md).", "documentation,needs-triage"), | ||
| ("[L1] Low-Level Programming: Formalize Rust Syscall Wrapper", "Design safe syscall abstraction layer for Rust (01_research/stage_00_foundations/labs/phase_02_low_level_programming_labs.md).", "enhancement,needs-triage"), | ||
| ("[L2] OS Internals: Modify xv6 for PhoenixOS", "Plan modifications for syscalls, scheduler, and file operations in xv6 (01_research/stage_01_system_internals/labs/phase_03_operating_systems_labs.md).", "research,needs-triage"), | ||
| ("[L3] Networking: Implement Packet Dissection Parser", "Implement hex parsing for raw packets (01_research/stage_03_networking/labs/phase_05_networking_labs.md).", "enhancement,needs-triage"), | ||
| ("[SURFACE] Orchestrator: Update Label Management", "Update labels from 'surface:todo' to canonical triage labels in agents/surface/orchestrator/service.py.", "bug,needs-triage"), | ||
| ("[LABS] [L2] cgroups: Investigate v1 vs v2 differences", "Analyze differences between cgroup v1 and v2 (01_research/stage_02_linux_and_distros/labs/phase_04_linux_internals_labs.md).", "research,needs-triage"), | ||
| ("[LABS] [L3] Networking: Security Analysis of DNS Exfiltration", "Perform security analysis on plaintext DNS vs. DoH (01_research/stage_03_networking/labs/phase_05_networking_labs.md).", "security,needs-triage") | ||
| ] | ||
|
|
||
| for title, body, label in issues: | ||
| cmd = [ | ||
| "gh", "issue", "create", | ||
| "--title", title, | ||
| "--body", body + "\n\n> *This was generated by AI during triage.*", | ||
| "--label", label | ||
| ] | ||
| try: | ||
| subprocess.run(cmd, check=True) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. security (python.lang.security.audit.dangerous-subprocess-use-audit): Detected subprocess function 'run' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'. Source: opengrep |
||
| print(f"Created: {title}") | ||
| time.sleep(1) | ||
| except Exception as e: | ||
| print(f"Failed: {title} - {e}") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import subprocess | ||
| import time | ||
|
|
||
| issues = [ | ||
| {"title": "[RESEARCH] [L6] Dynamics: State-Space Trajectory Drift", "body": "Investigate embedding state-space analysis in 06_ai/dynamics to detect trajectory drift (R025).", "label": "enhancement,needs-triage"}, | ||
| {"title": "[INTELLIGENCE] [L5.5] Arbiter: VCG Mechanism Design", "body": "Design and implement VCG mechanisms for game-theoretic resource allocation (R030).", "label": "enhancement,needs-triage"}, | ||
| {"title": "[INTELLIGENCE] [L5.5] Arbiter: Strong Stackelberg Equilibrium", "body": "Implement efficient SSE calculation for defender/attacker game dynamics (R028).", "label": "enhancement,needs-triage"}, | ||
| {"title": "[TESTING] GraphAgent: Validate DAG Scaling Limit", "body": "Stress test 09_telemetry/process_graphs with >100k nodes to validate 3-tier storage performance.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[L1] Guard Runtime: eBPF Syscall Filtering Enhancement", "body": "Enhance eBPF filters in 10_kernel/guard to detect complex multi-syscall attack patterns.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[L3] Telemetry: Optimize Event Serialization", "body": "Benchmark and optimize JSON serialization in 09_telemetry/pipelines for 200k events/sec.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[DOCS] Theory: Document Game-Theoretic Policy Stability", "body": "Create formal documentation for action debt and cooldown timers in the Game Theory layer.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[INTEGRATION] Arbiter: Reputation-Weighted Quorum Implementation", "body": "Integrate reputation scores from P2P nodes into the Byzantine-Resistant consensus mechanism.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[TOOLS] Reverse Engineering: YARA Rule Automation", "body": "Automate YARA rule deployment to the security distribution layer (07_security/yara).", "label": "enhancement,needs-triage"}, | ||
| {"title": "[L2] Kernel Scheduler: Prototype Game-Aware Scheduling", "body": "Prototype a kernel-level scheduler policy that prioritizes processes based on Arbiter importance scores.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[L3] Physics: Validate Thermal Inertia Smoothing", "body": "Verify the 0.7 thermal inertia smoothing constant against highly volatile attack workloads (R024).", "label": "enhancement,needs-triage"}, | ||
| {"title": "[L3] Telemetry: Implement Wavelet-based Noise Reduction", "body": "Implement wavelet transform filters in 09_telemetry/math_filters for telemetry pre-processing.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[L6] Forensics: Implement Automated Hash Chain Auditing", "body": "Create automated audit tool that validates the hash-chain integrity of all Forensic snapshots in 08_forensics.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[INTEGRATION] Infrastructure: Formalize Observability Pipeline", "body": "Formalize the pipeline between 12_infrastructure/observability and 09_telemetry/telemetry_agent.", "label": "enhancement,needs-triage"}, | ||
| {"title": "[L0] Foundations: Implement Bit Manipulation Lab", "body": "Implement Lab 00 (Number systems and bit operations) from 01_research/stage_00_foundations/labs/phase_00_implementation_labs.md.", "label": "enhancement,needs-triage"} | ||
| ] | ||
|
|
||
| for issue in issues: | ||
| body_content = issue["body"] + "\n\n> *This was generated by AI during triage.*" | ||
| cmd = [ | ||
| "gh", "issue", "create", | ||
| "--title", issue["title"], | ||
| "--body", body_content, | ||
| "--label", issue["label"] | ||
| ] | ||
| try: | ||
| subprocess.run(cmd, check=True) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. security (python.lang.security.audit.dangerous-subprocess-use-audit): Detected subprocess function 'run' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'. Source: opengrep |
||
| print(f"Created: {issue['title']}") | ||
| time.sleep(1) | ||
| except Exception as e: | ||
| print(f"Failed: {issue['title']} - {e}") | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In Go workspace mode (go.work), what doesgo build allbuild compared togo build ./...?💡 Result:
In Go workspace mode (go.work),
go build allbuilds the package pattern named by the import-path patternall(not “all packages”). If you have no package import path matchingall(which is usually the case), it will fail with “no packages to build”. By contrast,go build ./...builds every package under the current directory (recursively), i.e., it expands the./...package pattern to all matching packages and compiles them (and their dependencies). So, they are not equivalent:./...is a recursive filesystem-based package pattern, whileallis just a literal package-pattern token; workspace mode (go.work) affects how the module set is selected for the build, but it does not makeallbecome “all packages”. [1][2][3]Citations:
🏁 Script executed:
Repository: fallofpheonix/PheonixOS
Length of output: 497
🏁 Script executed:
Repository: fallofpheonix/PheonixOS
Length of output: 2446
🏁 Script executed:
Repository: fallofpheonix/PheonixOS
Length of output: 780
Fix Go workspace build command in CI (
go build all)In the
go.workbranch of.github/workflows/lint_build_docs.yml,go build allbuilds the package pattern namedall(not “all packages”). This repo doesn’t contain a module/package matchingall, so the workflow won’t build the intended set of workspace packages. Usego build ./...instead.🔧 Proposed fix
if [ -f go.work ]; then echo "Building with go.work..." - go build all + go build ./... else🤖 Prompt for AI Agents