mcpField
C
control-objective-management

control-objective-management

github.com/happy-technologies-llc安全4141 次安装2 天前更新
代码仓库

关于 control-objective-management

这是用于管理 ServiceNow GRC 合规控制目标的技能,涵盖创建、法规映射、有效性评估和缺口整改,面向使用 SOX、GDPR、HIPAA 等框架的合规与审计团队。

主要功能

  1. 01创建和更新控制目标
  2. 02将目标映射到法规引用
  3. 03依据测试和证据评估控制
  4. 04识别控制覆盖缺口
  5. 05生成有效性报告和整改任务

适用场景

  1. 01建立或修订合规控制框架
  2. 02开展控制有效性测试周期
  3. 03将控制映射到变化中的法规
  4. 04准备监管审计

MCP 相关

说明如何使用 ServiceNow MCP 工具查询、创建和更新控制目标、控制、法规引用及合规任务,并执行缺口分析。

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/happy-technologies-llc/happy-platform-skills --skill control-objective-management

安装后在 Claude Code 中输入/control-objective-management确认已加载。

详细介绍

控制目标管理

概述

此技能可全面管理 ServiceNow GRC 中的合规控制目标,涵盖:

  • 根据法规背景创建和更新控制目标
  • 通过测试和证据审查评估控制有效性
  • 将控制目标映射到 SOX、GDPR、HIPAA 及其他法规要求
  • 识别缺少充分控制或测试的控制目标所存在的控制缺口
  • 分析各配置文件、策略和引文中的控制覆盖情况
  • 生成控制有效性报告,供审计和合规审查使用

适用场景:

  • 建立或更新用于法规合规的控制框架时
  • 开展控制有效性评估和测试周期期间
  • 将控制映射到新增或变更的法规要求时
  • 识别业务流程中的控制覆盖缺口时
  • 为 SOX、GDPR、HIPAA 或其他法规审计做准备时
  • 开展年度控制合理化和优化工作期间

先决条件

  • 角色: sn_compliance.manager、sn_grc.manager 或 admin
  • 插件: com.sn_compliance、com.sn_grc
  • 访问权限: 对 sn_compliance_control_objective、sn_compliance_control、sn_compliance_policy、sn_compliance_citation 表具有读写权限
  • 知识: 了解合规框架(SOX、GDPR、HIPAA)和控制设计原则

关键合规表

表用途关键字段
sn_compliance_control_objective控制目标number, short_description, description, state, owner, policy, framework, effectiveness
sn_compliance_control落实控制目标的控制措施number, short_description, state, control_objective, owner, effectiveness, test_result, test_date, profile
sn_compliance_policy合规策略number, short_description, state, owner, policy_statement, effective_date
sn_compliance_citation法规引文number, short_description, reference, regulation, authority, citation_text
sn_compliance_task合规任务number, short_description, state, assigned_to, due_date, control
sn_grc_profileGRC 实体配置文件number, short_description, profile_type, applies_to

流程

步骤 1:检索现有控制目标

查询当前控制目标,了解基线框架。

使用 MCP(Claude Code/Desktop):

Tool: SN-Query-Table
Parameters:
  table_name: sn_compliance_control_objective
  query: active=true^ORDERBYnumber
  fields: sys_id,number,short_description,description,state,owner,policy,framework,effectiveness,sys_created_on,sys_updated_on
  limit: 100

使用 REST API:

GET /api/now/table/sn_compliance_control_objective?sysparm_query=active=true^ORDERBYnumber&sysparm_fields=sys_id,number,short_description,description,state,owner,policy,framework,effectiveness&sysparm_limit=100
步骤 2:创建新的控制目标

使用 MCP:

Tool: SN-Create-Record
Parameters:
  table_name: sn_compliance_control_objective
  fields:
    short_description: "Ensure access to personal data is restricted to authorized personnel"
    description: "Control objective to verify that access controls are in place to restrict personal data access per GDPR Article 25 and Article 32 requirements. Includes role-based access, least privilege enforcement, and periodic access reviews."
    owner: [owner_sys_id]
    policy: [policy_sys_id]
    state: draft
    framework: GDPR

使用 REST API:

POST /api/now/table/sn_compliance_control_objective
Content-Type: application/json

{
  "short_description": "Ensure access to personal data is restricted to authorized personnel",
  "description": "Control objective to verify access controls per GDPR Article 25 and 32.",
  "owner": "[owner_sys_id]",
  "policy": "[policy_sys_id]",
  "state": "draft",
  "framework": "GDPR"
}
步骤 3:将控制目标映射到法规引文

查询现有引文以进行映射:

Tool: SN-Query-Table
Parameters:
  table_name: sn_compliance_citation
  query: active=true^regulationLIKEGDPR
  fields: sys_id,number,short_description,reference,regulation,authority,citation_text
  limit: 50

