-
Notifications
You must be signed in to change notification settings - Fork 223
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
[#1099] adjusting new logic and configuration for security #1104
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,15 +54,12 @@ public boolean isAllowed(AuthRequestExtractor extractor) throws Exception { | |
|
||
private boolean checkDeny(String serviceName, AuthRequestExtractor extractor) { | ||
if (securityPolicyProperties.matchDeny(serviceName, extractor.uri(), extractor.method())) { | ||
// both permissive and enforcing model need print logs(send alarm info). | ||
LOGGER.info("[autoauthz unauthorized request] consumer={}, provider={}, path={}, method={}, timestamp={}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logging level should be WARN if denied in permissive There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change "unauthorized request" to "[autoauthz] request denied. consumer={} ....." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use security team context |
||
serviceName, securityPolicyProperties.getProvider(), extractor.uri(), extractor.method(), | ||
System.currentTimeMillis()); | ||
// permissive mode, black policy match allow passing | ||
if ("permissive".equals(securityPolicyProperties.getMode())) { | ||
LOGGER.info("[autoauthz unauthorized request] consumer={}, provider={}, path={}, method={}, timestamp={}", | ||
serviceName, securityPolicyProperties.getProvider(), extractor.uri(), extractor.method(), | ||
System.currentTimeMillis()); | ||
return false; | ||
} else { | ||
return true; | ||
} | ||
return !"permissive".equals(securityPolicyProperties.getMode()); | ||
} else { | ||
return false; | ||
} | ||
|
@@ -72,15 +69,12 @@ private boolean checkAllowAndDeny(String serviceName, AuthRequestExtractor extra | |
if (securityPolicyProperties.matchAllow(serviceName, extractor.uri(), extractor.method())) { | ||
return !checkDeny(serviceName, extractor); | ||
} else { | ||
// both permissive and enforcing model need print logs(send alarm info). | ||
LOGGER.info("[autoauthz unauthorized request] consumer={}, provider={}, path={}, method={}, timestamp={}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above. Logging level shoud be WARN and message should be "request denied ...." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
serviceName, securityPolicyProperties.getProvider(), extractor.uri(), extractor.method(), | ||
System.currentTimeMillis()); | ||
// permissive mode, white policy not match allow passing | ||
if ("permissive".equals(securityPolicyProperties.getMode())) { | ||
LOGGER.info("[autoauthz unauthorized request] consumer={}, provider={}, path={}, method={}, timestamp={}", | ||
serviceName, securityPolicyProperties.getProvider(), extractor.uri(), extractor.method(), | ||
System.currentTimeMillis()); | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
return "permissive".equals(securityPolicyProperties.getMode()); | ||
} | ||
} | ||
|
||
|
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.
Don't fallback to X-Auth-Token, throws error here directly.
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.
microservice call microservice is X-Auth-Token, no affected with header token.