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

A client user requires access to ICSF when calling ZSS endpoints #597

Open
JirkaAichler opened this issue May 5, 2023 · 14 comments
Open
Assignees
Labels
bug Something isn't working new not yet triaged

Comments

@JirkaAichler
Copy link

JirkaAichler commented May 5, 2023

Describe the bug
When a client calls ZSS REST APIs the SSL connection is established under the server user. Then the context is switched to the client user (impersonification) and the native APIs are called under the client user. ZSS does not switch back to the server user when sending the HTTP response. It leads to the following error when the client user has no access to ICSF:

socketWrite: tlsWrite failed with status: 456 (ICSF callable service returned an IO error while writing, errno=0 reason=0                                        
                Aborting...  

This permission should not be required from a client user. ZSS should switch back to the server user before sending the response.

Client-side will not receive any response and the connection is never closed.

@JirkaAichler JirkaAichler added bug Something isn't working new not yet triaged labels May 5, 2023
@JoeNemo
Copy link
Contributor

JoeNemo commented May 10, 2023

This sounds reproducible. Can we get a simple CURL/POSTMAN-like example to drive this?

@JoeNemo
Copy link
Contributor

JoeNemo commented May 10, 2023

Zowe may have to require all users to have access to run ICSF code, too.

@JirkaAichler
Copy link
Author

I can send HTTPie format :-)

http post https://system.net:7557/certificate/dn "Cookie:%token%" dn=test_1 registry=oidc.com

It was reproduced only with ACF2. Not saying it couldn't happen under other ESMs. My other testing environments could just be less restrictive.

@JirkaAichler
Copy link
Author

Zowe may have to require all users to have access to run ICSF code, too.

We should stay as close to requirements on z/OS (IRR.IDIDMAP.QUERY) to follow the least privilege access principle. Giving every client access to ICSF can be misused,

By the way, I still was not able to figure out what exact ICSF permission I need.

@JirkaAichler
Copy link
Author

JirkaAichler commented May 19, 2023

The required permission is class CSFSERV and resource CSF1SKE. This is PKCS #11 Secret key encrypt. We definitely should not require this access from a client user.

@Joe-Winchester
Copy link
Member

Adding in comments from Onno on slack (to stop them being lost when they page out from the slack workspace).

The provider mentioned earlier java.protocol.handler.pkgs=com.ibm.crypto.hdwrCCA.provider, seems to be J11 or so, as when we wrote it up for J8, it was security.provider.1=com.ibm.crypto.hdwrCCA.provider.IBMJCECCA`
(in /usr/lpp/java/J8.0/lib/security/java.security)
the JCECCARACFKS type stays the same.
some gotcha's I know off

  • ICSF checks profiles in the CSFKEYS and CSFSERV classes
    with ICSF in play, security checks are at thread level, so if you switch security context for a thread, the thread userid needs the permit
  • if I recall correctly, system SSL (GSK*) does not require anything special for ICSF usage (the user still needs the CSF* permits though)

@jthyssenrocket
Copy link

My recommendation is to turn AUDIT on the CSFSERV class, start Zowe, logon with a regular user, and launch various apps.
Collect the audit data and summarize.

I've done this exercise for IBM Unified Management Server running under Zowe, but I am unsure how many apply to a plain vanilla Zowe.
My findings were:

Zowe STC (I run launcher, ZIS, and ZIS AUX under the same STC userid)

            READ on CSFSERV CSF1TRC
            READ on CSFSERV CSF1SKE
            READ on CSFSERV CSF1SKD
            READ on CSFSERV CSFDSG
            READ on CSFSERV CSFIQA
            READ on CSFSERV CSFRNG

End user
READ on on CSFSERV CSF1SKE

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, but can be reopened if needed. Thank you for your contributions.

@github-actions github-actions bot added the stale-reopen-if-needed An issue closed due to inactivity. No indication of completion or validity. label Feb 26, 2024
@JirkaAichler
Copy link
Author

Do not close. A client should not need READ on CSFSERV CSF1SKE. It would be a security problem.

@github-actions github-actions bot removed the stale-reopen-if-needed An issue closed due to inactivity. No indication of completion or validity. label Feb 27, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, but can be reopened if needed. Thank you for your contributions.

@github-actions github-actions bot added the stale-reopen-if-needed An issue closed due to inactivity. No indication of completion or validity. label Aug 25, 2024
@JoeNemo
Copy link
Contributor

JoeNemo commented Aug 28, 2024

As far as I know there is no project/PR to make this additional requirement on the security config. Can we close? Is this a dead issue now?

@github-actions github-actions bot removed the stale-reopen-if-needed An issue closed due to inactivity. No indication of completion or validity. label Aug 28, 2024
@JirkaAichler
Copy link
Author

I still consider it a security risk that clients require access to a private key that should be available only to a server user.

Feel free to do anything with this issue based on your best judgment.

@jthyssenrocket
Copy link

I agree, it is a security exposure and it should be fixed (rather sooner than later).

@JoeNemo
Copy link
Contributor

JoeNemo commented Sep 4, 2024

Point taken. This still is a bug.

@JoeNemo JoeNemo self-assigned this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants