cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaanHoogland <...@git.apache.org>
Subject [GitHub] cloudstack pull request #2046: CLOUDSTACK-7958: Add configuration for limit ...
Date Fri, 14 Apr 2017 12:41:52 GMT
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/2046#discussion_r111568888
  
    --- Diff: server/src/com/cloud/api/ApiServlet.java ---
    @@ -290,6 +292,17 @@ void processRequestInContext(final HttpServletRequest req, final
HttpServletResp
                     CallContext.register(accountMgr.getSystemUser(), accountMgr.getSystemAccount());
                 }
     
    +            if (CallContext.current().getCallingAccount().getType() == Account.ACCOUNT_TYPE_ADMIN)
{
    +                s_logger.debug("CIDRs from which Admin accounts are allowed to perform
API calls " + adminCidrs);
    +                if (!NetUtils.isIpInCidrList(InetAddress.getByName(remoteAddress), adminCidrs.split(",")))
{
    +                    auditTrailSb.append(" " + HttpServletResponse.SC_UNAUTHORIZED + "
" + "IP-Address of remote not in configured Admin CIDR list");
    +                    final String serializedResponse =
    +                            apiServer.getSerializedApiError(HttpServletResponse.SC_UNAUTHORIZED,
"IP-Address of remote not in configured Admin CIDR list",
    +                                    params, responseType);
    +                    HttpUtils.writeHttpResponse(resp, serializedResponse, HttpServletResponse.SC_UNAUTHORIZED,
responseType, apiServer.getJSONContentType());
    --- End diff --
    
    this you do want to log on every attempt (WARN or INFO???)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message