<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ckujau</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ckujau"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Ckujau"/>
	<updated>2026-05-02T19:56:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=CPU_Microcode&amp;diff=32044</id>
		<title>CPU Microcode</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=CPU_Microcode&amp;diff=32044"/>
		<updated>2026-02-11T21:02:51Z</updated>

		<summary type="html">&lt;p&gt;Ckujau: with grep it shows the name of the vulnerability too&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CPU &#039;&#039;&#039;microcode&#039;&#039;&#039; is a form of firmware that controls the processor&#039;s internals. &lt;br /&gt;
&lt;br /&gt;
In modern processors, the microcode handles execution of complex and highly specialized instructions. Parts of the microcode also act as firmware for the processor&#039;s embedded controllers, and it is even used to fix or to mitigate &#039;&#039;&#039;processor design/implementation errata/bugs&#039;&#039;&#039;. Given the complexity of modern processors, a CPU may have over a hundred such errata.&lt;br /&gt;
&lt;br /&gt;
Recently, microcode updates have become mandatory for security due to [https://en.wikipedia.org/wiki/Side-channel_attack side-channel attacks] against CPUs.&lt;br /&gt;
&lt;br /&gt;
== Obtaining microcode updates on Alpine ==&lt;br /&gt;
&lt;br /&gt;
{{Warning| Certain Intel CPUs, such Intel Atom with PSE errata, and Intel Haswell + Broadwell with TSX errata, can only be fixed via BIOS or UEFI update (which includes microcode); if you are using one of these CPUs, please do not use the instructions below}}&lt;br /&gt;
&lt;br /&gt;
On Alpine Linux, CPU microcode is loaded early via initrd images, premade images are available from packages:&lt;br /&gt;
&lt;br /&gt;
To obtain the microcode update package for AMD processors:&lt;br /&gt;
{{cmd|apk add {{pkg|amd-ucode}}}}&lt;br /&gt;
&lt;br /&gt;
To obtain the microcode update package for Intel processors:&lt;br /&gt;
{{cmd|apk add {{pkg|intel-ucode}}}}&lt;br /&gt;
&lt;br /&gt;
If you are using syslinux or grub in a typical setup, the packages will automatically append your {{path|extlinux.conf}} or {{path|grub.conf}} file and merely a reboot will be required to run the new microcode. Users using UEFI&#039;s built-in boot manager will have to use efibootmgr to add a second initrd line. Likewise if you are using the limine bootoader will need to add a 2nd MODULE_PATH directive in {{path|limine.cfg}} pointing to the ucode file.&lt;br /&gt;
&lt;br /&gt;
== Verifying that the microcode image has loaded ==&lt;br /&gt;
Run the command:&lt;br /&gt;
{{cmd|dmesg &amp;amp;#124; grep microcode}}&lt;br /&gt;
If the microcode initrd image was loaded, the microcode update driver will print a signature and revision&lt;br /&gt;
&lt;br /&gt;
Example for Intel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 2.198775 ] microcode&amp;amp;#58; sig&amp;amp;#61;0x6fd, pf&amp;amp;#61;0x80, revision&amp;amp;#61;0xa4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example for AMD:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[   11.442146] microcode: Current revision: 0x0a0011d5&lt;br /&gt;
[   11.447027] microcode: Updated early from: 0x0a0011d3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Todo|Example needed for VIA CPUs, they seem to print slightly differently.}}&lt;br /&gt;
&lt;br /&gt;
== Check if CPU mitigation is working ==&lt;br /&gt;
This command not only shows if microcode is working, but other CPU vulnerabilities affected:&lt;br /&gt;
{{cmd|grep -r . /sys/devices/system/cpu/vulnerabilities/}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Ckujau</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_OpenVPN_server&amp;diff=21926</id>
		<title>Setting up a OpenVPN server</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_OpenVPN_server&amp;diff=21926"/>
		<updated>2022-05-29T10:33:36Z</updated>

		<summary type="html">&lt;p&gt;Ckujau: use {{cmd}} template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
This article describes how to set up an OpenVPN server with the Alpine Linux.&lt;br /&gt;
This is an ideal solution for allowing single users or devices to remotely connect to your network. To establish connectivity with a Remote Office or site, [http://wiki.alpinelinux.org/w/index.php?title=Using_Racoon_for_Remote_Sites Racoon/Opennhrp] would provide better functionality. &lt;br /&gt;
&lt;br /&gt;
It is recommended you have a publicly routable static IP address in order for this to work. This means that your IP address cannot be in the private IP address ranges described here: [http://en.wikipedia.org/wiki/IP_address#IPv4_private_addresses WikiPedia]&lt;br /&gt;
&lt;br /&gt;
If your Internet-connected machine doesn&#039;t have a static IP address, [http://www.dyndns.com DynDNS] can be used for resolving DNS names to IP addresses.&lt;br /&gt;
&lt;br /&gt;
= Set up Alpine =&lt;br /&gt;
== Initial Set up ==&lt;br /&gt;
Follow [[Installing_Alpine]] to set up Alpine Linux.&lt;br /&gt;
&lt;br /&gt;
== Install programs ==&lt;br /&gt;
Install openvpn&lt;br /&gt;
{{Cmd|apk add openvpn}}&lt;br /&gt;
&lt;br /&gt;
Prepare autostart of OpenVPN&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add openvpn default}}&lt;br /&gt;
&lt;br /&gt;
{{Cmd|modprobe tun&lt;br /&gt;
echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules-load.d/tun.conf}}&lt;br /&gt;
&lt;br /&gt;
Enable IP Forwarding&lt;br /&gt;
&lt;br /&gt;
{{Cmd|echo &amp;quot;net.ipv4.ip_forward &amp;amp;#61; 1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.d/ipv4.conf}}&lt;br /&gt;
{{Cmd|sysctl -p /etc/sysctl.d/ipv4.conf}}&lt;br /&gt;
&lt;br /&gt;
= Certificates =&lt;br /&gt;
One of the first things that needs to be done is to make sure you have secure keys to work with. Alpine makes this easy by having a web interface to manage the certificates. Documentation for it can be found here: [[Generating_SSL_certs_with_ACF]]. It is a best practice not to have your certificate server be on the same machine as the router being used for remote connectivity.&lt;br /&gt;
&lt;br /&gt;
You will need to create a server (ssl_server_cert) certificate for the server and one client certificate (ssl_client_cert) for each client. To use the certificates, you should download the .pfx file and extract it.&lt;br /&gt;
&lt;br /&gt;
To extract the three parts of each .pfx file, use the following commands:&lt;br /&gt;
 &lt;br /&gt;
To get the ca cert out:&lt;br /&gt;
{{Cmd|openssl pkcs12 -in PFXFILE -cacerts -nokeys -out ca.pem}}&lt;br /&gt;
&lt;br /&gt;
To get the cert file out:&lt;br /&gt;
{{Cmd|openssl pkcs12 -in PFXFILE -nokeys -clcerts -out cert.pem}}&lt;br /&gt;
&lt;br /&gt;
To get the private key file out: (Make sure the key stays private)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|openssl pkcs12 -in PFXFILE -nocerts -nodes -out key.pem}}&lt;br /&gt;
&lt;br /&gt;
On the VPN server, you can also install the &#039;&#039;&#039;acf-openvpn&#039;&#039;&#039; package, which contains a web page to automatically upload and extract the server certificate. There is also a button to automatically generate the Diffie-Hellman parameters.&lt;br /&gt;
&lt;br /&gt;
If you would prefer to generate your certificates using OpenVPN utilities, see [[#Alternative Certificate Method]]&lt;br /&gt;
&lt;br /&gt;
= Configure OpenVPN server =&lt;br /&gt;
Example configuration file for server. Place the following content in /etc/openvpn/openvpn.conf:&lt;br /&gt;
 local &amp;quot;Public Ip address&amp;quot;&lt;br /&gt;
 port 1194&lt;br /&gt;
 proto udp&lt;br /&gt;
 dev tun&lt;br /&gt;
 ca /etc/openvpn/easy-rsa/keys/ca.crt &lt;br /&gt;
 cert /etc/openvpn/easy-rsa/keys/Server.crt # SWAP WITH YOUR CRT NAME&lt;br /&gt;
 key /etc/openvpn/easy-rsa/keys/Server.key # SWAP WITH YOUR KEY NAME&lt;br /&gt;
 dh /etc/openvpn/easy-rsa/keys/dh1024.pem # If you changed to 2048, change that here!&lt;br /&gt;
 server 10.0.0.0 255.255.255.0&lt;br /&gt;
 ifconfig-pool-persist ipp.txt&lt;br /&gt;
 push &amp;quot;route 10.0.0.0 255.0.0.0&amp;quot;&lt;br /&gt;
 push &amp;quot;dhcp-option DNS 10.0.0.1&amp;quot;&lt;br /&gt;
 keepalive 10 120&lt;br /&gt;
 comp-lzo&lt;br /&gt;
 user nobody&lt;br /&gt;
 group nobody&lt;br /&gt;
 persist-key&lt;br /&gt;
 persist-tun&lt;br /&gt;
 status /var/log/openvpn-status.log&lt;br /&gt;
 log-append  /var/log/openvpn.log&lt;br /&gt;
 verb 3&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;Instructions are based on [http://openvpn.net/howto.html#server openvpn.net/howto.html#server]&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
== Test your configuration ==&lt;br /&gt;
Test configuration and certificates&lt;br /&gt;
&lt;br /&gt;
{{Cmd|openvpn --config /etc/openvpn/openvpn.conf}}&lt;br /&gt;
&lt;br /&gt;
= Configure OpenVPN client =&lt;br /&gt;
Example client.conf:&lt;br /&gt;
 client&lt;br /&gt;
 dev tun&lt;br /&gt;
 proto udp&lt;br /&gt;
 remote &amp;quot;public IP&amp;quot; 1194&lt;br /&gt;
 resolv-retry infinite&lt;br /&gt;
 nobind&lt;br /&gt;
 ns-cert-type server # This means the certificate on the openvpn server needs to have this field. Prevents MitM attacks&lt;br /&gt;
 persist-key&lt;br /&gt;
 persist-tun&lt;br /&gt;
 ca client-ca.pem&lt;br /&gt;
 cert client-cert.pem&lt;br /&gt;
 key client-key.pem&lt;br /&gt;
 comp-lzo&lt;br /&gt;
 verb 3&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;Instructions are based on [http://openvpn.net/howto.html#client openvpn.net/howto.html#client]&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
= Save settings =&lt;br /&gt;
Don&#039;t forget to save all your settings if you are running a RAM-based system.&lt;br /&gt;
{{Cmd|lbu commit}}&lt;br /&gt;
&lt;br /&gt;
= More than one server or client =&lt;br /&gt;
&lt;br /&gt;
If you want more than one server or client running on the same Alpine box, use the standard [[Multiple Instances of Services]] process.&lt;br /&gt;
&lt;br /&gt;
For example, to create a config named &amp;quot;AlphaBravo&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
* Create an approriate /etc/openvpn/openvpn.conf file, but name it &amp;quot;/etc/openvpn/AlphaBravo.conf&amp;quot; &lt;br /&gt;
* create a new symlink of the init.d script:&lt;br /&gt;
{{Cmd|ln -s /etc/init.d/openvpn /etc/init.d/openvpn.AlphaBravo}}&lt;br /&gt;
* Have the new service start automatically&lt;br /&gt;
{{Cmd|rc-update add openvpn.AlphaBravo}}&lt;br /&gt;
&lt;br /&gt;
= Alternate Certificate Method =&lt;br /&gt;
== Manual Certificate Commands ==&lt;br /&gt;
(&#039;&#039;Instructions are based on [http://openvpn.net/howto.html#pki openvpn.net/howto.html#pki]&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
=== Initial setup for administrating certificates ===&lt;br /&gt;
The following instructions assume you want to save your configs, certs and keys in &#039;&#039;&#039;/etc/openvpn/keys&#039;&#039;&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
Start by moving to the &#039;&#039;&#039;/usr/share/openvpn/easy-rsa&#039;&#039;&#039; folder to execute commands&lt;br /&gt;
{{Cmd|apk add easy-rsa # from the community repo&lt;br /&gt;
cd /usr/share/easy-rsa}}&lt;br /&gt;
If not already done, create a folder where you will save your certificates and save a copy of your &#039;&#039;&#039;/usr/share/easy-rsa/vars&#039;&#039;&#039; for later use.&amp;lt;BR&amp;gt;&lt;br /&gt;
{{Cmd|mkdir /etc/openvpn/keys&lt;br /&gt;
cp ./vars.example ./vars    #easy-rsa v3&lt;br /&gt;
cp ./vars /etc/openvpn/keys #easy-rsa v2}}&lt;br /&gt;
&lt;br /&gt;
For EasyRSA v3 see: https://community.openvpn.net/openvpn/wiki/EasyRSA&lt;br /&gt;
&lt;br /&gt;
The instructions below are for EasyRSA v2:&lt;br /&gt;
&lt;br /&gt;
If not already done, edit &#039;&#039;&#039;/etc/openvpn/keys/vars&#039;&#039;&#039;&amp;lt;BR&amp;gt;&lt;br /&gt;
(&#039;&#039;This file is used for defining paths and other standard settings&#039;&#039;)&lt;br /&gt;
{{Cmd|vim /etc/openvpn/keys/vars}}&lt;br /&gt;
* Change &#039;&#039;&#039;KEY_DIR=&#039;&#039;&#039; from &amp;quot;&#039;&#039;&#039;$EASY_RSA/keys&#039;&#039;&#039;&amp;quot; to &amp;quot;&#039;&#039;&#039;/etc/openvpn/keys&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Change &#039;&#039;&#039;KEY_SIZE, CA_EXPIRE, KEY_EXPIRE, KEY_COUNTRY, KEY_PROVINCE, KEY_CITY, KEY_ORG, KEY_EMAIL&#039;&#039;&#039; to match your system.&lt;br /&gt;
source the &#039;&#039;&#039;vars&#039;&#039;&#039; to set properties&lt;br /&gt;
{{Cmd|source /etc/openvpn/keys/vars}}&lt;br /&gt;
{{Cmd|touch /etc/openvpn/keys/index.txt&lt;br /&gt;
echo 00 &amp;gt; /etc/openvpn/keys/serial}}&lt;br /&gt;
&lt;br /&gt;
=== Set up a &#039;Certificate Authority&#039; (CA) ===&lt;br /&gt;
Clean up the &#039;&#039;&#039;keys&#039;&#039;&#039; folder.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|./clean-all}}&lt;br /&gt;
&lt;br /&gt;
Generate Diffie-Hellman parameters&lt;br /&gt;
&lt;br /&gt;
{{Cmd|./build-dh}}&lt;br /&gt;
&lt;br /&gt;
To make the CA certificates and keys&lt;br /&gt;
&lt;br /&gt;
{{Cmd|./build-ca}}&lt;br /&gt;
&lt;br /&gt;
=== Set up an &#039;OpenVPN Server&#039; ===&lt;br /&gt;
Create server certificates&lt;br /&gt;
&lt;br /&gt;
{{Cmd|./build-key-server &amp;lt;commonname&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Set up an &#039;OpenVPN Client&#039; ===&lt;br /&gt;
Create client certificates&lt;br /&gt;
{{Cmd|./build-key &amp;lt;commonname&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Revoke a certificate ===&lt;br /&gt;
To revoke a certificate&lt;br /&gt;
&lt;br /&gt;
{{Cmd|./revoke-full &amp;lt;commonname&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The revoke-full script will generate a CRL (certificate revocation list) file called &#039;&#039;&#039;crl.pem&#039;&#039;&#039; in the &#039;&#039;&#039;keys&#039;&#039;&#039; subdirectory.&amp;lt;BR&amp;gt;The file should be copied to a directory where the OpenVPN server can access it, then CRL verification should be enabled in the server configuration:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|crl-verify crl.pem}}&lt;br /&gt;
&lt;br /&gt;
= OpenVPN and LXC =&lt;br /&gt;
&lt;br /&gt;
Let&#039;s call this LXC &amp;quot;mylxc&amp;quot;...&lt;br /&gt;
&lt;br /&gt;
On the host &amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe tun&lt;br /&gt;
mkdir /var/lib/lxc/mylxc/rootfs/dev/net&lt;br /&gt;
mknod /var/lib/lxc/mylxc/rootfs/dev/net/tun c 10 200&lt;br /&gt;
chmod 666 /var/lib/lxc/mylxc/rootfs/dev/net/tun&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In /var/lib/lxc/mylxc/config &amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the guest &amp;lt;pre&amp;gt;&lt;br /&gt;
apk add openvpn&lt;br /&gt;
&amp;lt;/pre&amp;gt; Then config as usual.&lt;br /&gt;
&lt;br /&gt;
This should work both as server and as client.&lt;br /&gt;
&lt;br /&gt;
== persistent devices ==&lt;br /&gt;
lxc guest have their dev recreated on each restart in a tmpfs. This means all devices are reset and are not read from the rootfs dev directory. &lt;br /&gt;
To make it persistent you can use an autodev script by adding the following to your lxc guest config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# tun (openvpn)&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
# audodev script to add devices&lt;br /&gt;
lxc.hook.autodev=/var/lib/lxc/CONTAINER/autodev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The autodev script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# dev is populated on earch container start.&lt;br /&gt;
# to make devices persistence we need to recreate them on each start.&lt;br /&gt;
&lt;br /&gt;
cd ${LXC_ROOTFS_MOUNT}/dev&lt;br /&gt;
mkdir net&lt;br /&gt;
mknod net/tun c 10 200&lt;br /&gt;
chmod 0666 net/tun&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: VPN]]&lt;/div&gt;</summary>
		<author><name>Ckujau</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Ckujau&amp;diff=15667</id>
		<title>User:Ckujau</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Ckujau&amp;diff=15667"/>
		<updated>2019-01-11T23:38:11Z</updated>

		<summary type="html">&lt;p&gt;Ckujau: Oh, hai!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 __________&lt;br /&gt;
&amp;lt; Oh, hai! &amp;gt;&lt;br /&gt;
 ----------&lt;br /&gt;
        \   ^__^&lt;br /&gt;
         \  (oo)\_______&lt;br /&gt;
            (__)\       )\/\&lt;br /&gt;
                ||----w |&lt;br /&gt;
                ||     ||&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ckujau</name></author>
	</entry>
</feed>