将目标映射到 SOX 引文:

Tool: SN-Query-Table
Parameters:
  table_name: sn_compliance_citation
  query: active=true^regulationLIKESOX^ORregulationLIKESarbanes
  fields: sys_id,number,short_description,reference,regulation,authority
  limit: 50

将目标映射到 HIPAA 引文:

Tool: SN-Query-Table
Parameters:
  table_name: sn_compliance_citation
  query: active=true^regulationLIKEHIPAA
  fields: sys_id,number,short_description,reference,regulation,authority
  limit: 50
步骤 4:评估控制有效性

查询特定目标的控制措施及其测试结果:

Tool: SN-Query-Table
Parameters:
  table_name: sn_compliance_control
  query: control_objective=[objective_sys_id]^active=true
  fields: sys_id,number,short_description,state,effectiveness,test_result,test_date,owner,profile
  limit: 50

生成所有目标的有效性评估:

Tool: SN-Execute-Background-Script
Parameters:
  script: |
    var assessment = {
      generated_date: new GlideDateTime().toString(),
      total_objectives: 0,
      effectiveness_summary: { effective: 0, partially_effective: 0, ineffective: 0, not_tested: 0 },
      by_framework: {},
      objectives_detail: []
    };

    var obj = new GlideRecord('sn_compliance_control_objective');
    obj.addQuery('active', true);
    obj.query();

    while (obj.next()) {
      assessment.total_objectives++;

      var framework = obj.framework.getDisplayValue() || 'General';
      if (!assessment.by_framework[framework]) {
        assessment.by_framework[framework] = { total: 0, effective: 0, gaps: 0 };
      }
      assessment.by_framework[framework].total++;

      // Query controls for this objective
      var ctrl = new GlideRecord('sn_compliance_control');
      ctrl.addQuery('control_objective', obj.sys_id.toString());
      ctrl.addQuery('active', true);
      ctrl.query();

      var totalControls = 0, passingControls = 0, failingControls = 0, untestedControls = 0;
      while (ctrl.next()) {
        totalControls++;
        var testResult = ctrl.test_result.getDisplayValue().toLowerCase();
        var state = ctrl.state.getDisplayValue().toLowerCase();

        if (testResult === 'pass' || state === 'compliant') passingControls++;
        else if (testResult === 'fail' || state === 'non-compliant') failingControls++;
        else untestedControls++;
      }

      // Determine effectiveness
      var effectiveness = 'Not Tested';
      if (totalControls === 0) {
        effectiveness = 'No Controls';
      } else if (failingControls === 0 && untestedControls === 0) {
        effectiveness = 'Effective';
        assessment.effectiveness_summary.effective++;
        assessment.by_framework[framework].effective++;
      } else if (failingControls === 0 && passingControls > 0) {
        effectiveness = 'Partially Effective';
        assessment.effectiveness_summary.partially_effective++;
      } else if (failingControls > 0) {
        effectiveness = 'Ineffective';
        assessment.effectiveness_summary.ineffective++;
        assessment.by_framework[framework].gaps++;
      } else {
        assessment.effectiveness_summary.not_tested++;
      }

      assessment.objectives_detail.push({
        number: obj.number.toString(),
        title: obj.short_description.toString(),
        framework: framework,
        total_controls: totalControls,
        passing: passingControls,
        failing: failingControls,
        untested: untestedControls,
        effectiveness: effectiveness
      });
    }

    gs.info('CONTROL EFFECTIVENESS ASSESSMENT:\n' + JSON.stringify(assessment, null, 2));
  description: "GRC: Assess control effectiveness across all objectives"
步骤 5:识别控制缺口

查找控制覆盖不足的目标:

