Skip to content
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

[Security Solution] Prebuilt Rules Upgrade & Install Workflow Skeleton #154403

Closed

Conversation

spong
Copy link
Member

@spong spong commented Apr 4, 2023

Summary

This is a WIP PR capturing the skeletal and architectural changes of the new Prebuilt Rules Upgrade & Install workflow changes in progress for the 8.8 release.

Please see #153751 for arch design discussion.
These Figma Mocks for base designs.
And corresponding whimsical design diagram.

To easily test the Rule Upgrade flow, you can use the below devtools request to 'update' a prebuilt rule to be a higher version than what has shipped, then hit the _review endpoint to view:

Test upgrade flow dev tools request

POST kbn:/internal/detection_engine/prebuilt_rules/upgrade/_review

PUT kbn:/api/detection_engine/rules
{
  "rule_id": "2215b8bd-1759-4ffa-8ab8-55c8e6b32e7f",
  "name": "SSH Authorized Keys File Modifications",
  "tags": [
    "Elastic",
    "Host",
    "Linux",
    "macOS",
    "Threat Detection",
    "Lateral Movement",
    "Persistence"
  ],
  "interval": "5m",
  "enabled": false,
  "description": "The Secure Shell (SSH) authorized_keys file specifies which users are allowed to log into a server using public key authentication. Adversaries may modify it to maintain persistence on a victim host by adding their own public key(s).",
  "risk_score": 47,
  "severity": "medium",
  "license": "Elastic License v2",
  "output_index": "",
  "timestamp_override": "event.ingested",
  "author": [
    "Elastic"
  ],
  "false_positives": [],
  "from": "now-9m",
  "to": "now",
  "max_signals": 100,
  "risk_score_mapping": [],
  "severity_mapping": [],
  "threat": [
    {
      "framework": "MITRE ATT&CK",
      "tactic": {
        "id": "TA0003",
        "name": "Persistence",
        "reference": "https://attack.mitre.org/tactics/TA0003/"
      },
      "technique": [
        {
          "id": "T1098",
          "name": "Account Manipulation",
          "reference": "https://attack.mitre.org/techniques/T1098/",
          "subtechnique": [
            {
              "id": "T1098.004",
              "name": "SSH Authorized Keys",
              "reference": "https://attack.mitre.org/techniques/T1098/004/"
            }
          ]
        }
      ]
    },
    {
      "framework": "MITRE ATT&CK",
      "tactic": {
        "id": "TA0008",
        "name": "Lateral Movement",
        "reference": "https://attack.mitre.org/tactics/TA0008/"
      },
      "technique": [
        {
          "id": "T1563",
          "name": "Remote Service Session Hijacking",
          "reference": "https://attack.mitre.org/techniques/T1563/",
          "subtechnique": [
            {
              "id": "T1563.001",
              "name": "SSH Hijacking",
              "reference": "https://attack.mitre.org/techniques/T1563/001/"
            }
          ]
        },
        {
          "id": "T1021",
          "name": "Remote Services",
          "reference": "https://attack.mitre.org/techniques/T1021/",
          "subtechnique": [
            {
              "id": "T1021.004",
              "name": "SSH",
              "reference": "https://attack.mitre.org/techniques/T1021/004/"
            }
          ]
        }
      ]
    }
  ],
  "references": [],
  "version": 100,
  "exceptions_list": [],
  "type": "query",
  "language": "kuery",
  "index": [
    "auditbeat-*",
    "logs-endpoint.events.*"
  ],
  "query": "event.category:file and event.type:(change or creation) and\n file.name:(\"authorized_keys\" or \"authorized_keys2\" or \"/etc/ssh/sshd_config\" or \"/root/.ssh\") and\n not process.executable:\n             (/Library/Developer/CommandLineTools/usr/bin/git or\n              /usr/local/Cellar/maven/*/libexec/bin/mvn or\n              /Library/Java/JavaVirtualMachines/jdk*.jdk/Contents/Home/bin/java or\n              /usr/bin/vim or\n              /usr/local/Cellar/coreutils/*/bin/gcat or\n              /usr/bin/bsdtar or\n              /usr/bin/nautilus or\n              /usr/bin/scp or\n              /usr/bin/touch or\n              /var/lib/docker/* or\n              /usr/bin/google_guest_agent or \n              /opt/jc/bin/jumpcloud-agent)\n",
  "throttle": "no_actions",
  "actions": []
}

kibanamachine and others added 26 commits April 4, 2023 23:41
…pong/kibana into skeleton-prebuilt-rule-upgrade-install
…pong/kibana into skeleton-prebuilt-rule-upgrade-install
…pong/kibana into skeleton-prebuilt-rule-upgrade-install
@kibana-ci
Copy link
Collaborator

kibana-ci commented May 4, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #6 / helpers filterJobs returns all jobs when no filter is suplied
  • [job] [logs] Jest Tests #6 / helpers searchFilter returns correct DisplayJobs when filterQuery matches job.description
  • [job] [logs] Jest Tests #6 / helpers searchFilter returns correct DisplayJobs when filterQuery matches job.id
  • [job] [logs] Jest Tests #6 / JobsTableComponent renders correctly against snapshot
  • [job] [logs] Jest Tests #6 / JobsTableFilters renders correctly against snapshot
  • [job] [logs] Jest Tests #7 / LoadPrebuiltRulesAndTemplatesButton renders correct button with correct text - Load Elastic prebuilt rules
  • [job] [logs] Jest Tests #7 / LoadPrebuiltRulesAndTemplatesButton renders correct button with correct text - Load Elastic prebuilt rules and timeline templates
  • [job] [logs] Jest Tests #7 / LoadPrebuiltRulesAndTemplatesButton renders correct button with correct text - Load Elastic prebuilt timeline templates
  • [job] [logs] Jest Tests #12 / RulesTableContextProvider persisted state restores default rules table state
  • [job] [logs] Jest Tests #12 / RulesTableContextProvider persisted state restores persisted rules table state
  • [job] [logs] Jest Tests #12 / RulesTableContextProvider state rules returns an empty array upon error
  • [job] [logs] Jest Tests #12 / RulesTableContextProvider state rules returns an empty array while loading
  • [job] [logs] Jest Tests #12 / RulesTableContextProvider state rules returns rules after snooze settings loaded
  • [job] [logs] Jest Tests #12 / RulesTableContextProvider state rules returns rules even if snooze settings failed to be loaded
  • [job] [logs] Jest Tests #12 / RulesTableContextProvider state rules returns rules while snooze settings are not loaded yet
  • [job] [logs] Jest Tests #12 / RulesTableContextProvider state rules snooze settings returns snooze settings
  • [job] [logs] Jest Tests #6 / UtilityBar it applies border styles when border is true

Metrics [docs]

‼️ ERROR: metrics for c60ac48 were not reported

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @spong

@banderror banderror closed this Jun 19, 2023
@spong spong deleted the skeleton-prebuilt-rule-upgrade-install branch June 20, 2023 14:38
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.

4 participants