Zobrazit příspěvky

Tato sekce Vám umožňuje zobrazit všechny příspěvky tohoto uživatele. Prosím uvědomte si, že můžete vidět příspěvky pouze z oblastí Vám přístupných.


Příspěvky - zden2k

Stran: 1 [2]
16
Takze to s jednim routrem funguje a s druhym, ne? Co mas odlisne? Masquaradou bys mel predavat pakety z jednoho segmentu site do druheho, napr. z 192.168.y.y do 10.y.y.y apod. Vypis nam teda, co mas v tom nft konfiguraku a co mas v /etc/network/interfaces (pokud mas Debian like based distro).

17
Odkladiště / Re:Sledování CVE
« kdy: 23. 04. 2020, 16:03:00 »
Já nehledám systém, který bude provádět detekci zranitelností. Hledám systém, kde si zaškrtám jaké systémy používám a na e-mail mi budou chodit nějaké reporty o CVE mých systémů.

Přidávám se k tazateli, něco takového bych taky uvítal.

18
Server / Re:nginx: jak deaktivovat https na default vhost?
« kdy: 17. 04. 2020, 22:44:44 »
By default, if the default_server parameter is not specified, then the default server will be the first one specified in the configuration. Asi kvuli tomu.

19
Ve when: kontroluj, jestli uz mas nainstalovany postgres (ansible_fact.packages).

20
Jj sry melo, mel by tam byt interface pres ktery delas NAT, takze interface, na kterem je brana ven.

21
Konfigurak pro nftables s 5 interfacy, enp1s0 je brana ven, na nem se dela maskarada. Enp2-4s0 je vnitri sit, wlp5s0 je wifi v mPCIe. Pak jeste povolit v sysctl ipv4_forwarding a melo by to fungovat. Forward mezi interfacy vnitri site mam jako accept, aby stroje v siti 172.16.0.0/12 mohly mezi sebou komunikovat. Ven mam povolene 22, 80, 443 stavovym firewallem:
Kód: [Vybrat]
#!/sbin/nft -f
# vim: ft=pf

### FLUSH RULESET
flush ruleset

### SERVERs
define IPV4_LOCAL = { 172.16.0.0/12 }

table ip filter {
    chain input {
        type filter hook input priority 0; policy drop;
        counter comment "count input accepted packets"

        ### DROP

        ### State firewall
        iifname enp1s0 ct state invalid counter log prefix "DROP INVALID: " drop comment "early drop of invalid packets"
        iifname enp1s0 ct state established,related counter accept comment "accept all connections related to connections made by us"

        iifname enp2s0 accept comment "accept all"
        iifname enp3s0 accept comment "accept all"
        iifname enp4s0 accept comment "accept all"
        iifname wlp5s0 accept comment "accept all"

        ### Loopback interface
        iifname lo accept comment "accept loopback"
        iifname != lo ip daddr 127.0.0.1/8 counter drop comment "drop connections to loopback not coming from loopback"

        ### Icmp
        ip protocol icmp counter limit rate 3600/hour burst 1200 packets log prefix "ACCEPT ICMP: " accept comment "accept all ICMP types"

        ### Allow LOCAL
        ip saddr $IPV4_LOCAL counter log prefix "ACCEPT LOCAL: " accept comment "connections comming from LOCAL servers"

        ### Allow INET access
        tcp dport 22 ct state new counter limit rate 6/minute burst 3 packets log prefix "ACCEPT SSH to port 22: " accept comment "connections via SSH"
        tcp dport 80 ct state new counter log prefix "ACCEPT HTTP to port 80: " accept comment "connections via HTTP"
        tcp dport 443 ct state new counter log prefix "ACCEPT HTTPS to port 443: " accept comment "connections via HTTPS"
    }

    chain forward {
        type filter hook forward priority 0; policy accept;
                counter comment "count forward dropped packets"
    }

    chain output {
        type filter hook output priority 0; policy accept;
        counter comment "count output accepted packets"
    }
}

table ip nat {
    chain prerouting {
            type nat hook prerouting priority 0;
    }
    chain postrouting {
            type nat hook postrouting priority 100;
        oifname "enp0s1" masquerade
    }
}

a pak:
Kód: [Vybrat]
nft -f /path/konfigurak.nft

22
Server / Re:Logrotate OpenVPN a reload
« kdy: 24. 03. 2020, 10:57:56 »
Logrotate copytruncate option: Continue to write the log information in the newly created file after rotating the old log file.

Kód: [Vybrat]
$ cat logrotate.conf
/tmp/output.log {
         size 1k
         copytruncate
         rotate 4
}

copytruncate instruct logrotate to creates the copy of the original file (i.e rotate the original log file) and truncates the original file to zero byte size. This helps the respective service that belongs to that log file can write to the proper file.

23
Software / Re:opakovane prehrani zvuku
« kdy: 08. 03. 2020, 13:22:21 »
Skriptem? nastavit jako spustitelny s mit naistalovane aplay:

Kód: [Vybrat]
#!/bin/bash
echo "START now";
while [ 1 ];
do
   aplay /cesta/zvuk.mp3;
   random=$(($RANDOM%600+1200));
   echo "sleep $random";
   sleep $random;
done

24
Sítě / Re:Nový wifi router, Turris ?
« kdy: 21. 02. 2020, 12:32:12 »
Mam Apu4d4 s mSATA SSD a mPCIe wifi a spokojenost. Neni to arm, ma 4g porty, bootuje to z usb/pxe, ma to seriovou konzoli a minimalni odber. Navic je na to nadherna cerna krabicka.

https://www.pcengines.ch/apu4d4.htm
https://www.discomp.cz/pc-engines-apu-4d4-system-board-4gb-ram_d92946.html?action=setlng&lngid=2

25
Bazar / Re:Prodám HP Microserver Gen8, 16GB RAM, Xeon 3.1 GHz
« kdy: 27. 01. 2020, 14:24:33 »
Zdravim, beru bez APC. Email: zden2k.sobotka@gmail.com.

Dik.

Disky sú už predané. Ďakujem za priestor.

Zľavňujem Gen8 s 16 GB RAM a LSI 9220-8i na 9.000 Kč.
Spolu s APC UPS 10.000 Kč.

Stran: 1 [2]