Postingan

Menampilkan postingan dari September, 2019

How to configure HTTPS in IIS Windows Server via PowerShell

Cara konfigurasi HTTPS di IIS Windows Server melalui PowerShell Untuk konfigurasi HTTP melalui PowerShell bisa baca disini  https://nciptandani.blogspot.com/2019/06/cara-konfigurasi-web-server-iis-di.html Untuk membuat server CA dan webserver sertifikat template https://nciptandani.blogspot.com/2018/08/pembahasan-itnsa-module-b-windows-ca.html Kemudian dari webserver sertifikat template tersebut bisa digunakan untuk membuat sertifikat, bisa melalui MMC -> Certificates -> Local computar -> Personal -> klik kanan ceritificates -> All tasks ->  request new certificate -> next -> pilih webserver template yang sudah dibuat -> kemudian isi informasi seperti common name, subject alternative name dengan benar. Sertifikat yang akan dipasang dengan format PFX, file sertifikat PFX ini bisa didapatkan dari server CA. Cara export PFX dari windows server CA  https://www.youtube.com/watch?v=m157RGX6S1g Kemudian import sertifikat tersebut ke server IIS

Contoh pembahasan LKS ITNSA 2019 VPN Configuration

Pada tutorial kali ini akan mempraktekkan VPN  site to site  dengan menggunakan ASA, secara fungsi VPN  site to site  ini akan mengamankan jaringan antar site misalnya site kantor pusat dan kantor cabang yang melalui jaringan internet. Didalam pembuatan VPN site to site ini akan ada beberapa istilah seperti IKEV2, IPSEC,  Phase 1 parameters (Hash, Encryption, DH group, Authentication), Phase 2 parameters (Protocol, Encryption, Hash) . Yang perlu diperhatikan pada saat konfigurasi adalah parameter-parameter tersebut harus sesuai/ matching antar kedua router ASA. Sebelum melakukan konfigurasi VPN site to site IKE versi 2 dengan ASA pastikan terlebih dahulu koneksi IP nya bisa berjalan dengan baik. Contoh topologi  HQLAN---------FW1------------INTERNET--------------FW2----------BRLAN Kemudian lakukan langkah-langkah konfigurasi ini: Note: Pembahasan ini hanyalah contoh, untuk attribute,environment konfigurasi seperti  Topology, Hostname, IP, Parameters, Subnet, Traffic, ACL, P

How to configur proftpd for webmaster

OS: Debian 10 Install an FTP-server using proftpd #apt-get install proftpd Change the user and group owner of /var/www is www-data and add full permission to user and group. #chown -R www-data:www-data /var/www/ #chmod -R 775 /var/www Add a user called "webmaster" with the password "$3curE" and the root directory is the same directory as the web-root /var/www #useradd -d /var/www -s /bin/false webmaster #passwd webmaster Add a webmaster user to the www-data group as primary group. #usermod -g www-data webmaster Configure proftpd.conf - User must not leave its home directory. - Disable shell access for webmaster. - When uploading files, the group is set to www-data. DefaultRoot                     ~ RequireValidShell           off #service proftpd restart

How to create SSH Key for connecting to the instance.

On Linux or macOS, we can generate a key with the ssh-keygen command. Open a terminal and then use the ssh-keygen command to generate a new key. Specify the -C flag to add a comment with your username. ssh-keygen -t rsa -f ~/.ssh/[KEY_FILENAME] -C [USERNAME] where: [KEY_FILENAME] is the name that you want to use for your SSH key files. For example, a filename of myserver-ssh-key generates a private key file named myserver-ssh-key and a public key file named myserver-ssh-key.pub . [USERNAME] is the username on the instance. This command generates a private SSH key file and a matching public SSH key with the following structure: ssh-rsa [KEY_VALUE] [USERNAME] where: [KEY_VALUE] is the key value that you generated. [USERNAME] is the user on instance that this key applies to. Restrict access to your private key so that only you can read it and nobody can write to it. chmod 400 ~/.ssh/[KEY_FILENAME] Locate the public SSH keys to add to instance. It  can be done  v

Konfigurasi Libnss-LDAP

OS: Debian 10 Libnss-LDAP ini bisa dimanfaatkan sebagai perantara untuk autentikasi ke LDAP server yang akan digunakan sebagai user untuk login system, file server, mail server, dll. Sebelumnya pastikan dulu LDAP Server bisa di query dengan baik dengan perintah berikut #ldapsearch -h <ldapserver> -b dc=<your>,dc=<domain> -x uid=<username> Untuk installasi paket nya seperti berikut: #apt-get install libnss-ldapd konfigurasi libnss-ldapd Pada saat installasi libnss-ldapd akan muncul dialog untuk mengisi informasi LDAP Server dan LDAP server tersebut akan digunakan sebagai apa pada sistem untuk autentikasi user cukup memilih passwd Dialog pada saat  instalasi juga masih bisa di konfigurasi melalui #nano /etc/nslcd.conf uri ldap://192.168.1.1 # The search base that will be used for all queries. base dc=idnux,dc=com # The LDAP protocol version to use. #ldap_version 3 # The DN to bind with for normal lookups. binddn cn=admin,dc=idnux,dc=com

