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] Improve plain text password handling in code #4930

Closed
sssd-bot opened this issue May 2, 2020 · 3 comments
Closed

[Security] Improve plain text password handling in code #4930

sssd-bot opened this issue May 2, 2020 · 3 comments
Assignees
Labels
Closed: Fixed Issue was closed as fixed. Future milestone

Comments

@sssd-bot
Copy link

sssd-bot commented May 2, 2020

Cloned from Pagure issue: https://pagure.io/SSSD/sssd/issue/3956


This is about:
https://labs.portcullis.co.uk/blog/an-offensive-introduction-to-active-directory-on-unix/

After some discussions i think we can make this better my using the following:

  1. Use PR_SET_DUMPABLE for pages which have passwords etc, to ensure
    that coredumps dont contain cleartext passwords.

  2. Use SGX when available
    https://en.wikipedia.org/wiki/Software_Guard_Extensions

  3. Lastly and more importantly fedora has explicit_bzero which you
    should use rather manually scrub memory. Please see
    https://www.gnu.org/software/libc/manual/html_node/Erasing-Sensitive-Data.html
    This is not optimized by the compiler.

Comments


Comment from atikhonov at 2019-11-19 15:24:22

Metadata Update from @atikhonov:

  • Issue assigned to atikhonov

Comment from atikhonov at 2019-11-28 22:41:28

PR #948 partially addresses item (3)


Comment from pbrezina at 2019-11-29 11:23:38

Commit 0a6fdec5 relates to this ticket


Comment from pbrezina at 2019-11-29 11:23:38

Commit 109c21ef relates to this ticket


Comment from pbrezina at 2019-11-29 11:23:39

Commit ad1ae003 relates to this ticket


Comment from pbrezina at 2019-11-29 11:23:39

Commit 275e062b relates to this ticket


Comment from pbrezina at 2019-11-29 11:23:40

Commit 0165ef11 relates to this ticket


Comment from pbrezina at 2019-11-29 11:23:40

Commit f2245b53 relates to this ticket


Comment from pbrezina at 2019-11-29 11:27:20

  • master
    • 0a6fdec - LDAP: proper handling of master password
    • 109c21e - util/authtok: set destructor in sss_authtok_new()
    • ad1ae00 - db/sysdb_ops: proper zeroization of sensitive data
    • 275e062 - util/sha512_crypt_r: proper zeroization of sensitive data
    • 1f667ea - util/sha512_crypt_r: removed misleading comments
    • 78127ea - util/sha512_crypt_r: got rid of redundant mem align
    • be7f731 - util: fixed potential mem leak in s3crypt_gen_salt()
    • 0165ef1 - tools/sss_seed: proper zeroization of sensitive data
    • f2245b5 - util/memory: helper(s) to securely erase mem was reworked
    • b72c4fa - util/memory: sanitization

Comment from pbrezina at 2020-03-13 14:48:10

Alexey, did the patches fix this ticket? If yes, please close it.


Comment from pbrezina at 2020-03-13 14:48:11

Metadata Update from @pbrezina:

  • Issue tagged with: Future milestone

Comment from atikhonov at 2020-03-13 15:34:45

Alexey, did the patches fix this ticket?

No. Only item (3) is partially addressed. Another question if we want (1) and (2) to be done.

@alexey-tikhonov
Copy link
Member

Use SGX when available

"A pivot by Intel in 2021 resulted in the deprecation of SGX from the 11th and 12th generation Intel Core Processors, but development continues on Intel Xeon for cloud and enterprise use."

Feature is difficult to use. Taking into account limited set of platform that has hw support, benefits are very questionable.

@alexey-tikhonov
Copy link
Member

1. Use PR_SET_DUMPABLE for pages which have passwords etc, to ensure
   that coredumps dont contain cleartext passwords.

I don't find a way to set PR_SET_DUMPABLE on a per page basis. Only for entire process.
Having coredumps disabled unconditionally would be impractical, as it would make debugging very difficult.
But perhaps we can have such a hardening option.

alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue May 26, 2022
:config: New option 'core_dumpable' to manage 'PR_SET_DUMPABLE' flag of sssd_pam
and sssd_be processes. Enabled by default.

Resolves: SSSD#4930
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue May 27, 2022
:config: New option 'core_dumpable' to manage 'PR_SET_DUMPABLE' flag of sssd_pam
and sssd_be processes. Enabled by default.

Resolves: SSSD#4930
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue May 27, 2022
:config: New option 'core_dumpable' to manage 'PR_SET_DUMPABLE' flag of sssd_pam
and sssd_be processes. Enabled by default.

Resolves: SSSD#4930
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Jun 16, 2022
:config: New option 'core_dumpable' to manage 'PR_SET_DUMPABLE' flag of sssd_pam
and sssd_be processes. Enabled by default.

Resolves: SSSD#4930
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Jun 21, 2022
:config: New option 'core_dumpable' to manage 'PR_SET_DUMPABLE' flag of SSSD
processes. Enabled by default.

Resolves: SSSD#4930
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Jun 22, 2022
:config: New option 'core_dumpable' to manage 'PR_SET_DUMPABLE' flag of SSSD
processes. Enabled by default.

Resolves: SSSD#4930
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Jun 29, 2022
:config: New option 'core_dumpable' to manage 'PR_SET_DUMPABLE' flag of SSSD
processes. Enabled by default.

Resolves: SSSD#4930
@alexey-tikhonov
Copy link
Member

Pushed PR: #6184

  • master
    • 94352a9 - New option for system hardening.

@alexey-tikhonov alexey-tikhonov added the Closed: Fixed Issue was closed as fixed. label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed: Fixed Issue was closed as fixed. Future milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants