要阻止哪些 SaaS 子域

问题描述 投票:0回答:5

我正在开发 SaaS(软件即服务)网络应用程序,并且我正在为单独的帐户使用子域。

我应该阻止用户使用哪些子域。

我目前拥有的有……管理员、管理员、博客、支持和帮助。我记得在 Quora 上看到过一个关于它的问题,但我现在找不到了。

saas subdomain
5个回答
4
投票

感谢您的建议。我制作了一个 Rubygem 来阻止大量子域,可以在这里找到 - https://github.com/deanperry/saas_deny_subdomains

只需添加

deny_subdomains :subdomain
(:subdomain) 作为字段,它将阻止/拒绝大量子域。


2
投票

这是我的 PHP 版本。我添加了一些我的+帖子中建议的+院长佩里的。 我能够通过使用一些正则表达式来涵盖很多场景。

/**
 * Checks if the subdomain is good. e.g. forbidden names are: ssl, secure, test, tester etc.
 * @see http://stackoverflow.com/questions/11868191/which-saas-subdomains-to-block
 * @see https://github.com/deanperry/saas_deny_subdomains/blob/master/lib/saas_deny_subdomains/subdomains.rb
 * @return boolean
 */
public function isSubdomainAvailable($subdomain) {
    $banned_subdomains_csv = 'admin, login, administrator, blog, dashboard, admindashboard, images?, img, files?, videos?, help, support, cname, test, cache, mystore, biz, investors?
    api\d*, js, static, s\d*,ftp, e?mail,webmail, webdisk, ns\d*, register, join, registration, pop\d?, beta\d*, stage, deploy, deployment,staging, testers?, https?, donate, payments, smtp,
    ad, admanager, ads, adsense, adwords?, about, abuse, affiliate, affiliates, store, shop, clients?, code, community, forum?, discussions?, order, buy, cpanel, store, payment,
    whm, dev, devel, developers?, development, docs?, whois, signup, gettingstarted, home, invoice, invoices, ios, ipad, iphone, logs?, my, status, networks?, 
    new, newsite, news, partner, partners, partnerpage, popular, wiki, redirect, random, public, resolver, sandbox, search, servers?, service,uploads?, validation,
    signin, signup, sitemap, sitenews, sites, sms, sorry, ssl, staging,features, stats?, statistics?, graphs?, surveys?, talk, trac, git, svn, translate, validations, webmaster,
    www\d*, feeds?, rss, asset[s\d]*, cp\d*, control panel, online, media, jobs?, secure, demo, i\d*, img\d*, css\d*, js\d*';

    $regex = $banned_subdomains_csv;
    $regex = preg_replace('#\s#si', '', $regex); // rm new lines, spaces etc
    $regex = preg_replace("#,+#si", '|', $regex); // more than one comma
    $regex = trim($regex, ','); // remove any leading/trailing commas
    $regex = '#^(?:' . $regex . ')$#si'; // let's create a nice regex.

    $status = !preg_match($regex, $subdomain); // without main domain added

    return $status;
}

斯拉维

http://orbisius.com


1
投票

除了提到的那些:

  • 测试
  • 舞台/舞台
  • 开发/开发
  • 状态
  • 邮件
  • 网络邮件
  • ftp
  • 饲料
  • ssl/安全
  • 演示
  • git/svn
  • 文件/文档

可能还想保留您自己的名字和任何变体。

编辑: 只是一个想法,也许有点过头了,但你也可以考虑保留像 i.example.com 这样的东西(“i”表示内部),然后你就得到了 *.i.example 的整个命名空间.com 供内部使用。


1
投票

举几个子域:

  • www
  • 帮助
  • 支持
  • 管理员
  • API
  • 资产0-x

0
投票

解决此问题的另一种方法是

app-tenant.domain.com
,其中
tenant
是您客户的用户名或公司。这意味着您可以在 DNS 设置中使用 app-*.domain.com 等内容来标记您的用户。但如果您使用应用程序级负载均衡器,那应该会更容易。恕我直言,这看起来更漂亮。 注意:app.**.domain.com 无效 AFAIK

© www.soinside.com 2019 - 2024. All rights reserved.