How to make an CA, Intermediate CA / Sub CA, and Server Certificate with OpenSSL command

Gambar
- Keep RootCA.key and IntermediateCA.key securely. - Upload RootCA.crt and IntermediateCA.crt to client's system or browser. - Use IntermediateCA to sign server certificate needs (webserver, FTP server, mail server, etc) This configuration just example, configure the certificate name, attribute according to your needs. In this tutorial we use OpenSSL command but you can also use CA.pl script from OpenSSL. 1. Generate Root Certificate key. openssl genrsa -out RootCA.key 4096 2. Generate Root certificate. openssl req -new -x509 -days 1826 -key RootCA.key -out RootCA.crt Generate Intermediate CA Create a file subca.conf with the following contents: 1. Generate Intermediate CA certificate key openssl genrsa -out IntermediateCA.key 4096 2. Generate Intermediate CA CSR . openssl req -new -key IntermediateCA.key -out IntermediateCA.csr 3. Sign the Intermediate CA by the Root CA. openssl x509 -extfile subca.conf -extensions v3_subca -req -days

How to make a root CA

Gambar
This is how to  make a self signed root CA With OpenSSL command With Windows CA via PowerShell This above command install a new Standalone Root CA with default settings. Read more:  https://docs.microsoft.com/en-us/powershell/module/adcsdeployment/install-adcscertificationauthority?view=win10-ps Import Root CA on Windows with Powershell

How to Install VPN software

Untuk di GNU/Linux misalnya pada Debian apt-get install openvpn https://community.openvpn.net/openvpn/wiki/HOWTO apt-get install strongswan xl2tpd https://wiki.strongswan.org/projects/strongswan/wiki Untuk di Cisco misalnya pada IOS, ASA Cek IOS apakah sudah mempunyai security license show version https://www.cisco.com/c/en/us/td/docs/security/vpn_modules/6342/vpn_cg.html https://www.cisco.com/c/en/us/td/docs/security/asa/asa96/configuration/vpn/asa-96-vpn-config.html Untuk di Microsoft misalnya pada Windows Server Core Install-WindowsFeature RemoteAccess Install-WindowsFeature RSAT-RemoteAccess-PowerShell Install-WindowsFeature Routing https://docs.microsoft.com/en-us/powershell/module/remoteaccess/ Paket-paket software diatas semuanya bisa digunakan untuk men-implementasikan konsep VPN PPTP, SSL, IKEV, dan L2TP/IPSEC.

Postgresql trust authentication on pg_hba.conf

When trust authentication is specified, PostgreSQL assumes that anyone who can connect to the server is authorized to access the database with whatever database user name they specify (even superuser names). Of course, restrictions made in the database and user columns still apply. This method should only be used when there is adequate operating-system-level protection on connections to the server. vi /var/lib/pgsql/data/pg_hba.conf # "local" is for Unix domain socket connections only local   all             all                                     trust login psql -U postgres

How to backup and restore PostgreSQL databases with crontab

OS: Centos7 Database server: PostgreSQL 9 Install database server, membuat user dan databasenya https://nciptandani.blogspot.com/2019/01/rangkuman-install-database-postgresql.html Berikut adalah script untuk melakukan backup pg_dump -U db_user -h ip_address -F t db_name > /path/to/your/file/dump_name.tar -U = untuk user apa yang akan konek ke database -F = untuk format file p – plain-text SQL script c – custom-format archive d – directory-format archive t – tar-format archive Sekedar contoh database dibackup misalnya setiap menit: pg_dump -U dev10 -h 10.148.0.6 -F -t  dev10db > /backup/dev10db.$(date +%Y-%b-%d-%H-%).tar Hasil nama file backup dev10db.2019-Sep-03-15-10-03.sql (file pada tanggal 3 september 2019 pada jam 15 menit 10 dan detik ke 3 Simpan password postgresql server di file vi ~/.pgpass *:5432:*:username:password chmod 0600 ~/.pgpass Kemudian akan membuat crontab nya masuk ke crontab file vi /etc/crontab kemudian tamb

Basic How to Operate Docker

Seperti yang kita tahu bahwa container lebih ringan daripada virtual machine karena container menggunakan shared kernel dari host, namun untuk operasional sama seperti virtual machine yang bisa di create, start, stop, run, dll. Berikut adalah perintah-perintah dasar container menggunakan docker : Example: Download centos image Image ini yang akan digunakan sebagai blueprint dari container docker pull centos Melihat image yang sudah di download docker images Membuat/menjalankan container docker run -t -d --hostname=centos7-srv1 --name centos7-srv1 centos Masuk ke terminal container docker exec -it centos7-srv1 bash Melihat proses container docker ps -a Start docker docker start container_name Stop container docker stop container_name Delete container docker rm container_name Help man docker