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
  • Mikrotik no-ip ddns update script
  • Скопировать права mysql gentoo
  • snmpd less verbose log FreeBSD (Connection from UDP messages)
  • mysql backup scripts
  1. Вы здесь:  
  2. Home
  • Home
  • Все статьи

mysql audit plugin build script

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

Script tested on Rocky Linux 8.9 and mysql 8.0.36

export MYSQL_VERSION="8.0.36"
dnf install git cmake3 gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-binutils gcc-toolset-12-annobin-annocheck gcc-toolset-12-annobin-plugin-gcc elfutils openssl-devel ncurses-devel libtirpc-devel patch automake libtool mysql-devel libudev-devel bison curl-devel python2 -y
dnf -y --enablerepo=powertools install rpcgen
scl enable gcc-toolset-12 bash
wget -q -N https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz -O mysql-boost-${MYSQL_VERSION}.tar.gz
git clone https://github.com/trellix-enterprise/mysql-audit.git
cd mysql-audit
git checkout tags/v1.1.13
tar zxvf ../mysql-boost-${MYSQL_VERSION}.tar.gz
cd mysql-${MYSQL_VERSION}
cmake3 -DFORCE_INSOURCE_BUILD=ON -DWITH_BOOST=boost .

make -j`nproc --all` -C libservices
make -j`nproc --all` -C include

cd ..
perl -pi -e 's/TABLE_LIST/Table_ref/g' `grep -rlw TABLE_LIST include/ src/ offset-extract/`
cd src

patch --verbose --ignore-whitespace audit_handler.cc << EOF
--- audit_handler.cc    2024-01-24 17:19:37.247677405 +0000
+++ audit_handler.cc.2  2024-01-24 17:23:21.295862210 +0000
@@ -841,7 +841,7 @@
   const char *well_formed_error_pos = NULL, *cannot_convert_error_pos = NULL,
              *from_end_pos = NULL;
   copy_length = well_formed_copy_nchars(
-      &my_charset_utf8_bin
+      &my_charset_utf8mb4_bin
     , dest
     , dest_size
     , from_cs
@@ -1089,7 +1089,7 @@
 #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100504
                                        &my_charset_utf8mb3_general_ci,
 #else
-                                       &my_charset_utf8_general_ci,
+                                       &my_charset_utf8mb4_general_ci,
 #endif
                                        query, qlen,
                                        col_connection, & errors);
EOF

cd ..

chmod +x bootstrap.sh
./bootstrap.sh
CXX='gcc -static-libgcc' CC='gcc -static-libgcc' ./configure --with-mysql=mysql-${MYSQL_VERSION} --with-mysql-libservices=mysql-${MYSQL_VERSION}/libservices/libmysqlservices.a
perl -pi -e 's/automake-1.15/automake/g' pcre/Makefile
perl -pi -e 's/aclocal-1.15/aclocal/g' pcre/Makefile

alternatives --config python
make -j`nproc --all`

ls -la src/.libs

and finally: cp src/.libs/libaudit_plugin.so* /usr/lib64/mysql/plugin/

 

Issue and discussion:

https://github.com/trellix-enterprise/mysql-audit/issues/261

 One more mention:

https://dba.stackexchange.com/questions/330679/mysql-8-0-34-community-server-cant-open-shared-library-usr-lib64-mysql-plugin

 

mysql dump one row

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

mysqldump <db_name> <table_name> --where="extension_id=727" > outfile.sql

redmine 5 docker-compose

Подробности
Автор: Kirill
  • docker
  • docker-compose
  • redmine

version: '3.9'

services:
 redmine:
   image: redmine:5.0
   restart: always
   depends_on:  
     - mysql-redmine
   ports:
     - 8090:3000
   volumes:
     - /srv/redmine-files:/usr/src/redmine/files
     - /srv/redmine-logs:/var/log/redmine
   environment:
     - TZ=Europe/Kyiv
     - REDMINE_DB_MYSQL=mysql-redmine
#      - REDMINE_DB_USER=redmine
#      - REDMINE_DB_PASSWORD=somepassword
     - REDMINE_DB_PASSWORD=supermegapassword
     - REDMINE_SECRET_KEY_BASE=supersecretkey
   networks:
     redmine:

 mysql-redmine:
   image: mysql:8.0
   restart: always
   environment:
     - MYSQL_ROOT_PASSWORD=supermegapassword
     - MYSQL_DATABASE=redmine
     - MYSQL_USER=redmine
     - MYSQL_PASSWORD=somepassword
   networks:
     redmine:

networks:
 redmine:
   driver: bridge

gitlab runner dind docker-compose

Подробности
Автор: Kirill
  • gitlab
  • docker
  • docker-compose

services:
 dind:
   image: docker:23-dind
   restart: always
   privileged: true
   environment:
     DOCKER_TLS_CERTDIR: ""
   command:
     - --storage-driver=overlay2

 runner:
   restart: always
   image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
   depends_on:
     - dind
   environment:
     - DOCKER_HOST=tcp://dind:2375
   volumes:
     - ./config:/etc/gitlab-runner:z

#  register-runner:
#    restart: 'no'
#    image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
#    depends_on:
#      - dind
#    environment:
#      - CI_SERVER_URL=${CI_SERVER_URL}
#      - REGISTRATION_TOKEN=${REGISTRATION_TOKEN}
#    command:
#      - register
#      - --non-interactive
#      - --locked=false
#      - --name=${RUNNER_NAME}
#      - --executor=docker
#      - --docker-image=docker:20-dind
#      - --docker-volumes=/var/run/docker.sock:/var/run/docker.sock
#    volumes:
#      - ./config:/etc/gitlab-runner:z

  1. AWS S3 IAM policy to limit to single sub folder
  2. logrotate hints

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

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

Search

Older Posts

  • modsecurity for nginx compilation scripts for freebsd (28)
  • Greenbone Vulnerability Manager (GVM) hacks (163)
  • elasticsearch cluster red status fix due to high watermark (107)
  • ubuntu arrow keys misbehaviour fix (117)
  • icinga IIS monitoring powershell error Get-WmiObject : Invalid namespace "root\WebAdministration" (147)
  • Make user superadmin in zabbix (138)
  • dnf Error: unknown option (148)
  • unpack pfx certificate (used for apache or nginx) (168)
  • mysql audit plugin build script (340)
  • mysql dump one row (131)
  • redmine 5 docker-compose (242)
  • gitlab runner dind docker-compose (190)
  • AWS S3 IAM policy to limit to single sub folder (195)
  • logrotate hints (263)
  • bash script to clean files to required percentage (369)

Login Form

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