<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: israel mvono</title>
    <description>The latest articles on DEV Community by israel mvono (@israelmvono).</description>
    <link>https://dev.to/israelmvono</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F897537%2Fe6cc9f1e-660d-4bcd-a100-b3c95c7ad44c.jpg</url>
      <title>DEV Community: israel mvono</title>
      <link>https://dev.to/israelmvono</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/israelmvono"/>
    <language>en</language>
    <item>
      <title>AMAZON S3 BRAIN DUMP</title>
      <dc:creator>israel mvono</dc:creator>
      <pubDate>Tue, 18 Oct 2022 17:56:02 +0000</pubDate>
      <link>https://dev.to/israelmvono/amazon-s3-brain-dump-58jc</link>
      <guid>https://dev.to/israelmvono/amazon-s3-brain-dump-58jc</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon S3 is one of the main building blocks of AWS.&lt;/li&gt;
&lt;li&gt;It’s advertised as “infinitely scaling” storage.&lt;/li&gt;
&lt;li&gt;Many websites use Amazon S3 as a backbone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Amazon S3 Overview - Buckets&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon S3 allows people to store objects (files) in “buckets”(directories)&lt;/li&gt;
&lt;li&gt;Buckets must have a globally unique name&lt;/li&gt;
&lt;li&gt;Buckets are defined at the region level&lt;/li&gt;
&lt;li&gt;Naming convention
. No uppercase
. No underscore
. 3-63 characters long&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Amazon S3 Overview - Objects&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Objects (files) have a key.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The key is the FULL path:&lt;br&gt;
. S3://my-bucket/&lt;strong&gt;my_file.txt&lt;/strong&gt;&lt;br&gt;
. S3://my-bucket/&lt;strong&gt;my_folder1/another_folder/my_file.txt&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The key is composed of prefix + object name&lt;br&gt;
. S3://my-bucket/my_folder1/another_folder/my_file.txt&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Object values are the content of the body:&lt;br&gt;
. Max object size is 5TB (5000 GB)&lt;br&gt;
. If uploading more than 5GB, must use “multi-part upload”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Metadata (list of text key / value pairs - system or user metadata)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tags (unicode key / value pair - up to 10) - useful for security / lifecycle.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Version ID (if versioning is enabled)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Amazon S3 - Versioning&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can version your files in Amazon S3..&lt;/li&gt;
&lt;li&gt;It is enabled at the bucket level.&lt;/li&gt;
&lt;li&gt;Same key overwrite will increment the “version” : 1, 2, 3...&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is best practice to version your buckets.&lt;br&gt;
. Protect against unintended deletes(ability to restore a version)&lt;br&gt;
. Easy roll back to previous version&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Any file that is not versioned prior to enable versioning will have version “null”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Suspending versioning does not delete the previous versions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Amazon S3 Encryption for Objects&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There are 4 methods of encrypting objects in S3
. SSE-S3: encrypts S3 objects using keys handled and managed by AWS
. SSE-KMS: leverage AWS Key Management Service to manage encryption keys.
. SSE-C: when you want to manage your own encrytion keys.
. Client Side Encryption&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SSE-S3&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSE-S3: encryption using keys handled and managed by Amazon S3.&lt;/li&gt;
&lt;li&gt;Object is encrypted Server Side.&lt;/li&gt;
&lt;li&gt;AES-256 encryption type.&lt;/li&gt;
&lt;li&gt;Must set header: “x-amz-server-side-encryption”:”AES256”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SSE-KMS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSE-KMS: encryption using keys handled and managed by KMS.&lt;/li&gt;
&lt;li&gt;KMS Advantages: user control  + audit trail.&lt;/li&gt;
&lt;li&gt;Object is encrypted Server Side.&lt;/li&gt;
&lt;li&gt;Must set header: “x-amz-server-side-encryption”:”aws:kms”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SSE-C&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSE-C: Server side encryption using data keys fully managed by the customer outside of AWS.&lt;/li&gt;
&lt;li&gt;Amazon S3 does not store the encryption key you provide.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTTPS must be used.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Encryption key must be provided in the HTTP headers, for every HTTP request made.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Client Side Encryption&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client library such as the Amazon S3 Encrytion Client.&lt;/li&gt;
&lt;li&gt;Clients must encrypt data themselves before sending to S3.&lt;/li&gt;
&lt;li&gt;Clients must decrypt data themselves when retrieving from S3.&lt;/li&gt;
&lt;li&gt;Customer fully manages the keys and encryption cycle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Encryption in transit (SSL/TLS)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Amazon S3 exposes:&lt;br&gt;
. HTTP endpoint: non encrypted&lt;br&gt;
. HTTPS endpoint: encryprion in flight&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You are free to use the endpoint you want but HTTPS is recommended.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Most clients would use the HTTPS endpoint by default.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTTPS is mandatory for SSE-C.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Encryption in flight is also called SSL/TLS.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;S3 Security&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;. User based&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IAM policies - which API calls should be allowed for a specific user from IAM console.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;. Resource based&lt;/strong&gt;&lt;br&gt;
. Bucket policies - bucket wide rules from the S3 console - allows cross account.&lt;br&gt;
. Object Access Control List (ACL) - finer grain&lt;br&gt;
. Bucket Access Control List (ACL) - less common&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;S3 Bucket Policies&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;. JSON based policies&lt;/strong&gt;&lt;br&gt;
   . Resources: buckets and objects&lt;br&gt;
   . Actions: set of API to Allow or Deny&lt;br&gt;
   . Effect: Allow/ Deny&lt;br&gt;
   . Principal: the account or user to apply the policy to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;{&lt;br&gt;
     “version” : “2022-10-18”&lt;br&gt;
     “Statement” : [&lt;br&gt;
        {&lt;br&gt;
           “Sid” : “PublicRead”,&lt;br&gt;
           “Effect” : “Allow”,&lt;br&gt;
           “Principal” : “*”,&lt;br&gt;
           “Action” : [&lt;br&gt;
             “S3: GetObject”&lt;br&gt;
           ],&lt;br&gt;
           “Resource” : [&lt;br&gt;
              “arn:aws:S3:::examplebucket / * “&lt;br&gt;
           ]&lt;br&gt;
         }&lt;br&gt;
     ]&lt;br&gt;
   }&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;. Use S3 bucket for policy to:&lt;/strong&gt;&lt;br&gt;
     . Grant public access to the bucket.&lt;br&gt;
     . Force objects to be encrypted at upload.&lt;br&gt;
     . Grant access to another account (cross Account)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bucket Settings for Block Public Access&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block public access to buckets and objects granted through:
. new access control lists (ACLs)
. any access control lists (ACLs)
. new public bucket or access point policies &lt;/li&gt;
&lt;li&gt;Block public and cross-account access to buckets and objects through any public bucket or access point policies.&lt;/li&gt;
&lt;li&gt;These settings were created to prevent company data leaks.&lt;/li&gt;
&lt;li&gt;If you know your bucket should never be public, leave these on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;S3 Security  - Other&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;. Networking&lt;/strong&gt;&lt;br&gt;
      . Supports VPC Endpoints (for instances in VPC without www internet)&lt;br&gt;
&lt;strong&gt;. Logging and Audit:&lt;/strong&gt;&lt;br&gt;
      . S3 Access Logs can be stored in other S3 bucket.&lt;br&gt;
      . API calls can be logged in AWS cloudTrail.&lt;br&gt;
&lt;strong&gt;. User Security:&lt;/strong&gt;&lt;br&gt;
      . MFA Delete: MFA( multi factor authentication) can be required in versioned buckets to delete objects.&lt;br&gt;
. Pre-signed URLs: URLs that are valid only fro a limited time (ex: premium video service for logged in users)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CORS - Explained&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An origin is a scheme (protocol), host(domain) and port
. E.g. : &lt;a href="https://www.plentyofbananas.com"&gt;https://www.plentyofbananas.com&lt;/a&gt; (implied port is 443 for HTTPS, 80 for HTTP)&lt;/li&gt;
&lt;li&gt;CORS means &lt;strong&gt;Cross-Origin Resource Sharing&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Web Browser based mechanism to allow requests to other origins while visiting the main origin.&lt;/li&gt;
&lt;li&gt;Same origin: &lt;a href="http://plentyofbananas.com/v1"&gt;http://plentyofbananas.com/v1&lt;/a&gt; &amp;amp; &lt;a href="http://plentyofbananas/v2"&gt;http://plentyofbananas/v2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Different origins: &lt;a href="http://www.plentyofbananas.com"&gt;http://www.plentyofbananas.com&lt;/a&gt; &amp;amp; &lt;a href="http://plentyofstrawberries.com"&gt;http://plentyofstrawberries.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The requests won’t be fulfilled unlessthe other origin allows for the requests, using CORS Headers ( ex: Access - Control - Allow - Origin)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;S3 CORS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If a client does a cross-origin request on your S3 bucket, you need to enable the correct CORS headers.&lt;/li&gt;
&lt;li&gt;You can allow for a specific origin or for * (all origins)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>amazon</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>AWS: Identity and Access Management[cheatsheet]</title>
      <dc:creator>israel mvono</dc:creator>
      <pubDate>Thu, 04 Aug 2022 16:28:00 +0000</pubDate>
      <link>https://dev.to/israelmvono/aws-identity-and-access-managementcheatsheet-228c</link>
      <guid>https://dev.to/israelmvono/aws-identity-and-access-managementcheatsheet-228c</guid>
      <description>&lt;p&gt;As I begin my journey studying towards being a devOps engineer, I would like to share what I learn throughout my journey. I am currently studying for the &lt;strong&gt;AWS CLOUD SOLUTIONS ARCHITECT ASSOCIATE EXAM&lt;/strong&gt;&lt;br&gt;
