Skip to content
Notifications
Clear all

Show me your policy: How you configure exclusions for developer machines.

7 Posts
7 Users
0 Reactions
0 Views
(@alexg)
Reputable Member
Joined: 3 weeks ago
Posts: 243
Topic starter   [#22915]

We've been running Carbon Black for nearly three years, primarily on developer and build infrastructure, and the single most critical—and contentious—configuration element remains the exclusions policy. A poorly defined policy leads to a flood of false positives, developer productivity nosedives, and security loses credibility. An overly permissive policy renders the tool useless.

Our approach is rooted in the principle of least privilege, but with a pragmatic layer for developer velocity. We segment exclusions into distinct categories, each with a clear justification and review process. The goal is to protect against real threats without interfering with legitimate development workflows.

**Core Exclusion Categories:**

* **Toolchain & Build Processes:** This is the largest category. We exclude specific directories and processes for known, trusted tools.
* Example: Paths for Docker, Podman, Kubernetes (minikube, kind), CI/CD runners (Jenkins, GitLab Runner, GitHub Actions runner), and language-specific package managers (npm, pip, Maven, Go caches).
* Key: We exclude by hash *and* path where possible, not just path. A compromised npm binary in `/usr/local/bin` should still be caught.

* **IDE and Debugger Activity:** This is non-negotiable for developer sanity. Attempting to monitor or restrict `dlv`, `gdb`, `node-inspect`, or the memory spaces of JetBrains IDEs or VS Code is a losing battle and generates immense noise.
* We have explicit process and memory space exclusions for these tools, documented with a security review ticket that acknowledges the accepted risk.

* **Temporary and Cache Directories:** System-wide temporary directories (`/tmp`, `C:WindowsTemp`) are obvious, but we also explicitly exclude user-level cache directories for browsers, IDEs, and package managers. The volume of transient, executable code here is immense and not a high-value signal for us.

**Our Policy Structure (Ansible Excerpt):**

We manage exclusions as code, versioned in Git. Here's a simplified fragment of our Ansible template that builds the JSON for the Carbon Black Cloud API.

```json
{
"exclusions": [
{
"description": "Go toolchain and module cache",
"path": "/home/*/go/pkg/mod/**",
"process_path": "/usr/local/go/bin/**"
},
{
"description": "Docker and container runtime",
"path": "/var/lib/docker/overlay2/**",
"process_path": "/usr/bin/docker",
"include_children": false
},
{
"description": "VS Code and integrated terminals",
"process_path": "/usr/bin/code",
"memory_exclusion": true,
"risk_reason": "Developer productivity tool, debuggers require memory access."
}
]
}
```

**The Pitfalls We've Encountered:**

* **Excluding entire mount points (e.g., `/home`)** was proposed for simplicity. We rejected it as it creates a massive blind spot. We drill down to specific subdirectories instead.
* **Over-reliance on path-based exclusions** without hash consideration is a vulnerability. We supplement with hash-based exclusions for critical, static tooling.
* **Lack of a review cycle.** Every quarter, we audit the exclusion list: usage metrics, incident reports where an exclusion was involved, and new tools added to the environment. Stale exclusions are pruned.

I'm particularly interested in how others balance security and utility for developer workstations. How do you handle the rise of ephemeral, containerized local dev environments (e.g., DevContainers, `tools` containers)? Do you treat them differently from the host? What's your process for vetting and approving a new exclusion request?

-- alex



   
Quote
(@carlosm)
Reputable Member
Joined: 3 weeks ago
Posts: 143
 

Totally agree on the category-based approach. Your point about hashing for toolchain binaries is crucial. We learned the hard way when a locally installed, compromised version of a common build tool got flagged only because we had a hash on file for the official distribution.

One thing we added to our "Toolchain & Build Processes" exclusions is a mandatory metadata tag for each entry noting the last review date. It forces a quarterly check-in to ask, "Do we still use this version? Is this path still valid?" It's a lightweight process that prevents exclusion list rot.


Keep automating!


   
ReplyQuote
(@data_analyst_2025)
Reputable Member
Joined: 3 months ago
Posts: 166
 

Love the idea of tagging entries with a last review date! That's a smart way to tackle decay. We're starting with something similar, but we're also trying to link each exclusion back to a specific project or service ticket in our internal system.

That way, when the quarterly review comes up, we can check if the project is still active. If it's been archived, we can flag that exclusion for immediate removal instead of just wondering if the path is still valid.

Do you find that the quarterly check-in is frequent enough? We were worried about toolchain churn being faster than that, but maybe it's a good balance between being thorough and not creating too much overhead.



   
ReplyQuote
(@georgep)
Estimable Member
Joined: 2 weeks ago
Posts: 95
 

You're already starting off wrong by saying you exclude by hash *and* path for tools like npm. That's a false sense of security. What about the pip or npm cache directories where arbitrary, user-downloaded code executes? Your hash-based exclusion on the binary is useless if you're blindly allowing everything that runs from `~/.npm/_cacache` or `~/.cache/pip`. That's where the real post-compromise payload lives, not the package manager binary itself.

You need to separate the tool's trusted installer from its untrusted, dynamic execution environment. Excluding the whole path is a massive blind spot.


— geo


   
ReplyQuote
(@crusty_pipeline)
Reputable Member
Joined: 3 months ago
Posts: 206
 

Finally, someone who's actually looked at where the payloads execute. You're absolutely right about the cache directories being the real blind spot. The hash exclusion for the npm binary is just security theater if you're letting arbitrary code from ~/.npm/_cacache/ run without a second look.

We had to split this. The installer/launcher binary gets the hash exclusion, but the cache directories don't get a blanket path exclusion. Instead, we treat them as untrusted source locations. Anything spawned from there gets the full behavioral scrutiny - child process creation, network calls, the works. It adds a bit of overhead, but it caught a cryptominer once that was hiding in a corrupted package.

The real problem is developers who want to exclude the entire user home directory "for convenience." That's when you know you've lost.



   
ReplyQuote
(@data_skeptic_ray)
Reputable Member
Joined: 4 months ago
Posts: 193
 

Exactly. The behavioral scrutiny on cache directories is the key move. But you're measuring "overhead" in terms of alert volume. What about the performance tax on the dev machine when every npm script spawn gets a full inspection? I've seen teams revert to blanket exclusions not because of false positives, but because a 30% increase in build time made their CI pipeline economically unviable.

So you caught a cryptominer once. Good. How many dev hours were lost collectively waiting for scans on the ten thousand benign executions that happened before and after it? That's the calculus nobody wants to publish.


Data skeptic, not a data cynic.


   
ReplyQuote
(@charlie2)
Estimable Member
Joined: 2 weeks ago
Posts: 125
 

That's a great idea to add a review date tag. We've been struggling with stale entries too.

Do you have an automated way to flag entries that haven't been reviewed, or is it a manual spreadsheet check? I'm trying to see how we could add this to our Jira-based process without creating extra tickets.



   
ReplyQuote