{"id":6816,"date":"2022-07-17T18:15:04","date_gmt":"2022-07-17T12:45:04","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6816"},"modified":"2022-07-17T18:15:07","modified_gmt":"2022-07-17T12:45:07","slug":"how-to-restrict-s3-bucket-for-specific-ip-address","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-restrict-s3-bucket-for-specific-ip-address\/","title":{"rendered":"HOW TO RESTRICT S3 BUCKET FOR SPECIFIC IP Address?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Step1: Login to the AWS account<br>Step2: Navigate to the S3 bucket and go to permissions<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step3: Click on edit bucket policy and add the below policy:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">{<br>&#8220;Version&#8221;: &#8220;2008-10-17&#8221;,<br>&#8220;Id&#8221;: &#8220;S3PolicyId1&#8221;,<br>&#8220;Statement&#8221;: [<br>{<br>&#8220;Sid&#8221;: &#8220;IPAllow&#8221;,<br>&#8220;Effect&#8221;: &#8220;Deny&#8221;,<br>&#8220;Principal&#8221;: {<br>&#8220;AWS&#8221;: &#8220;<em>&#8221; }, &#8220;Action&#8221;: &#8220;s3:<\/em>&#8220;,<br>&#8220;Resource&#8221;: &#8220;arn:aws:s3:::bucket-name\/*&#8221;,<br>&#8220;Condition&#8221;: {<br>&#8220;NotIpAddress&#8221;: {<br>&#8220;aws:SourceIp&#8221;: [<br>&#8220;ip1&#8221;,<br>&#8220;ip2&#8221;<br>]<br>}<br>}<br>}<br>]<br>}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">  Step 4: Click on save changes<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step1: Login to the AWS accountStep2: Navigate to the S3 bucket and go to permissions Step3: Click on edit bucket [&hellip;]<\/p>\n","protected":false},"author":492,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[804],"class_list":["post-6816","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-aws-s3","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1LW","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/492"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6816"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6816\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}