Tool: SN-Execute-Background-Script
Parameters:
  script: |
    var gaps = [];

    var obj = new GlideRecord('sn_compliance_control_objective');
    obj.addQuery('active', true);
    obj.query();

    while (obj.next()) {
      var ctrl = new GlideAggregate('sn_compliance_control');
      ctrl.addQuery('control_objective', obj.sys_id.toString());
      ctrl.addQuery('active', true);
      ctrl.addAggregate('COUNT');
      ctrl.query();

      var controlCount = 0;
      if (ctrl.next()) controlCount = parseInt(ctrl.getAggregate('COUNT'));

      // Gap: No controls or all controls failing
      if (controlCount === 0) {
        gaps.push({
          type: 'NO_CONTROLS',
          objective_number: obj.number.toString(),
          objective_title: obj.short_description.toString(),
          framework: obj.framework.getDisplayValue() || 'General',
          owner: obj.owner.getDisplayValue(),
          severity: 'CRITICAL',
          recommendation: 'Design and implement controls to address this objective'
        });
      } else {
        // Check for all-failing scenario
        var failCtrl = new GlideAggregate('sn_compliance_control');
        failCtrl.addQuery('control_objective', obj.sys_id.toString());
        failCtrl.addQuery('active', true);
        failCtrl.addQuery('state', 'NOT IN', 'compliant,passed');
        failCtrl.addAggregate('COUNT');
        failCtrl.query();

        var failCount = 0;
        if (failCtrl.next()) failCount = parseInt(failCtrl.getAggregate('COUNT'));

        if (failCount === controlCount) {
          gaps.push({
            type: 'ALL_CONTROLS_FAILING',
            objective_number: obj.number.toString(),
            objective_title: obj.short_description.toString(),
            framework: obj.framework.getDisplayValue() || 'General',
            total_controls: controlCount,
            failing_controls: failCount,
            severity: 'HIGH',
            recommendation: 'All controls ineffective; redesign control approach or add compensating controls'
          });
        }

        // Check for stale testing (no test in last 180 days)
        var staleCtrl = new GlideRecord('sn_compliance_control');
        staleCtrl.addQuery('control_objective', obj.sys_id.toString());
        staleCtrl.addQuery('active', true);
        staleCtrl.addQuery('test_date', '<', gs.daysAgo(180));
        staleCtrl.query();
        var staleCount = staleCtrl.getRowCount();

        if (staleCount > 0) {
          gaps.push({
            type: 'STALE_TESTING',
            objective_number: obj.number.toString(),
            objective_title: obj.short_description.toString(),
            framework: obj.framework.getDisplayValue() || 'General',
            stale_controls: staleCount,
            severity: 'MEDIUM',
            recommendation: 'Schedule control re-testing; ' + staleCount + ' controls not tested in 180+ days'
          });
        }
      }
    }

    gaps.sort(function(a, b) {
      var sevOrder = { CRITICAL: 0, HIGH: 1, MEDIUM: 2, LOW: 3 };
      return (sevOrder[a.severity] || 3) - (sevOrder[b.severity] || 3);
    });

    gs.info('CONTROL GAPS IDENTIFIED: ' + gaps.length + '\n' + JSON.stringify(gaps, null, 2));
  description: "GRC: Identify control gaps across all objectives"
步骤 6:根据评估结果更新控制目标

使用 MCP:

Tool: SN-Update-Record
Parameters:
  table_name: sn_compliance_control_objective
  sys_id: [objective_sys_id]
  fields:
    effectiveness: effective
    work_notes: |
      === CONTROL EFFECTIVENESS ASSESSMENT ===
      Assessment Date: 2026-03-19
      Total Controls: 5
      Passing: 4 (80%)
      Failing: 0
      Untested: 1
      Overall Effectiveness: Effective

      Regulatory Mapping: SOX Section 404, GDPR Article 32
      Next Review: 2026-06-19
    state: reviewed

使用 REST API:

PATCH /api/now/table/sn_compliance_control_objective/[sys_id]
Content-Type: application/json

{
  "effectiveness": "effective",
  "work_notes": "Control effectiveness assessment completed. 4/5 controls passing.",
  "state": "reviewed"
}
步骤 7:创建合规任务以修复缺口

使用 MCP:

Tool: SN-Create-Record
Parameters:
  table_name: sn_compliance_task
  fields:
    short_description: "Design controls for unaddressed control objective CO0001456"
    description: "Control objective CO0001456 has no implementing controls. Design and implement at least one preventive and one detective control. Map to GDPR Article 32 requirements for data processing security."
    assigned_to: [control_owner_sys_id]
    due_date: 2026-05-01
    priority: 2
    state: 1

使用 REST API:

POST /api/now/table/sn_compliance_task
Content-Type: application/json

{
  "short_description": "Design controls for unaddressed control objective CO0001456",
  "description": "No implementing controls exist. Design preventive and detective controls.",
  "assigned_to": "[owner_sys_id]",
  "due_date": "2026-05-01",
  "priority": "2",
  "state": "1"
}

法规框架背景

SOX(《萨班斯-奥克斯利法案》)
条款控制目标重点关键字段
第 302 条CEO/CFO 对财务控制的认证披露控制、重大缺陷
第 404 条财务报告内部控制(ICFR)控制设计、运行有效性
第 409 条实时披露重大变化监控控制、事件驱动评估
GDPR(《通用数据保护条例》)
条款控制目标重点关键字段
第 25 条通过设计和默认设置实现数据保护隐私控制、数据最小化
第 30 条处理活动记录处理活动清单控制
第 32 条处理安全技术和组织措施
第 35 条数据保护影响评估DPIA 流程控制
HIPAA(《健康保险流通与责任法案》)
规则控制目标重点关键字段
164.312(a)访问控制唯一用户 ID、紧急访问、自动注销
164.312(c)完整性控制用于验证 ePHI 的机制
164.312(d)身份验证对个人或实体进行身份验证
164.312(e)传输安全加密、完整性控制

