惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
F
Fortinet All Blogs
D
Docker
博客园 - 司徒正美
腾讯CDC
Recent Announcements
Recent Announcements
The Cloudflare Blog
B
Blog RSS Feed
GbyAI
GbyAI
T
Tailwind CSS Blog
雷峰网
雷峰网
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis
Datadog CoTerm: Never run the wrong terminal command again
2024-06-26 · via Datadog | The Monitor blog

For engineering teams investigating and resolving incidents together, it’s a common practice to use terminals alongside IDEs and applications like the AWS Console and Datadog. No matter how much tooling and automation a team builds, sometimes there’s just no substitute for dropping down to bash (or zsh, or fish). However, this power comes with peril—even the most careful engineers occasionally mistype commands, with serious consequences. Mistyped commands can lead to sticky situations such as programs executing in the wrong environment or infrastructure changes made without the correct approvals.

That’s why we’re excited to announce the Preview of CoTerm, Datadog’s solution for error-proof, team-powered command-line workflows. CoTerm provides real-time checks on sensitive commands directly in your terminal, enabling you to avoid missteps that can have major ramifications. You can try CoTerm today on macOS and Linux.

Check commands for safety

CoTerm can quickly and easily check for common errors in commands. Imagine you’re running kubectl to scale down a Kubernetes cluster used for development. You assume you’re in the development context and run kubectl scale. CoTerm intercepts the command, notices that you tried to run a risky operation without explicitly specifying --context, and tells you that you’re actually running the command against production:

CoTerm intercepts a kubectl scale command, prompting for --context.

CoTerm makes it easy to prevent mistakes like this, and it’s not limited to kubectl; you can write your own rules for any command.

Check commands for proper approvals

CoTerm can also be used for lightweight approval workflows, when commands are so sensitive that they need a second pair of eyes. Imagine that you are intentionally running kubectl in production because you are decommissioning a namespace that is no longer used. This is potentially dangerous—typing the wrong namespace could cause a major outage.

To avoid this, you configure CoTerm to require approval for kubectl delete or similarly sensitive operations in production. CoTerm intercepts the command, warns that it’s dangerous, and requires approval before execution:

CoTerm intercepts a kubectl delete command in order to get the required approval.

CoTerm also automatically creates an approval request in Datadog Case Management:

An approval request in Datadog Case Management.

In this scenario, kubectl delete will only run after it’s been approved by a coworker. Approvals can also be linked to incidents—command approval is a great way to lessen risk during high-stakes, time-sensitive incident remediation.

Record, browse, and replay terminal output in Datadog

CoTerm automatically records terminal output when a command is intercepted. In the previous examples, the full terminal session is browsable and replayable in Datadog. You can quickly and easily search through recordings to answer questions like, “Who ran this command in production recently?“

You can rest assured that terminal recordings won’t contain any PII or other sensitive information because CoTerm redacts sensitive data, such as keys and passwords, before sending the recordings to Datadog.

Recordings can also be useful for knowledge sharing with coworkers. Simply run ddcoterm and CoTerm will record your interactive shell session, which you or others can then watch in Datadog:

You can watch a terminal session recording in Datadog.

How CoTerm works

CoTerm shims commands by using the PATH environment variable. For example, let’s say you want to shim a dangerous command named foo. You would run ddcoterm shim create foo, which does the following:

  1. Creates a lightweight script for launching CoTerm at ~/.ddcoterm/overrides/foo.
  2. Adjusts PATH in your shell configuration so that ~/.ddcoterm/overrides/foo takes priority over the usual foo executable if necessary.

The next time you run foo, it will launch CoTerm, which quickly evaluates any user-defined rules for foo, generates warnings and approval requests if necessary, and then runs foo as usual.

CoTerm rules are Lua snippets embedded in CoTerm’s YAML configuration file, like this:

- command: "foo"

rules:

- rule: has_arg("bar")

actions: ["approval", "record", "logs", "process_info"]

This rule tells CoTerm, “If foo is intercepted with a bar argument, require approval and record it.” This would apply to someone running foo bar but not foo baz.

Shimming commands is fast, and we aim for it to be unnoticeable. If the Lua rules for a command determine that an approval and a recording aren’t necessary, CoTerm can get out of the way in single-digit milliseconds.

Try CoTerm today

CoTerm is available in Preview today. For details about installation, see our CoTerm docs. To get started even faster, follow these steps:

  1. Run brew install coterm on macOS or our install script on Linux.
  2. Run ddcoterm init to log in, create some default rules, and shim kubectl.
  3. Try running ddcoterm to record an interactive session, or kubectl test-coterm to test shimming and approvals.

If you’re new to Datadog, you can sign up for a 14-day free trial.