-
Notifications
You must be signed in to change notification settings - Fork 69
Penetration testing of JWT #549
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
Conversation
Signed-off-by: JirkaAichler <jiri.aichler@broadcom.com>
Signed-off-by: Pavel Jareš <pavel.jares@broadcom.com>
integration-tests/src/test/java/org/zowe/apiml/penetration/JwtPenTest.java
Outdated
Show resolved
Hide resolved
integration-tests/src/test/java/org/zowe/apiml/penetration/JwtPenTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am glad to see these tests and the fact that they have passed too! It will help us to keep Zowe secure in the future!
|
Do you think parametrizing tests would make them even more readable? I've done it for some other tests where I am testing the same thing, just with the different endpoints. I can't approve since I created PR. |
|
Signed-off-by: JirkaAichler <jiri.aichler@broadcom.com>
Signed-off-by: Pavel Jareš <pavel.jares@broadcom.com>
Codecov Report
@@ Coverage Diff @@
## master #549 +/- ##
==========================================
+ Coverage 77.77% 78.05% +0.27%
==========================================
Files 315 311 -4
Lines 6151 6010 -141
Branches 737 724 -13
==========================================
- Hits 4784 4691 -93
+ Misses 1176 1128 -48
Partials 191 191
Continue to review full report at Codecov.
|
|
Kudos, SonarCloud Quality Gate passed!
|
|
What happens when I sent my own token for my service in Authorization bearer header? I suppose it will be rejected by Gateway. However, I think Gateway should not modify other tokens ... |
It is a good question. It is not fully working (also before this PR). Of course, the main case is to use SSO, but if you use the header bearer of a service, it is validated as APIML(z/OSMF) token. There is only one workaround. Cookie has a higher priority that Authorization header, so in this case is necessary to login to APIML (although it is not required for a service), save token into the APIML cookie and then use header authorization for service. It means, each request will contains both authorization (cookies for APIML, header authorization for a service) |
That is true, the gateway should not modify tokens unless the service wants it (provides metadata that is using Zowe JWT or PassTickets). Otherwise, the gateway should not process authorization headers. |
Based on the following article:
https://medium.com/101-writeups/hacking-json-web-token-jwt-233fe6c862e6