In this article, I will share a summary of &lt;strong&gt;IAM &amp;amp; AWS CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;br&gt;
-IAM = Identity and Access Management&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Users are people within your organization and they can be grouped[it’s best practice to always assign each member under a group(s). A user can be a member of more than one group.&lt;/li&gt;
&lt;li&gt;Groups can only contain users but not other groups.&lt;/li&gt;
&lt;li&gt;Policies define the permissions of the users.[best practice: use the least privilege principle; simply don’t give more permissions than the user needs]&lt;/li&gt;
&lt;li&gt;Password policy:- you can set up a password policy that ensures higher security for your account.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multi-Factor Authentication – MFA&lt;br&gt;
&lt;strong&gt;. protects your root accounts and IAM users.&lt;br&gt;
. MFA = password you know + security device you know&lt;br&gt;
. If a password is stolen or hacked, the account is not compromised.&lt;br&gt;
.You can use a virtual MFA device[google authenticator, authy} or a U2F Security Key{yubikey by yubico}&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To access AWS, you have three options:&lt;br&gt;
&lt;strong&gt;. AWS Management Console{protected by password + MFA}&lt;br&gt;
  . AWS Command Line Interface(CLI){protected by access keys}&lt;br&gt;
      . AWS Software Development Kit(SDK) – for code {protected by access keys}&lt;/strong&gt;&lt;br&gt;
-Access keys are generated through the AWS console&lt;br&gt;
    &lt;strong&gt;. Access Key ID ~= username&lt;br&gt;
. Secret Access Key ~= password&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS cloudshell is a CLI in the cloud.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IAM Credentials Report(account level): this is a report that lists all your account’s users and the status of their various credentials.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IAM Access Advisor(user-level): shows the service permissions granted to a user when those services were last accessed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;IAM Guidelines and Best Practices&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don’t use the root account except for AWS account setup&lt;/li&gt;
&lt;li&gt;One physical user = One AWS user&lt;/li&gt;
&lt;li&gt;Assign users to groups and assign permissions to groups&lt;/li&gt;
&lt;li&gt;Create a strong password policy&lt;/li&gt;
&lt;li&gt;Use and enforce the use of Multi-Factor Authentication(MFA)&lt;/li&gt;
&lt;li&gt;Create and use roles for giving permissions to AWS services&lt;/li&gt;
&lt;li&gt;Use Access Keys for Programmatic Access(CLI/SDK)&lt;/li&gt;
&lt;li&gt;Audit permissions of your account with the IAM credentials report and IAM Access Advisor&lt;/li&gt;
&lt;li&gt;Never share IAM users and Access Keys&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cloudskills</category>
      <category>aws</category>
      <category>beginners</category>
      <category>solutionsarchitect</category>
    </item>
  </channel>
</rss>
