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

[TESTING][Detection Engine] Testing Prebuilt Security Rules Package - DO NOT MERGE #161789

Closed

Conversation

terrancedejesus
Copy link
Contributor

@terrancedejesus terrancedejesus commented Jul 12, 2023

Related Issue

Summary

This PR is used to use the Kibana CI testing for the security solution Cypress tests. This PR is NOT MEANT to be merged. Once tests are successful, this PR will be closed.

Prerelease packages:
v8.7.9-beta.1
v8.8.7-beta.1
v8.9.2-beta.1

@terrancedejesus terrancedejesus requested a review from a team as a code owner July 12, 2023 16:44
@terrancedejesus terrancedejesus added release_note:skip Skip the PR/issue when compiling release notes v8.7.0 v8.8.0 v8.9.0 test backport:skip This commit does not require backporting Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules labels Jul 12, 2023
@terrancedejesus
Copy link
Contributor Author

terrancedejesus commented Jul 12, 2023

8.7.9-beta.1 package

This package failed some UI testing, but the rules load correctly by manual testing. The package installs correctly, rules updates load correctly and there seem to be no UI issues.

It seems that the prebuilt rules package is not installing correctly in the Cypress tests: https://buildkite.com/elastic/kibana-pull-request/builds/141978#01894afe-a70f-40fa-bed0-9466c841cd19/6-4226

@spong - Do you have any additional information on why this might be happening?

I am curious if this is because new workflows exist in main, that do not exist in 8.7 where this package would be installed? Therefore when running cypress tests I need to point to the matching branch?

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jul 12, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #1 / Detection rules, Prebuilt Rules Installation and Update workflow Installation of prebuilt rules package via Fleet should install package from Fleet in the background
  • [job] [logs] Security Solution Tests #1 / Detection rules, Prebuilt Rules Installation and Update workflow Installation of prebuilt rules package via Fleet should install package from Fleet in the background
  • [job] [logs] Security Solution Tests #1 / Detection rules, Prebuilt Rules Installation and Update workflow Installation of prebuilt rules should install selected rules when user clicks on Install selected rules
  • [job] [logs] Security Solution Tests #6 / Export rules exports only custom rules
  • [job] [logs] Security Solution Tests #2 / Prebuilt rules Actions with prebuilt rules Rules table Deletes and recovers more than one rule
  • [job] [logs] Security Solution Tests #2 / Prebuilt rules Actions with prebuilt rules Rules table Deletes and recovers more than one rule
  • [job] [logs] Security Solution Tests #2 / Prebuilt rules Actions with prebuilt rules Rules table Deletes and recovers one rule
  • [job] [logs] Security Solution Tests #2 / Prebuilt rules Actions with prebuilt rules Rules table Deletes and recovers one rule

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 409 413 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 488 492 +4
total +6

History

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

@terrancedejesus
Copy link
Contributor Author

[job] [logs] Security Solution Tests #1 / Detection rules, Prebuilt Rules Installation and Update workflow Installation of prebuilt rules should install selected rules when user clicks on Install selected rules

8.9.0 stack loaded 8.9.1 package. Then force installed 8.7.9-beta.1 with rule updates. Selected rules and selected Install rule. Rules installed fine.

Screenshot 2023-07-13 at 10 10 41 AM

@terrancedejesus
Copy link
Contributor Author

terrancedejesus commented Jul 13, 2023

Security Solution Tests #6 / Export rules exports only custom rules

I believe this is expected as prebuilt rules should not be exported.

Screenshot 2023-07-13 at 10 14 04 AM

@terrancedejesus
Copy link
Contributor Author

terrancedejesus commented Jul 13, 2023

Security Solution Tests #1 / Detection rules, Prebuilt Rules Installation and Update workflow Installation of prebuilt rules package via Fleet should install package from Fleet in the background

This failure is concerning as it seems to indicate that the package is not being installed via Fleet. Test is from x-pack/plugins/security_solution/cypress/e2e/detection_rules/prebuilt_rules_install_update_workflows.cy.ts It is difficult to re-create this with a beta package as we have to force install beta packages rather than rely on Fleet to auto-pull these in.

  describe('Installation of prebuilt rules package via Fleet', () => {
    beforeEach(() => {
      cy.intercept('POST', '/api/fleet/epm/packages/_bulk*').as('installPackage');
      waitForRulesTableToBeLoaded();
    });

    it('should install package from Fleet in the background', () => {
      /* Assert that the package in installed from Fleet by checking that
      /* the installSource is "registry", as opposed to "bundle" */
      cy.wait('@installPackage', {
        timeout: 60000,
      }).then(({ response }) => {
        cy.wrap(response?.statusCode).should('eql', 200);

        const packages = response?.body.items.map(({ name, result }: BulkInstallPackageInfo) => ({
          name,
          installSource: result.installSource,
        }));

        expect(packages.length).to.have.greaterThan(0);
        expect(packages).to.deep.include.members([
          { name: 'security_detection_engine', installSource: 'registry' },
        ]);
      });
    });

@@ -55,7 +55,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
'--xpack.cloud.id=test',
`--home.disableWelcomeScreen=true`,
// Specify which version of the detection-rules package to install
// `--xpack.securitySolution.prebuiltRulesPackageVersion=8.3.1`,
`--xpack.securitySolution.prebuiltRulesPackageVersion=8.7.9-beta.1`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
`--xpack.securitySolution.prebuiltRulesPackageVersion=8.7.9-beta.1`,
`--xpack.securitySolution.prebuiltRulesPackageVersion=8.8.7-beta.1`,

@terrancedejesus
Copy link
Contributor Author

Closing, packages have all been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules release_note:skip Skip the PR/issue when compiling release notes test v8.7.0 v8.8.0 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants