Posts

OWASP TOP 10 Proactive Controls in Brief

Image
Software Security is a measure concern today. We can no longer tolerate simple security problems leading to a security havoc. Here I want to list the top 10 proactive controls that should be practiced during software development to create a secure software. OWASP Top 10 Proactive controls is a list of security technique that should be considered for every software development. They top 10 controls are listed as follows in the order of their importance, first being the topmost priority. Define Security Requirements A security requirement is a statement of needed security functionality that ensures one of the many different security properties of software being satisfied. OWASP Application Security Verification Standard (ASVS) can be used to define security requirements.  OWASP ASVS  is a catalog of available security requirements and verification criteria. Leverage security frameworks and libraries A developer writing an application might not have sufficient knowledge, ...

Problems faced while updating/upgrading WordPress

Keeping the software up to date is one of the methods to keep your software secure. In this post, I am going to share solutions to some of the common issues you might face while updating/upgrading your WordPress Applications. WordPress is a blogging and content management system based on PHP and MySQL. It is a free and open-source content management system licensed under GPLv2. It started as a blogging platform in 2003. The use of WordPress has exploded and now it is the platform of choice for over 35% of all sites across the web. WordPress has features like Customizable design, Responsive design, SEO friendliness, high security, high performance, powerful media management, ease of use, accessibility, etc. It is very extensive and has over 54,000 plugins. It is, therefore, a platform of choice not just for hobby blogs but also biggest news sites online and online stores. WordPress can be viewed in the following 4 component architecture: WP Core WP Core is a set of code that p...

Setting up LAMP server along with reverse proxy using NGINX

Image
In this post, I am going to show you how you can set up a LAMP server along with reverse proxy using Nginx. The system I am using here is CentOS 8. Here, we will not just install the packages and but also enable SELinux and configure it to work with the LAMP setup. So, we need to set SELinux to enforcing which can be done by running the following command: # setenforce 1 Now that you have enabled SELinux in your Linux system, Let’s install the Apache server by installing httpd package. # yum install httpd -y We don’t want to run Apache in port 80 because we want to run Nginx at port 80 so we configure Apache to run at port 81. For this purpose, edit /etc/httpd/conf/httpd.conf and change line ‘Listen 80’ to ‘Listen 81’. Now start httpd # systemctl enable --now httpd The next step is to install MySQL. In our case, we will be using the MariaDB server which is a fork of MySQL. To install MariaDB run: # yum module install mariadb -y Now start the database se...

Using custom fonts with flutter app

The default fonts in the flutter application are great. However, if we want to have custom fonts in the app, we can do that pretty easily. It’s pretty easy to use. First of all, download the .ttf files of the fonts and add them to the ‘fonts’ directory inside your flutter project. The directory structure should be like: flutter_project/  - android/  - build/  - fonts/  - ios/  - lib/ Now that you have added the font files to the project, update the pubspec.yaml file as follows: fonts : - family : NameOfFont fonts : - asset : fonts/NameOfFont.ttf - asset : fonts/NameOfFont-Black.ttf - family : NameOfSecondFont fonts : - asset : fonts/NameOfSecondFont.ttf Now that the fonts are added, we can set a font as the default font for the whole app by adding the following line to MaterialApp theme: ThemeData ( fontFamily: 'NameOfFont' ), If you want to use it to a specific widget, you can do as follows: Text ...

Load balancing with Pound

Pound is a reverse-proxy load balancing server. It accepts requests from HTTP/HTTPS clients and distributes them to one or more Web servers. The HTTPS requests are decrypted and passed to the back-ends as plain HTTP. If more than one back-end server is defined, Pound chooses one of them randomly, based on defined priorities. By default, Pound keeps track of associations between clients and back-end servers (sessions). Pound can be installed in CentOS with the following command: # yum install epel-release -y # yum install Pound -y Pound can be then configured by editing the file /etc/pound.cfg In case you are using ubuntu, you can install with the following command: # apt-get install pound Then edit the configuration file /etc/pound/pound.cfg You can find an example use of Load Balancing with Pound here. The example uses two NGINX server as backend and uses CentOS with Pound for the reverse-proxy load balancing. The very basic configuration used is as: Daemon 0...

How to install VirtualBox6 in CentOS 8

Image
VirtualBox is a free and open-source hosted hypervisor developed by Oracle Corporation. It runs on Linux, Windows, Mac, and Solaris hosts supporting a large number of guest operating systems. You will find several blog posts about the installation of VirtualBox in the older version of CentOS. Since, CentOS 8 came around two months ago in September 2019, in this post, I will be showing the steps to install VirtualBox 6 in CentOS 8. First of all let’s install the header and development tools: $ sudo yum install -y kernel-devel kernel-headers gcc make perl Now download and import oracle’s public key, this will be used for gpgcheck which verifies the authenticity of the package: $ sudo wget https://www.virtualbox.org/download/oracle_vbox.asc $ sudo rpm --import oracle_vbox.asc VirtualBox is not available in the main repo of CentOS, therefore we need to add the repo that provides VirtualBox. To download virtual box repo run the following command: $ sudo wget http://d...

Schedule your tasks with 'at' utility

Image
Photo by JESHOOTS.COM on Unsplash In this post, I am going to share you about a utility in Linux for scheduling your scripts. I will be showing how you can use a very simple and easy utility called ‘at’. First of all, if its not already install you can install it by running: # yum install at -y Now that at is installed. You can start the atd daemon: # yum start atd We are all set we can now schedule tasks. For our case we will use an example script ‘example.sh’ which will broadcast a message to the wall: echo “Script is running” | wall We will schedule the script to run now: # at -f example.sh now We can run at a specific time as: # at -f example.sh 10:30 We can view the scheduled tasks by running atq command: # atq To remove a task from the at queue, you can run ‘at -d task_number’. For example to remove task with id 4 we would run : # at -d 4 By default the queue name of tasks added with ‘at’ command is a. You can set a new queue n...