工具用法

操作MCP 工具REST 端点
查询目标SN-Query-TableGET /api/now/table/sn_compliance_control_objective
创建目标SN-Create-RecordPOST /api/now/table/sn_compliance_control_objective
更新目标SN-Update-RecordPATCH /api/now/table/sn_compliance_control_objective
查询控制SN-Query-TableGET /api/now/table/sn_compliance_control
查询引用SN-Query-TableGET /api/now/table/sn_compliance_citation
差距分析SN-Execute-Background-ScriptPOST /api/now/table/sys_trigger
架构发现SN-Discover-Table-SchemaGET /api/now/table/sys_dictionary

最佳实践

  • 框架对齐: 始终将目标映射到具体的法规条款或章节,而不仅仅是框架名称
  • 控制分层: 每个目标都应同时具备预防性和侦测性控制,以实现纵深防御
  • 测试频率: 根据风险确定测试频率——关键控制每季度测试,标准控制每年测试
  • 差距优先级排序: 根据监管风险和业务影响确定差距优先级,而不仅仅看数量
  • 责任模型: 同时指定控制目标负责人(战略层面)和控制负责人(运营层面)
  • 证据标准: 在测试开始前,为每项控制定义可接受的证据类型
  • 跨框架映射: 识别满足多个框架要求的控制,以减少重复工作

故障排除

找不到控制目标表

症状: 查询 sn_compliance_control_objective 时返回找不到表的错误 原因: Compliance 插件可能尚未激活,也可能使用了不同的表名 解决方案:

Tool: SN-Discover-Table-Schema
Parameters:
  table_name: sn_compliance_control_objective

如果未找到,请检查是否存在 sn_compliance_objective 或 sn_grc_control_objective 等替代表。确认 com.sn_compliance 插件处于启用状态。

无法使用框架字段

症状: 控制目标记录中不存在 framework 字段 原因: 框架跟踪可能使用指向单独框架表的引用字段,或使用自定义字段 解决方案: 检查架构中是否存在 regulation、compliance_framework 等字段,或指向 sn_compliance_citation 的引用。也可使用类别或策略引用作为替代分组机制。

缺少控制与目标的关联

症状: 控制已存在,但未关联到控制目标 原因: sn_compliance_control 上的 control_objective 引用字段可能未填充 解决方案: 检查控制是否通过 sn_grc_item 或多对多关系表关联。如果存在,请查询 sn_grc_m2m_control_objective_control。

示例

示例 1:SOX 404 控制目标评估

场景: 为年度 SOX 审计做准备,需要评估 ICFR 控制目标

Tool: SN-Query-Table
Parameters:
  table_name: sn_compliance_control_objective
  query: 123TEXTQUERY321=SOX Section 404 internal control financial reporting
  limit: 30

评估结果:

  • SOX 目标总数: 24
  • 有效: 18(75%)
  • 部分有效: 4(17%)——控制尚未测试,待 Q1 审查
  • 无效: 1(4%)——职责分离控制失效
  • 无控制: 1(4%)——为 IT 一般控制新增目标
  • 关键缺口: CO0002341——“财务系统的 IT 变更管理控制”没有任何实施控制
  • 需要采取的行动: 创建 2 项合规任务,在审计现场工作开始前修复缺口
示例 2:GDPR 控制覆盖分析

场景: 数据保护官需要核实 GDPR 合规的控制覆盖情况

Tool: SN-Query-Table
Parameters:
  table_name: sn_compliance_control_objective
  query: active=true^frameworkLIKEGDPR^ORdescriptionLIKEGDPR
  fields: sys_id,number,short_description,state,effectiveness,owner
  limit: 50

覆盖报告:

  • 已定义的 GDPR 目标: 15
  • 有有效控制: 12(覆盖率 80%)
  • 完全有效: 9(60%)
  • 发现的缺口:
    1. 第 17 条(删除权)——没有自动删除控制
    2. 第 20 条(数据可携权)——导出机制尚未测试
    3. 第 35 条(DPIA)——流程控制尚未实施
  • 建议: 优先处理第 17 条的缺口,因为其监管罚款风险最高

相关技能

  • grc/issue-action-plan - 修复控制失效引发的问题
  • grc/issue-summarization - 汇总与控制缺口相关的问题
  • grc/risk-assessment-summarization - 评估控制所缓解的风险
  • grc/regulatory-alert-analysis - 跟踪影响控制要求的监管变化
  • security/audit-compliance - 控制测试证据的审计跟踪

参考资料

评论

支持 Markdown