Skip to main content

Posts

Setting up Email Address in AWS - Workmail

Hi all, Today I came up with a situation to create email address in AWS and landed in AWS Workmail. Prerequisites: Domain Registrar login details for updating the NS or Dns records. If your registrar is not providing dns management then use the AWS Route53 service for managing the dns records. In this service we need to setup this as below: 1) Create an Organization. The Web application url  will have a tail end like  .awsapps.com/mail  . If your organization is abc then the workmail web application url will be like https://abc.awsapps.com/mail 2) After creating the organization you need to click on it and now create the Domain for email address. 3) Once you create the domain , it should be verified by adding the TXT dns records and the remaining MX, CNAME and SPF records in the dns management (Route53)         > Verify domain ownership (required)         > Finalize mail setup (required)   ...

Restricting a user to view only specific S3 Buckets

                          Today I came across a situation to implement vooplayer along with aws s3 bucket for uploading videos to the s3 bucket. The issue is that for integrating the voopler the IAM user should  needs  s3 admin permissions as the vooplayer itself will create an s3 bucket during the integration, name starting with "vooplayerv4- ". The issue with this is that the user have access to all the buckets and its contents. So to restrict access for this user only to the bucket which belongs to him I have created a policy with the help of AWS support and sharing the same below: {     "Version": "2012-10-17",     "Statement": [         {             "Sid": "VisualEditor0",             "Effect": "Allow",             "Action": [             ...

Enabling Web Application Firewall (Modsecurity) along with NGINX

Initially remove the nginx current version using the below command,as NGINX 1.11.5 or later is required. sudo apt-get purge nginx nginx-common 1 – Install NGINX        cd /tmp/ && wget http://nginx.org/keys/nginx_signing.key        sudo apt-key add nginx_signing.key        sudo sh -c "echo 'deb http://nginx.org/packages/mainline/ubuntu/ '$(lsb_release -cs)' nginx' > /etc/apt/sources.list.d/nginx.list"        sudo apt-get remove nginx        sudo apt-get update        sudo apt install nginx=1.13.1-1~xenial        nginx -V 2 – Install Prerequisite Packages               pt-get install -y apt-utils autoconf automake build-essential git libcurl4-openssl-dev libgeoip-dev liblmdb-dev libpcre++-dev libtool libxml2-dev libyajl-dev pkgconf wget zlib1g-dev 3 – Download and Compile the ModSecuri...

AWS Command line script for creating basic VPC environment.

#!/bin/bash ################################### #Created on 27-Jun-2018 #Purpose : This script will Create a VPC/Subnet/Routetable/Internetgateway/Natgateway and associate them to the corresponding subnets #Modified on : 13-Sep-2018 #################################### vpcName="My-VPC" vpcCidrBlock="10.0.0.0/16" PubsubNetCidrBlock="10.0.1.0/24" PrvsubNetCidrBlock="10.0.2.0/24" pubAvailabilityZone="ap-northeast-1a" prvAvailabilityZone="ap-northeast-1c" pubSubnetName="PublicSubnet-My" prvSubnetName="PrivateSubnet-My" PubRouteTableName="MyPublicRoute" PrvRouteTableName="MyPrivateRoute" destinationCidrBlock="0.0.0.0/0" #Create a VPC with a 10.0.0.0/16 CIDR block. aws_response=$(aws ec2 create-vpc --cidr-block "$vpcCidrBlock" --output json) vpcId=$(echo -e "$aws_response" |  /usr/bin/jq '.Vpc.VpcId' | tr -d '"') #nam...

Sound issue after connecting Headset to your ubuntu Laptop

It was really annoying when we do whatever we can , alsamixer .. rebooting your machine.. and still you will not hear anything after connecting your headset. Just give the below command : alsactl restore jino@ndz:~$ alsactl restore alsactl: state_lock:125: file /var/lib/alsa/asound.state lock error: File exists alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: File exists Found hardware: "HDA-Intel" "Realtek ALC233" "HDA:10ec0235,1179f912,00100002 HDA:80862882,1179f91b,00100000" "0x1179" "0xf91b" Hardware is initialized using a generic method This immediately "restores" the headphones for me. Must be a bug in Ubuntu 16.04. Cheers.

How to give Internet Access to a Private Subnet non Public IP EC2 instance without NAT Instance.

In some cases we couldn't use public ip address not even an elastic ip for your ec2 instance , for example PCI audit related situations. But you should give internet access to your ec2 app servers to sent notification or alert mails to outside. In that case you can use the NAT Gateway for doing this. 1. First Create a NAT gateway in VPC section.          While creating the NAT Gateway, you should give the subnet as the Public Subnet having route table target as an "Internet Gateway". 2. Now edit your route table associated with your private EC2's subnet and make the target as "Nat gateway ID" That is all , now you will get internet access to your private EC2 instance, without public ip or elastic ip and having only Private ip in the instance description session.

MFA with Googleauthenticator for EC2 Instances.

First Make sure that the server time and the mobile time as same. root@ip-xx-xx-xx-xx:~# apt-get update root@ip-xx-xx-xx-xx:~# apt-get upgrade ubuntu@ip-xx-xx-xx-xx:~ sudo apt-get install libpam-google-authenticator ubuntu@ip-xx-xx-xx-xx:~ sudo vi /etc/pam.d/sshd At the start of the file, add the following line, then save and exit. auth required pam_google_authenticator.so nullok This will mean that users who don’t run Google Authenticator initialization won’t be asked for a second authentication. ubuntu@ip-xx-xx-xx-xx:~$ sudo vi /etc/ssh/sshd_config PasswordAuthentication yes ChallengeResponseAuthentication yes wq! ubuntu@ip-xx-xx-xx-xx:~$ google-authenticator Do you want authentication tokens to be time-based (y/n) y This will give a link like this , you can scan the QR code with the mobile. https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/ubuntu@xx.xx.xx.xx Do you want me to update your "/home/ubuntu/.google_authenticato...