豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Restrict AD entity risk panel rendering to host/user flyouts only#4

Open
Copilot wants to merge 2 commits intomainfrom
copilot/update-risk-panels-visibility
Open

Restrict AD entity risk panel rendering to host/user flyouts only#4
Copilot wants to merge 2 commits intomainfrom
copilot/update-risk-panels-visibility

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 18, 2026

Risk panels were being shown for all AD entity flyouts, including non-risk-eligible types. This updates attack discovery flyout rendering so risk UI appears only for hosts and users, and remains hidden for other AD entity types.

  • UI logic: scope risk panel visibility by AD entity type

    • Updated EntityFlyout in src/views/attack-discovery/App.tsx to render the risk block only when state.type is host or user.
    • Non-host/user flyouts no longer render the risk panel or unscored fallback panel.
  • Risk lookup correctness

    • Tightened risk selection to match on both type and name (instead of name-only), preventing cross-type risk mismatches when identifiers overlap.
  • Behavioral impact

    • Hosts/users: unchanged risk panel behavior (scored or unscored state).
    • Other entity types (e.g., process/file): no risk panel rendered.
const showRiskPanel = state.type === "host" || state.type === "user";
const risk = detail?.entityRisk?.find(
  (er) => er.type === state.type && er.name === state.value
);

{showRiskPanel && (
  risk && risk.level.toLowerCase() !== "unknown"
    ? <RiskPanel ... />
    : <UnscoredRiskPanel ... />
)}
Original prompt

Currently, the app displays risk panels for all Active Directory (AD) elements, but the desired behavior is to show risk panels only for hosts and users. Please update the relevant UI logic/components so that risk panels are rendered exclusively for these two AD element types (hosts and users), and hidden for all others. Ensure test coverage is updated if needed and describe the change in the PR body.

References:

  • Slack context indicates this was surfaced by multiple users and is considered a needed UI correctness improvement.

Acceptance criteria:

  • Only hosts and users in AD have risk panels rendered
  • No risk panel is shown for other AD element types
  • Tests updated (if applicable)

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Update risk panels to show only for hosts and users Restrict AD entity risk panel rendering to host/user flyouts only Apr 18, 2026
Copilot AI requested a review from opauloh April 18, 2026 01:03
@opauloh opauloh marked this pull request as ready for review April 18, 2026 01:19
Copy link
Copy Markdown
Collaborator

@opauloh opauloh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

KDKHD pushed a commit that referenced this pull request Apr 20, 2026
Add support for MCPB packaging and distribution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants