Kerya techblog

Most Read Posts

  • Gentoo mail (postfix + postfixadmin + dovecot + amavisd-new + roundcube)
  • Zabbix - no such instance currently exists at this oid
  • LVM cant Boot - ALERT /dev/mapper/ubuntu--vg-root does not exist DROPPING to Shell -
  • liquidsoap-1.1.1 gentoo install
  • Laravel manual user register
  • Gentoo: php 5.6.0 + pecl-memcached 2.2.0 install script
  • Zabbix APC Smart UPS monitoring on FreeBSD with snmp
  • Squid 3.4 debian 7 install script
  • Подключение Foxgate S6224-S2 Ubuntu minicom
  • Abills
  • exim+dovecot+postfixadmin+clamav+spamassassin on FreeBSD
  • Openmeetings 2.1.1 Ubuntu 12.04.2 installation
  • libtool version mismatch pecl gentoo
  • Securing NTP
  • FreeBSD 9 ossec setup errors fix
  • fix for - corrupted record for package (pkgdep line without argument), ignoring
  • snmpd less verbose log FreeBSD (Connection from UDP messages)
  • Скопировать права mysql gentoo
  • Mikrotik no-ip ddns update script
  • mysql backup scripts
  1. Вы здесь:  
  2. Home
  3. unpack pfx certificate (used for apache or nginx)
  • Home
  • Все статьи

modsecurity for nginx compilation scripts for freebsd

Подробности
Автор: Kirill

Because nginx version of modsecurity3-nginx port is 1.22 and not always compilation successful, it is possible to compile modsecurity from source.

Compiled modsecurity can be safely included in nginx from ports.

Everything (nginx and modsecurity3-nginx) can be compiled by running compile-nginx.sh :

compile-modsecurity.sh :

#!/bin/sh

#libModSecurity
rm -rf ModSecurity
git clone --depth 1 -b v3/master --single-branch https://github.com/SpiderLabs/ModSecurity
cd ModSecurity
git pull
git submodule init
git submodule update
./build.sh
./configure
gmake -j4
cd ..
#nginx connector
rm -rf Modsecurity-nginx
git clone --depth 1 https://github.com/SpiderLabs/ModSecurity-nginx.git
cd Modsecurity-nginx
git pull
cd ..

compile-nginx.sh:

#!/bin/sh

ver="1.28.0"

if [ ! -f nginx-${ver}.tar.gz ]; then
wget http://nginx.org/download/nginx-${ver}.tar.gz
fi
rm -rf nginx-${ver}
if [ ! -d nginx-${ver} ]; then
tar xvf nginx-${ver}.tar.gz
fi
./compile-modsecurity.sh
cd nginx-${ver}
./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx.pid \
--with-cc-opt='-DNGX_HAVE_INET6=0 -I /usr/local/include' \
--with-ld-opt='-L /usr/local/lib' \
--user=www \
--group=www \
--with-file-aio \
--with-google_perftools_module \
--with-http_v2_module \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-pcre \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--without-mail_imap_module \
--without-mail_pop3_module \
--without-mail_smtp_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-threads \
--with-stream=dynamic \
--with-http_v3_module \
--add-dynamic-module=../ModSecurity-nginx
make -j4if [ $? -eq 0 ]
then echo "Complilation successful"
else
echo "Compilation failed"
exit 1
fi

make install

 

 

 

Greenbone Vulnerability Manager (GVM) hacks

Подробности
Автор: Kirill

After creating user via web interface you can only get admin role but not superadmin role. Creating user via cli

# gvmd --create-user=gigauser -v --role="Super Admin"

may give no result:

Authentication failure for 'gigauser' from unix_socket

You can not change role via webinterface.

To assign user superadmin role directly in database:

# docker compose exec pg-gvm /bin/bash

# psql -U root gvmd

gvmd=# select * from roles;

remember required role

gvmd=# select * from users;

remember user id

gvmd=# select * from role_users;

remember required id

gvmd=# update role_users set role=6 where id=37;

 

elasticsearch cluster red status fix due to high watermark

Подробности
Автор: Kirill

Do not delete elasticsearch files with rm on filesystem, use es api instead.

curl -X GET "localhost:9200/_cluster/health" | jq

or

curl -X GET -u elastic:YourGigaPassword "localhost:9200/_cluster/health" | jq

"status": "red"

List indicies sorted by size:

curl -X GET "localhost:9200/_cat/indices?s=store.size:asc" 

Delete index:

curl -X DELETE  "localhost:9200/.ds-logs-kubernetes.container_logs-default-2024.11.12-000002"

After that setup index lifecycle management.

 Links:

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-delete-index.html

https://stackoverflow.com/questions/61327189/how-to-sort-kibana-indices-by-descending-size

https://stackoverflow.com/questions/24960902/how-to-get-a-list-of-elasticsearch-indices-sorted-by-name

https://www.elastic.co/guide/en/elasticsearch/reference/7.17/cat-indices.html

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/cat-indices.html

 

ubuntu arrow keys misbehaviour fix

Подробности
Автор: Kirill

Sometimes happens when arrow keys stop working as expected in ubuntu, up arrow which usually stand for search back in history become printscreen and other arrows stop working at all, you can't move cursor, etc.

Fix is easy:

$ sudo udevadm trigger --subsystem-match=input --action=change

Source:

https://askubuntu.com/questions/675476/reset-keyboard-layout-to-default-and-wipe-out-all-earlier-settings

 

 

  1. icinga IIS monitoring powershell error Get-WmiObject : Invalid namespace "root\WebAdministration"
  2. Make user superadmin in zabbix

Страница 1 из 18

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

Search

Older Posts

  • modsecurity for nginx compilation scripts for freebsd (14)
  • Greenbone Vulnerability Manager (GVM) hacks (137)
  • elasticsearch cluster red status fix due to high watermark (97)
  • ubuntu arrow keys misbehaviour fix (103)
  • icinga IIS monitoring powershell error Get-WmiObject : Invalid namespace "root\WebAdministration" (134)
  • Make user superadmin in zabbix (125)
  • dnf Error: unknown option (139)
  • unpack pfx certificate (used for apache or nginx) (150)
  • mysql audit plugin build script (327)
  • mysql dump one row (123)
  • redmine 5 docker-compose (231)
  • gitlab runner dind docker-compose (179)
  • AWS S3 IAM policy to limit to single sub folder (180)
  • logrotate hints (244)
  • bash script to clean files to required percentage (355)

Login Form

  • Забыли пароль?
  • Забыли логин?
  • Регистрация