https://blog.csdn.net/xukangkang1hao/article/details/80756085

gitlab使用webhook向jenkins发送请求,报错 Requests to the local network are not allowed

以下是官方给出解释:

链接:https://docs.gitlab.com/ee/security/webhooks.html

If you have non-GitLab web services running on your GitLab server or within its local network, these may be vulnerable to exploitation via Webhooks.

With?Webhooks, you and your project maintainers and owners can set up URLs to be triggered when specific things happen to projects. Normally, these requests are sent to external web services specifically set up for this purpose, that process the request and its attached data in some appropriate way.

Things get hairy, however, when a Webhook is set up with a URL that doesn't point to an external, but to an internal service, that may do something completely unintended when the webhook is triggered and the POST request is sent.

Because Webhook requests are made by the GitLab server itself, these have complete access to everything running on the server (http://localhost:123) or within the server's local network (http://192.168.1.12:345), even if these services are otherwise protected and inaccessible from the outside world.

If a web service does not require authentication, Webhooks can be used to trigger destructive commands by getting the GitLab server to make POST requests to endpoints like "http://localhost:123/some-resource/delete".

To prevent this type of exploitation from happening, starting with GitLab 10.6, all Webhook requests to the current GitLab instance server address and/or in a private network will be forbidden by default. That means that all requests made to 127.0.0.1, ::1 and 0.0.0.0, as well as IPv4 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and IPv6 site-local (ffc0::/10) addresses won't be allowed.

This behavior can be overridden by enabling the option?"Allow requests to the local network from hooks and services"?in the?"Outbound requests"?section inside the Admin area under?Settings?(/admin/application_settings):

大致意思 gitlab 10.6 版本以后为了安全,不允许向本地网络发送webhook请求,如果想向本地网络发送webhook请求,则需要使用管理员帐号登录,默认管理员帐号是admin@example.com,密码就是你gitlab搭建好之后第一次输入的密码,登录之后,?点击Configure Gitlab ,如下图所示

即可进入Admin area,在Admin area中,在settings标签下面,找到OutBound Request,勾选上Allow requests to the local network from hooks and services ,保存更改即可解决问题

1、url is blocked requist to the local network are not allowed

解决:

https://blog.csdn.net/xukangkang1hao/article/details/80756085

gitlab使用webhook向jenkins发送请求,报错 Requests to the local network are not allowed

以下是官方给出解释:

链接:https://docs.gitlab.com/ee/security/webhooks.html

If you have non-GitLab web services running on your GitLab server or within its local network, these may be vulnerable to exploitation via Webhooks.

With?Webhooks, you and your project maintainers and owners can set up URLs to be triggered when specific things happen to projects. Normally, these requests are sent to external web services specifically set up for this purpose, that process the request and its attached data in some appropriate way.

Things get hairy, however, when a Webhook is set up with a URL that doesn't point to an external, but to an internal service, that may do something completely unintended when the webhook is triggered and the POST request is sent.

Because Webhook requests are made by the GitLab server itself, these have complete access to everything running on the server (http://localhost:123) or within the server's local network (http://192.168.1.12:345), even if these services are otherwise protected and inaccessible from the outside world.

If a web service does not require authentication, Webhooks can be used to trigger destructive commands by getting the GitLab server to make POST requests to endpoints like "http://localhost:123/some-resource/delete".

To prevent this type of exploitation from happening, starting with GitLab 10.6, all Webhook requests to the current GitLab instance server address and/or in a private network will be forbidden by default. That means that all requests made to 127.0.0.1, ::1 and 0.0.0.0, as well as IPv4 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and IPv6 site-local (ffc0::/10) addresses won't be allowed.

This behavior can be overridden by enabling the option?"Allow requests to the local network from hooks and services"?in the?"Outbound requests"?section inside the Admin area under?Settings?(/admin/application_settings):

大致意思 gitlab 10.6 版本以后为了安全,不允许向本地网络发送webhook请求,如果想向本地网络发送webhook请求,则需要使用管理员帐号登录,默认管理员帐号是admin@example.com,密码就是你gitlab搭建好之后第一次输入的密码,登录之后,?点击Configure Gitlab ,如下图所示

即可进入Admin area,在Admin area中,在settings标签下面,找到OutBound Request,勾选上Allow requests to the local network from hooks and services ,保存更改即可解决问题

2、gitlab 页面 503 错误 之前好好的,突然503错误

解决: 内存不够了,清理一下缓存, gitlab很占内存,至少得5G以上才可以启动

3、获取gitlabtoken

参考地址  https://blog.csdn.net/u011215669/article/details/80458972

4、修改gitlab密码

转自   https://www.cnblogs.com/kevingrace/p/5985918.html

Gitlab安装后,http://localhost访问,首次访问的时候,如果不知道管理员账号和密码,尽管可以注册用户,但注册的用户都不是管理员。这个时候,可以重置管理员的密码,管理员默认是root。
重置管理员密码(密码要是8位)的方法如下:

[root@gitlab ~]# gitlab-rails console production
Loading production environment (Rails 4.1.1)
irb(main):001:0> user = User.where(id:1).first
irb(main):002:0> user.password='12345678'
irb(main):003:0> user.save!

这样,Gitlab管理员的登录权限就是:root/12345678,管理员的默认邮箱是部署机的本机邮箱,也是从本机发的邮件。这也就是为什么在开头要安装postfix。

6、设置用户、组、权限

参照

http://www.cnblogs.com/zangxueyuan/p/9222014.html

gitlab配置webhook报错解决的更多相关文章

  1. ubuntu 配置jdk报错解决办法

    vi /etc/profile ,添加如下代码 export JAVA_HOME=/home/mark/android/jdk1.8 export JRE_HOME=/home/mark/androi ...

  2. Jenkins+Gitlab配置Webhook实现提交自动部署

    一.概述 在上一篇文章,链接如下: https://www.cnblogs.com/xiao987334176/p/11434849.html 已经实现了 Jenkins+harbor+gitlab+ ...

  3. sphinx :undefined reference to `libiconv' 报错解决办法

    sphinx :undefined reference to `libiconv' 报错解决办法   2013-11-30 21:45:39 安装sphinx时不停报错...郁闷在make时报错,错误 ...

  4. 安装grid之前检查配置 ,报错如下

    centos 5 _x86_64 oracle 11.2 安装grid之前检查配置 ,报错如下 : ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fi ...

  5. MyEclipse Server view报错解决方法

    MyEclipse Server view报错解决方法 方法/步骤     启动MyEclipse,弹出一个框,报错. ---------------------------------------- ...

  6. 【gitlab】首次提交本次代码到gitlab上,报错:Updates were rejected because the remote contains work that you do

    首次提交本次代码到gitlab上,报错:Updates were rejected because the remote contains work that you do 报错情况如下: 错误原因: ...

  7. iOS微信支付demo运行报错解决如下

    要接入微信支付的小伙伴,首先要下载一份官方demo(APP微信支付官方Demo下载),然后打开工程,准备大干一场. 1.编译报错 编译的时候居然直接报错了(orz) 错误提示: APP微信支付官方De ...

  8. PHP配置Configure报错:Please reinstall the libzip distribution

    PHP配置Configure报错:Please reinstall the libzip distribution 发生情景: php执行配置命令configure时,报如下错误: checking ...

  9. jenkins配置SVN报错

    jenkins配置SVN报错,如图:

随机推荐

  1. SQL Server CET 通用表表达式 之 精典递归

    SQL2005 Common Table Expressions(CET)即通用表表达式. SQLSERVER CET递归使用案例: 1.普通案例 表结构如下:   ;WITH cet_depart ...

  2. JMeter学习之元件的作用域与执行顺序

    1.元件的作用域 JMeter中共有8类可被执行的元件(测试计划与线程组不属于元件),这些元件中,取样器是典型的不与其它元件发生交互作用的元件,逻辑控制器只对其子节点的取样器有效,而其它元件(conf ...

  3. elk with docker-compose

    version: '2' services: elasticsearch: image: docker.calix.local:18080/docker-elasticsearch:6.2.2-1 # ...

  4. 发现sqlite

    1.前言 本文使用"发现"二字,是表示我作为一个用过mysql oracle hive以及各种nosql数据库的男人,竟然发现有一个如此常识的数据库我竟然不知道. 在配置airfl ...

  5. Jekyll添加FancyBox 插件

    一.简要 这是之前在GitHub Page上面使用博客功能的完善,之前每次传到GitHub上面的图片在博客里面都是显示压缩后的,导致很多代码细节都看不清. Markdown 语法中的图片我们一般是如此 ...

  6. 欧几里得?x

    可以去看dalao博客 orz 1.欧几里得算法 带余除法定理:a,b∈Z,其中b>0,存在唯一q及r,使a=bq+r,其中0<=r<b; 辗转相除法(欧几里得算法)依据:(a,b) ...

  7. 网络流24题 P2766 最长不下降子序列问题

    题目描述 «问题描述: 给定正整数序列x1,...,xn . (1)计算其最长不下降子序列的长度s. (2)计算从给定的序列中最多可取出多少个长度为s的不下降子序列. (3)如果允许在取出的序列中多次 ...

  8. postgresql could not connect to server

    问题: postgresql部署在linux上,在自己电脑上使用pgadmin连接出现could not connect to server错误 问题分析: 出现上述原因有3种情况 1.linux上的 ...

  9. css定位中的百分比

    ----转载自自己在牛人部落中的相关文章--- 在前端css定位中经常面对的一个问题是,百分比定位究竟是针对于谁定位? 一.margin,padding的百分比 首先从css的设计意图说起,在浏览器默 ...

  10. JS的十大排序算法

     名词解释: n: 数据规模k:“桶”的个数In-place: 占用常数内存,不占用额外内存Out-place: 占用额外内存稳定性:排序后2个相等键值的顺序和排序之前它们的顺序相同 冒泡排序(Bub ...