{"id":10037,"date":"2022-03-15T17:22:04","date_gmt":"2022-03-15T11:52:04","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/?p=10037"},"modified":"2022-03-15T17:22:04","modified_gmt":"2022-03-15T11:52:04","slug":"know-how-to-access-s3-bucket-without-iam-roles-and-use-cases","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2022\/03\/15\/know-how-to-access-s3-bucket-without-iam-roles-and-use-cases\/","title":{"rendered":"Know How to Access S3 Bucket without IAM Roles and Use Cases"},"content":{"rendered":"\n<p class=\"has-text-align-justify\">We all have used IAM credentials to access our S3 buckets. But it&#8217;s not a very safe or recommended practice to keep our Access keys and Secrets stored in a server or hard code them in our codebase.<br>Even if we have to use keys, we must have some mechanism in place to rotate the keys very frequently (eg: using Hashicorp Vault). Another widely adopted method is to use IAM roles attached on the EC2 instance or the AWS service accessing the bucket.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">But, what if we need access to the bucket from an on-premise Data Center where we can not attach an IAM role?<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Yes, we can obviously use IAM credentials and secret tokens with the rotating mechanism. But setting up the key rotation mechanism itself could be another overhead if we do not have one already in place. What if we do not require keys or roles without making the bucket public?<br><br>In this blog, I will make an attempt to cater to this problem with another alternate and easy solution.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"has-text-align-justify\">Let&#8217;s first learn how we can access an S3 bucket <strong>without<\/strong> IAM credentials or IAM roles. Then we can move to the part of accessing it from the Data Center.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">We need to make two small changes in order to achieve the same. In this example, I have created a bucket named &#8211; \u201cs3-access-test-techdemos\u201d with all the default settings.<br>Now, we can see as I have no AWS credentials configured, hence I am <strong>not<\/strong> able to list or access the s3 bucket.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/1I0LwxZjM68iTY4grFW4ersnKx5FCyBJiQ7VG3cpsKV86Ka-jb4oHRxdBDknU762RZJwoujk2P8adImjf0rZvL_NFeIA0jotaBFWaIO-DVYJS5P6ogdE7FTmjZL0Gz4dw5SZObG5\" width=\"708\" height=\"116\"><\/p>\n\n\n\n<p><strong>Step 1:&nbsp;<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify\">I will edit the S3 bucket policy and change it. The bucket policy below is to allow accessing the bucket from my ISP&#8217;s router public IP address. You can change it to your\u2019s own. (Run curl ifconfig.me or visit https:\/\/whatismyipaddress.com\/)<br>The bucket policy would look something like below:-<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/r3opcaGV9MhLN1dA3I8XH4VZDzwr9lri2PccylduEbkbrbvAJQX3Qj3ATP9tpVN9Ilb1NH-_d8jWvA4X3_MQkU_DfcTHvzUUpFmhn3ixFRRGfPuEpvhbzCDwsZrgj3noc7LY5Y5S\" width=\"716\" height=\"485\"><\/p>\n\n\n\n<p class=\"has-text-align-justify\">Code link is given <a rel=\"noreferrer noopener\" href=\"https:\/\/raw.githubusercontent.com\/covidboy\/code\/main\/s3_bucket_policy\" target=\"_blank\">here<\/a><br><br>With this bucket policy we are allowing access to publicly (<em>&#8220;Principal&#8221;: &#8220;*&#8221;<\/em>) and hence do not require IAM credentials or roles. But at the same time restricting access from only <em>IpAddress: 45.64.225.122<\/em><br><br><\/p>\n\n\n\n<p><strong>Step 2<\/strong>:&nbsp;<\/p>\n\n\n\n<p>Go to CLI and update the command by appending \u201c<code>--no-sign-request<\/code>\u201d&nbsp;<\/p>\n\n\n\n<p><code>aws s3 ls &lt;your-bucket-name&gt; --no-sign-request<\/code><br><\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/BxUFPir2621zH7nNXlobuinhtA1MjSsPdiYSAB2lFlhyie6xwRkgFPCpmp403ygYsQVS89xWsEyClihLMxBdaIyAGlc5Qur07j-mZY9lW-yeXI6nU1tXFI2V6T_exDPKGhSKQ-OI\" width=\"708\" height=\"217\"><\/p>\n\n\n\n<p>As you can see the bucket has been listed. Similarly, we can upload or download files to S3.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/bID6unRPCd9NAFYEZ1LPCX2hFTufPE5QcYS361KQJMwJWVT4jZ982ZYAhaDDtGlyO54VFn1B6E1VDgCOgHpht6RdxjgnwrL2KcSVz90wNz8zx7rdCIw2vtbveHW14uVt0UBl3FrW\" width=\"708\" height=\"55\"><\/p>\n\n\n\n<p class=\"has-text-align-justify\">When we run an AWS CLI command, in the backend a request URL is generated using the AWS credentials we provide, which determines whether we have access to the bucket or not. Usually, it is called the signed URL.&nbsp;<br>In our case, we haven\u2019t configured any credentials.<br>Basically, &#8211;no-sign-request (boolean) means&nbsp; AWS CLI will not sign the requests when a request URL is generated. i.e credentials will not be loaded if this argument is provided. We are doing this because our bucket is always accessible from my public IP \u2192 <em>45.64.225.122<\/em>.<\/p>\n\n\n\n<p>This IP could be our Data Center end router, Ip. but that will not be a very recommended method to access buckets.<\/p>\n\n\n\n<p>Now that we are able to access the bucket we can think of its use cases.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ol><li><strong>Accessing the bucket from on-premise data center<\/strong> :-<\/li><\/ol>\n\n\n\n<p class=\"has-text-align-justify\">Since in this article, we are not interested in accessing our S3 bucket\/s using IAM credentials\/roles from an on-premise data center, hence we will use solutions like <strong><em>AWS Direct Connect<\/em><\/strong> to connect the <strong><em>AWS Cloud services<\/em><\/strong> from on-premise.<\/p>\n\n\n\n<p>After AWS Direct Connect connections have been established, we can establish access to Amazon S3 in the following ways:<\/p>\n\n\n\n<ul><li>Use a public IP address (Public VIF) over Direct Connect&nbsp;<\/li><li>Use a private IP (Private VIF) address over Direct Connect (with an<a href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/privatelink\/vpce-interface.html\" target=\"_blank\" rel=\"noopener\"> interface VPC <\/a><a href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/privatelink\/vpce-interface.html\" target=\"_blank\" rel=\"noreferrer noopener\">endpoint<\/a>)<\/li><\/ul>\n\n\n\n<p>See this doc <a href=\"https:\/\/aws.amazon.com\/premiumsupport\/knowledge-center\/s3-bucket-access-direct-connect\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a> to know how to connect to S3 over Direct Connect.<\/p>\n\n\n\n<p>(i) Using Public VIF we can access all Public AWS services. Eg: S3, EC2 using public Ip addresses.<\/p>\n\n\n\n<p>See the document <a rel=\"noreferrer noopener\" href=\"https:\/\/aws.amazon.com\/premiumsupport\/knowledge-center\/connect-private-network-dx-vif\/\" target=\"_blank\">here<\/a> to learn more.<br><br>Our bucket policy might look something like this &#8211;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"Version\": \"2012-10-17\",\n    \"Id\": \"Policy1415115909152\",\n    \"Statement\": &#091;\n        {\n            \"Sid\": \"Access-to-specific-PublicIP-only\",\n            \"Effect\": \"Allow\",\n            \"Principal\": \"*\",\n            \"Action\": \"s3:*\",\n            \"Resource\": &#091;\n                \"arn:aws:s3:::s3-access-test-techdemos\",\n                \"arn:aws:s3:::s3-access-test-techdemos\/*\"\n            ],\n            \"Condition\": {\n                \"IpAddress\": {\n                    \"aws:SourceIp\": \"&lt;local peer Ip address&gt;\"\n                }\n            }\n        }\n    ]\n}<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-justify\">(ii) If we use Private VIF (which is basically used to access an Amazon VPC using private Ip addresses) we will have to use an AWS VPC Interface endpoint in between to access S3. It is because &#8211; we will use the Amazon private link for S3 to access S3 rather than the public <a href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/userguide\/managed-prefix-lists.html\" target=\"_blank\" rel=\"noreferrer noopener\">prefix lists<\/a> of S3 which we did in the earlier case.<\/p>\n\n\n\n<p><strong>Note<\/strong>: On-premises traffic can&#8217;t traverse the<a href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/privatelink\/vpce-gateway.html\" target=\"_blank\" rel=\"noopener\"> <\/a><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/privatelink\/vpce-gateway.html\" target=\"_blank\">Gateway<\/a><a href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/privatelink\/vpce-gateway.html\" target=\"_blank\" rel=\"noopener\"> VPC endpoint<\/a>.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Interface endpoints are actually one or more elastic network interfaces (ENIs) that are assigned private IP addresses from subnets in your VPC. Requests that are made to interface endpoints for Amazon S3 are automatically routed to Amazon S3 on the Amazon network. And we can access interface endpoints in our VPC from on-premises applications through AWS Direct Connect or <strong>AWS Virtual Private Network <\/strong>(AWS VPN).<\/p>\n\n\n\n<p>See these articles to know more &#8211; <a href=\"https:\/\/aws.amazon.com\/blogs\/networking-and-content-delivery\/secure-hybrid-access-to-amazon-s3-using-aws-privatelink\/\" target=\"_blank\" rel=\"noopener\">Secure <\/a><a href=\"https:\/\/aws.amazon.com\/blogs\/networking-and-content-delivery\/secure-hybrid-access-to-amazon-s3-using-aws-privatelink\/\" target=\"_blank\" rel=\"noreferrer noopener\">hybrid<\/a><a href=\"https:\/\/aws.amazon.com\/blogs\/networking-and-content-delivery\/secure-hybrid-access-to-amazon-s3-using-aws-privatelink\/\" target=\"_blank\" rel=\"noopener\"> access to Amazon S3 using AWS PrivateLink<\/a>&nbsp;and <a href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/privatelink\/vpce-interface.html\" target=\"_blank\" rel=\"noopener\">Interface VPC endpoints (AWS PrivateLink)<\/a><\/p>\n\n\n\n<p>Since now we will access S3 through the private link, our bucket policy should allow the VPC Interface endpoint rather than any IP. It would look like below &#8211;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"Version\": \"2012-10-17\",\n    \"Id\": \"Policy1415115909152\",\n    \"Statement\": &#091;\n        {\n            \"Sid\": \"Access-to-specific-VPCE-only\",\n            \"Effect\": \"Allow\",\n            \"Principal\": \"*\",\n            \"Action\": \"s3:*\",\n            \"Resource\": &#091;\n                \"arn:aws:s3:::s3-access-test-techdemos\",\n                \"arn:aws:s3:::s3-access-test-techdemos\/*\"\n            ],\n            \"Condition\": {\n                \"StringEquals\": {\n                    \"aws:sourceVpce\": \"vpce-0809dxxxxyyyy0045\"\n                }\n            }\n        }\n    ]\n}<\/code><\/pre>\n\n\n\n<p>Next,<\/p>\n\n\n\n<p>When we use Interface endpoints for S3 access points we would need to modify our API requests slightly.<\/p>\n\n\n\n<p>See <a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/userguide\/privatelink-interface-endpoints.html#accessing-bucket-and-aps-from-interface-endpoints\" target=\"_blank\" rel=\"noopener\">Accessing Amazon S3 interface endpoints<\/a><\/p>\n\n\n\n<p><br>So our final request Url from the On-premise server\/application would look something like below &#8211;<br><code>aws s3 \u2013no-sign-request --region ap-south-1 --endpoint-url https:\/\/bucket.vpce-1a2b3c4d-5e6f.s3.us-east-1.vpce.amazonaws.com ls s3:\/\/my-bucket\/<\/code><\/p>\n\n\n\n<p>(again <code>--no-sign-request<\/code> would be added since we would not be using Aws IAM Credentials)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>2. <strong>Accessing bucket from a private subnet in a protected zone<\/strong>:-<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><br>We can also access S3 buckets securely and privately without traversing through the public internet from a private subnet in a protected zone (which has no access to the internet i.e no NAT gateway and can be only SSH from a jump server\/bastion host).<br><br><br>(<strong>Note:<\/strong> since our instance would not have access to internet we must launch the instance from an AMI which has AWS CLI pre-installed)<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Next, to access S3 from a private subnet in the protected zone we can use the Gateway Interface endpoint for S3. We could also use an Interface endpoint but Gateway endpoints are not-chargeable and the former is chargeable.<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><br>Follow doc <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/privatelink\/vpce-gateway.html\" target=\"_blank\">here<\/a><a href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/privatelink\/vpce-gateway.html\" target=\"_blank\" rel=\"noopener\"><br><br><\/a>If we allow the <strong>gateway-vpce<\/strong> in our bucket policy and append <strong><code>--no-sign-request<\/code> <\/strong>in our API request, then we can access the bucket privately even without attaching an IAM role or putting any IAM credentials.<\/p>\n\n\n\n<p>Thanks for reading. Hope you found it useful!<\/p>\n\n\n\n<p><br><strong style=\"font-weight:bold;\">Blog Pundit:<\/strong> <a href=\"https:\/\/opstree.com\/blog\/\/author\/bhupendersinghb5dca0b393\/\"><strong>Bhupender Rawat<\/strong><\/a> and <a href=\"https:\/\/opstree.com\/blog\/\/author\/adeel109\/\"><strong>Adeel Ahmad<\/strong><\/a><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/www.opstree.com\/contact-us?utm_source=blog&amp;utm_medium=wordpress+&amp;utm_campaign=Know-How-to-Access-S3-Bucket-without-IAM-Roles-and-Use-Cases\">Opstree<\/a><\/strong><a rel=\"noreferrer noopener\" href=\"https:\/\/www.opstree.com\/contact-us?utm_source=blog&amp;utm_medium=wordpress+&amp;utm_campaign=AWS-Elastic-Network-Interface\" target=\"_blank\"> <\/a>is an End to End DevOps solution provider<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link\" href=\"https:\/\/www.opstree.com\/contact-us\" target=\"_blank\" rel=\"noreferrer noopener\">CONTACT US<\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-center\"><strong>Connect Us <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-social-links aligncenter is-content-justification-right is-layout-flex wp-container-core-social-links-is-layout-1 wp-block-social-links-is-layout-flex\"><li class=\"wp-social-link wp-social-link-linkedin  wp-block-social-link\"><a href=\"https:\/\/www.linkedin.com\/company\/opstree-solutions\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">LinkedIn<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-youtube  wp-block-social-link\"><a href=\"https:\/\/www.youtube.com\/channel\/UCeLma6SpNYH7jjYKSBNSexw\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">YouTube<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-github  wp-block-social-link\"><a href=\"https:\/\/github.com\/OpsTree\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">GitHub<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-facebook  wp-block-social-link\"><a href=\"https:\/\/www.facebook.com\/opstree\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">Facebook<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-medium  wp-block-social-link\"><a href=\"https:\/\/medium.com\/buildpiper\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">Medium<\/span><\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We all have used IAM credentials to access our S3 buckets. But it&#8217;s not a very safe or recommended practice to keep our Access keys and Secrets stored in a server or hard code them in our codebase.Even if we have to use keys, we must have some mechanism in place to rotate the keys &hellip; <a href=\"https:\/\/opstree.com\/blog\/2022\/03\/15\/know-how-to-access-s3-bucket-without-iam-roles-and-use-cases\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Know How to Access S3 Bucket without IAM Roles and Use Cases&#8221;<\/span><\/a><\/p>\n","protected":false},"author":216838376,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_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","enabled":false},"version":2}},"categories":[28070474],"tags":[15203543,731087831,768739294,460,69816,768739308,118966,731087830,133339,1303819,4996032],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-2BT","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/10037"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/216838376"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=10037"}],"version-history":[{"count":23,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/10037\/revisions"}],"predecessor-version":[{"id":10190,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/10037\/revisions\/10190"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=10037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=10037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=10037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}