Fortinet Info

Disable Fortigate Identity on WAN port (that is enabled by default):

https://community.fortinet.com/t5/FortiGate/Technical-Tip-Closing-TCP-port-113/ta-p/195373
config system interface
edit
set ident-accept enable
next
end

Difference between “show” and “get” commands:

https://community.fortinet.com/t5/Support-Forum/Difference-between-GET-quot-and-quot-SHOW-quot-commands/m-p/250505#M209556

“We can use the get command to retrieve dynamic information such as IP of DHCP or PPPoE Interface
It also gives the information or lists the configuration of the current object in tabular format.
While the show command gives the configuration in configurable format or tree structure.”

How I understand it:
Show in FortiOS like “show” in Cisco IOS where you see, for example, interface status: show ip interface g1
“Get” is like “show run | sec GigabitEthernet1” – shows the configuration of the item.

OSPF with Cisco:

https://tcpflag.blogspot.com/2015/08/fortigate-with-cisco-using-ospf.html
There are two important things:
1) https://community.fortinet.com/t5/FortiGate/Technical-Note-OSPF-Interoperability-with-Cisco-Setting-up-an/ta-p/192112
you can’t configure Area ID like in Cisco, with one digit (0), you must configure it like 0.0.0.0. If you want area 5, you must convert 5 to 0.0.0.5. And if you want area 269, you must convert it to 0.0.1.13 (269-256=13). You can use converter if you don’t want to do it by yourself: https://codebeautify.org/decimal-to-ip-converter
2) Hello and Dead intervals should match with other members of routing exchange. Check configuration in CLI and set correct timers in interface(s) configuration.

OSPF diagnostics command: diagnose sniffer packet "proto 89" 6 0 a

Radius configuration:

Start with this example:
https://community.fortinet.com/t5/FortiGate/Technical-Tip-Configuring-FortiGate-and-Microsoft-NPS-Radius/ta-p/213024
Check connectivity problems from Fortigate CLI:
diag sniffer packet any "host XXX.XXX.XXX.XXX and udp" 4 0 l
or
diag sniffer packet any "host XXX.XXX.XXX.XXX" 4 0 l for more info
If there is no connection to RADIUS, check/fix things:
1) correct IP address in Client Settings in Windows NPS
2) correct outgoing interface (configurable in CLI only): set source-ip “XXX.XXX.XXX.XXX”
3) Windows Firewall rules. Sometimes it’s easier to disable preconfiured rules for NPS and manually create new ones (thanks, Microsoft, your products are always reliable and predictable)
4) if you’ve configured logging in NPS settings, “If logging fails, discard connection requests” shoud be unchecked

FortiGate routing debug commands:

https://community.fortinet.com/t5/FortiGate/Technical-Tip-FortiGate-routing-debug-commands/ta-p/330125

Continue reading “Fortinet Info”

Windows Applocker Info

Restricting Application Access Using AppLocker:

https://helpcenter.itopia.com/en/articles/4859965-restricting-application-access-using-applocker
https://adamtheautomator.com/windows-10-applocker/

AppLocker configured, Group Policy applied but does not work:

https://www.grouppolicy.biz/2010/08/how-to-use-group-policy-to-control-services/

Probably Application Identity service is not started. Configure Application Identity service startup in GPO:
Computer Configuration > Policies > Windows Settings > Security Settings > System Services > Application Identity

Check this settings applied correctly:
gpresult /h DISK:\GPRESULT.html

It is possible to configure startup of this service on every machine, but it is a waste of s time:
sc config "AppIDSvc" start=auto & net start "AppIDSvc"

Move data from old Windows server to new one saving all users permissions

Shut down all VMs and PCs that might use shared on this server data.

On the old server:
Get and save information about all local accounts:
wmic useraccount get name,sid > D:\old-SIDs.txt
Get and save all permissions in selected folder:
icacls "D:\Data" /save D:\Data-icacls.txt /t /c

On the new server:
Configure new accounts
Get and save information about all local accounts:
wmic useraccount get name,sid > D:\new-SIDs.txt

On your PC:
Replace old SIDs with the new SIDs in ICACLS dump files (copy original dump files first)

On the new server:
Attach disk D: from an old server to the new one
Configure System to own D:
Allow admin to access D: (“This folder only” type)
Restore permissions from icacls dump:
icacls R:\ /restore D:\Data-icacls.txt

Windows Network and Firewall

Block all apps in specified folder to access any network resources outside PC

https://www.tenforums.com/network-sharing/43084-how-block-multiple-exe-files-windows-firewall-post591205.html#post591205

for %%G in (“C:\Program Files (x86)\Test Folder\*.exe”) do (
netsh advfirewall firewall add rule name=”Blocked With Batchfile %%G” dir=in action=block program=”%%G” enable=yes profile=any
netsh advfirewall firewall add rule name=”Blocked With Batchfile %%G” dir=out action=block program=”%%G” enable=yes profile=any
)

Kubernetes

Kubernetes kubectl autocomplete Ubuntu:

https://komodor.com/learn/kubectl-autocomplete-enabling-and-using-in-bash-zsh-and-powershell/
https://stackoverflow.com/a/77694825

apt-get install bash-completion -y
echo ‘source /etc/bash_completion’ >>~/.bashrc
echo ‘source <(kubectl completion bash)’ >>~/.bashrc
source ~/.bashrc

Configure NFS shares in Windows for k8s:

https://operavps.com/docs/install-nfs-server/

Kubernetes autostart Ubuntu:

nano /etc/systemd/system/minikube.service
[Unit]
Description=minikube service autostart
After=docker.service

[Service]
Type=oneshot
ExecStart=/usr/local/bin/minikube –force –driver=docker start
RemainAfterExit=true
ExecStop=/usr/local/bin/minikube stop
StandardOutput=journal
User=root
Group=

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable minikube

reboot

IPSEC vpn info

Phase 1 & 2 encryption algorhithms supported in popular Operating Systems:

https://wiki.mikrotik.com/wiki/Manual:IP/IPsec#Windows_client_configuration

 

Create Ipsec connection in Windows with usage of more secure encryption algorhithms:

https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/vpn/how-to-configure-diffie-hellman-protocol-over-ikev2-vpn-connections

https://forum.netgate.com/topic/150670/safe-ikev2-configuration-for-pfsense-and-windows-10-and-macos

https://learn.microsoft.com/en-us/powershell/module/vpnclient/set-vpnconnectionipsecconfiguration?view=windowsserver2022-ps&viewFallbackFrom=win10-ps

Ansible

Ansible: installation, configuration and use with Windows and Linux:

https://247-it.io/en/ansible-installation-configuration-and-use-with-windows-and-linux/

Ansible: organize your hosts in an inventory file in YAML format:

https://247-it.io/en/ansible-organize-your-hosts-in-an-inventory-file-in-yaml-format/
Which GUI management tools should you recommend?
https://www.reddit.com/r/ansible/comments/pejmkm/which_gui_management_tools_should_you_recommend/?rdt=40820