How do I determine if an S3 bucket has public access using aws-cli
I have a bucket that shows "public access" in the console, but when I attempt to read the aws s3api get-public-access-block, I get an error:
$ aws s3api get-public-access-block --bucket my-test-bucket-name
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
abort-multipart-upload | complete-multipart-upload
copy-object | create-bucket...
I am running aws-cli 1.15.83:
$ aws --version
aws-cli/1.15.83 Python/2.7.14 Linux/4.14.77-70.59.amzn1.x86_64 botocore/1.10.82
amazon-s3 aws-cli
add a comment |
I have a bucket that shows "public access" in the console, but when I attempt to read the aws s3api get-public-access-block, I get an error:
$ aws s3api get-public-access-block --bucket my-test-bucket-name
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
abort-multipart-upload | complete-multipart-upload
copy-object | create-bucket...
I am running aws-cli 1.15.83:
$ aws --version
aws-cli/1.15.83 Python/2.7.14 Linux/4.14.77-70.59.amzn1.x86_64 botocore/1.10.82
amazon-s3 aws-cli
add a comment |
I have a bucket that shows "public access" in the console, but when I attempt to read the aws s3api get-public-access-block, I get an error:
$ aws s3api get-public-access-block --bucket my-test-bucket-name
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
abort-multipart-upload | complete-multipart-upload
copy-object | create-bucket...
I am running aws-cli 1.15.83:
$ aws --version
aws-cli/1.15.83 Python/2.7.14 Linux/4.14.77-70.59.amzn1.x86_64 botocore/1.10.82
amazon-s3 aws-cli
I have a bucket that shows "public access" in the console, but when I attempt to read the aws s3api get-public-access-block, I get an error:
$ aws s3api get-public-access-block --bucket my-test-bucket-name
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
abort-multipart-upload | complete-multipart-upload
copy-object | create-bucket...
I am running aws-cli 1.15.83:
$ aws --version
aws-cli/1.15.83 Python/2.7.14 Linux/4.14.77-70.59.amzn1.x86_64 botocore/1.10.82
amazon-s3 aws-cli
amazon-s3 aws-cli
asked Nov 19 '18 at 22:39
AG6HQAG6HQ
476
476
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can use aws s3api get-bucket-policy-status
to find out which buckets have been identified as having public access:
aws s3api get-bucket-policy-status --bucket my-test-bucket-name
{
"PolicyStatus": {
"IsPublic": true
}
}
The get-public-access-block
function is related to new features released last week [1], that help to protect future buckets from being mistakenly created with public access.
Both get-public-access-block
and get-bucket-policy-status
require a newer version of awscli than 1.15.83. The version I am using that has both these commands is 1.16.58.
[1] https://aws.amazon.com/blogs/aws/amazon-s3-block-public-access-another-layer-of-protection-for-your-accounts-and-buckets/
add a comment |
The error you might be getting because of you might not have upgraded awscli.
You pip command to upgrade.
pip install --upgrade awscli
The same error was getting at the start. It should upgrade and give the proper result.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53383674%2fhow-do-i-determine-if-an-s3-bucket-has-public-access-using-aws-cli%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use aws s3api get-bucket-policy-status
to find out which buckets have been identified as having public access:
aws s3api get-bucket-policy-status --bucket my-test-bucket-name
{
"PolicyStatus": {
"IsPublic": true
}
}
The get-public-access-block
function is related to new features released last week [1], that help to protect future buckets from being mistakenly created with public access.
Both get-public-access-block
and get-bucket-policy-status
require a newer version of awscli than 1.15.83. The version I am using that has both these commands is 1.16.58.
[1] https://aws.amazon.com/blogs/aws/amazon-s3-block-public-access-another-layer-of-protection-for-your-accounts-and-buckets/
add a comment |
You can use aws s3api get-bucket-policy-status
to find out which buckets have been identified as having public access:
aws s3api get-bucket-policy-status --bucket my-test-bucket-name
{
"PolicyStatus": {
"IsPublic": true
}
}
The get-public-access-block
function is related to new features released last week [1], that help to protect future buckets from being mistakenly created with public access.
Both get-public-access-block
and get-bucket-policy-status
require a newer version of awscli than 1.15.83. The version I am using that has both these commands is 1.16.58.
[1] https://aws.amazon.com/blogs/aws/amazon-s3-block-public-access-another-layer-of-protection-for-your-accounts-and-buckets/
add a comment |
You can use aws s3api get-bucket-policy-status
to find out which buckets have been identified as having public access:
aws s3api get-bucket-policy-status --bucket my-test-bucket-name
{
"PolicyStatus": {
"IsPublic": true
}
}
The get-public-access-block
function is related to new features released last week [1], that help to protect future buckets from being mistakenly created with public access.
Both get-public-access-block
and get-bucket-policy-status
require a newer version of awscli than 1.15.83. The version I am using that has both these commands is 1.16.58.
[1] https://aws.amazon.com/blogs/aws/amazon-s3-block-public-access-another-layer-of-protection-for-your-accounts-and-buckets/
You can use aws s3api get-bucket-policy-status
to find out which buckets have been identified as having public access:
aws s3api get-bucket-policy-status --bucket my-test-bucket-name
{
"PolicyStatus": {
"IsPublic": true
}
}
The get-public-access-block
function is related to new features released last week [1], that help to protect future buckets from being mistakenly created with public access.
Both get-public-access-block
and get-bucket-policy-status
require a newer version of awscli than 1.15.83. The version I am using that has both these commands is 1.16.58.
[1] https://aws.amazon.com/blogs/aws/amazon-s3-block-public-access-another-layer-of-protection-for-your-accounts-and-buckets/
answered Nov 20 '18 at 3:45
mvermaesmvermaes
30636
30636
add a comment |
add a comment |
The error you might be getting because of you might not have upgraded awscli.
You pip command to upgrade.
pip install --upgrade awscli
The same error was getting at the start. It should upgrade and give the proper result.
add a comment |
The error you might be getting because of you might not have upgraded awscli.
You pip command to upgrade.
pip install --upgrade awscli
The same error was getting at the start. It should upgrade and give the proper result.
add a comment |
The error you might be getting because of you might not have upgraded awscli.
You pip command to upgrade.
pip install --upgrade awscli
The same error was getting at the start. It should upgrade and give the proper result.
The error you might be getting because of you might not have upgraded awscli.
You pip command to upgrade.
pip install --upgrade awscli
The same error was getting at the start. It should upgrade and give the proper result.
edited Nov 20 '18 at 8:44


Pang
6,8921563101
6,8921563101
answered Nov 20 '18 at 7:31


Pradeep R BPradeep R B
13
13
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53383674%2fhow-do-i-determine-if-an-s3-bucket-has-public-access-using-aws-cli%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown