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

Update security best practices document #100814

Merged
merged 11 commits into from
Jun 16, 2021

Conversation

jportner
Copy link
Contributor

@jportner jportner commented May 27, 2021

I've reformatted the "Security best practices" page (security.asciidoc), adding references and additional info on attacks and Kibana's built-in security controls.

best_practices.mdx was derived from this; I will update it accordingly when the review is complete and the content is agreed upon.

Docs preview link

I've reformatted the document, adding references and additional info on
attacks and Kibana's built-in security controls.
TODO: update `best_practices.mdx` accordingly.
@jportner jportner added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes docs v7.14.0 labels May 27, 2021
@jportner jportner marked this pull request as ready for review May 27, 2021 18:55
@jportner jportner requested review from kobelb, stacey-gammon and a team and removed request for kobelb May 27, 2021 18:55
Copy link
Contributor Author

@jportner jportner left a comment

Choose a reason for hiding this comment

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

Self-review. I structured this so each section has the following information:

  • Reference to authoritative information and additional resources, wherever possible
  • A short description of the attack
  • A short description on Kibana's platform-wide defenses, if applicable
  • Best practices that developers should follow

In addition to the comments below, a couple of high-level thoughts:

  • I debated adding a section on Denial of Service. We have one other section on generic threats (Information Disclosure). DoS is typically introduced by third-party dependencies though, not by developers directly.
  • I debated adding a section on authorization. We have a separate Security development page that describes RBAC and authorization. Would it be useful to add a section here with a blurb that developers should make sure users are authorized, and a link to the aforementioned page?

Comment on lines +4 to +5
Application Security Project (OWASP) references to learn more about these types of attacks.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about including a section on threats here at the top (such as this), but it felt like that might be a bit too much info for our audience, who are mostly not security experts.

docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
* Allowing users to input markdown is a common culprit. If using a non-EUI markdown renderer, use a custom link renderer for rendered links.

=== Information Disclosure ===
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Everything else here is a class of attacks, but Information Disclosure is a generic threat. I opted to leave this here as I think it's a good concern for folks to keep top-of-mind.

Copy link
Contributor

@kobelb kobelb left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on @jportner, your improvements are much appreciated.

docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
@stacey-gammon
Copy link
Contributor

stacey-gammon commented May 27, 2021

I defer to Brandon's LGTM. Thanks for doing this Joe, and for reviewing Brandon!

(just don't forget to fill back the mdx file before merging)

docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
Co-authored-by: Thomas Watson <w@tson.dk>
Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

This is great, thanks for making these changes, Joe!

I debated adding a section on authorization. We have a separate Security development page that describes RBAC and authorization. Would it be useful to add a section here with a blurb that developers should make sure users are authorized, and a link to the aforementioned page?

I think this would be worthwhile, but I also think the Security development page could use a rewrite. I think it could benefit from a restructuring so that we can provide actionable "do this"/"don't do this" for our solution teams, rather than describing "how the sausage is made". I think the existing content is still valuable, but it's not very actionable in urs current form.

All that to say: perhaps we can add a link to the "new" Security development page once we take the time to write it?

@jportner jportner requested a review from a team June 1, 2021 13:23
Copy link
Member

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

Looks great, Joe! Left just a few very minor remarks.

docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
Copy link
Contributor

@streamich streamich left a comment

Choose a reason for hiding this comment

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

LGTM. I've made Risk Matrix to link to this doc.

docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
docs/developer/best-practices/security.asciidoc Outdated Show resolved Hide resolved
=== Remote Code Execution (RCE) ===

https://owasp.org/www-community/attacks/Command_Injection[_OWASP reference for Command Injection_],
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see the text "RCE" is the linked pages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah this one is a bit confusing. Colloquially we lump "Command injection" and "Code injection" together, referring to these types of attacks as "RCE". But OWASP doesn't have an RCE page.

I tried to imply this equivalency below where I stated:

RCE is a class of attacks where an attacker executes malicious code or commands on a vulnerable server.

Do you think there's a better / more clear way I could word this?

@jportner
Copy link
Contributor Author

OK, I think I addressed everyone's feedback!

I'll leave this open for another few days and if nobody else has anything to add, I'll update the MDX file to match and merge 😄

@jportner jportner enabled auto-merge (squash) June 16, 2021 18:20
@jportner jportner added the auto-backport Deprecated - use backport:version if exact versions are needed label Jun 16, 2021
@spalger
Copy link
Contributor

spalger commented Jun 16, 2021

jenkins, test this

(restarting due to jenkins upgrade)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

@jportner jportner merged commit d4cc686 into elastic:master Jun 16, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 16, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jun 17, 2021
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 17, 2021
…egrations-to-global-search

* 'master' of github.com:elastic/kibana: (46 commits)
  [Lens] Add some more documentation for dynamic coloring (elastic#101369)
  hide not searchable results when no term (elastic#102401)
  [Lens] Fix Formula functional test with multiple suggestions (elastic#102378)
  Fix trusted apps modified by field displayed as a date field (elastic#102377)
  [Lens] Docs for time shift (elastic#102048)
  update readme of logs-metrics-ui (elastic#101968)
  Refactor observability plugin breadcrumbs (elastic#102290)
  [Index Patterns] Move rollup config to index pattern management v2 (elastic#102285)
  [Security Solution][Endpoint] Isolate Action should only be available to Platinum+ licenses (elastic#102374)
  [build] Updates Ironbank templates (elastic#102407)
  Update security best practices document (elastic#100814)
  [Enterprise Search] Set up initial KibanaPageTemplate  (elastic#102170)
  [Reporting/Docs] Add section to troubleshooting guide to explain the StatusCodeError logs (elastic#102278)
  [DOCS] Updating Elastic Security Overview topic  (elastic#101922)
  [Uptime] refactor Synthetics Integration package UI (elastic#102080)
  [Task Manager] Log at different levels based on the state (elastic#101751)
  [APM] Fixing time comparison types (elastic#101423)
  [RAC] Update alert documents in lifecycle rule type helper (elastic#101598)
  [ML] Functional tests - fix and re-activate alerting flyout test (elastic#102368)
  [Reporting] remove unused reference to path.data config (elastic#102267)
  ...

# Conflicts:
#	x-pack/plugins/fleet/kibana.json
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Jun 18, 2021
@jportner jportner deleted the update-security-best-practices branch January 19, 2022 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed docs release_note:skip Skip the PR/issue when compiling release notes v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants