AWS IAM: Restrict Console Access to only One Instance
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to create an IAM user for the AWS Console with permission to list and perform action on only 1 instance.
So I have a total of 6 Instances and I tried hiding 5 of them via IAM Policies by adding the below policy:
Breakdown
1. First took all the permissions away
2. Added permission to only one instance
{
"Statement": [
{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"condition": {}
}
},
{
"Effect": "Allow",
"Action": "*",
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef",
"Condition": {
"condition": {}
}
}
]
}
This works for the 1st part only ie Denying to all Instances.
The 2nd part doesn't seem to work.
Don't the permissions work like that? Any help would be appreciated.
amazon-web-services amazon-ec2 amazon-iam
add a comment |
I am trying to create an IAM user for the AWS Console with permission to list and perform action on only 1 instance.
So I have a total of 6 Instances and I tried hiding 5 of them via IAM Policies by adding the below policy:
Breakdown
1. First took all the permissions away
2. Added permission to only one instance
{
"Statement": [
{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"condition": {}
}
},
{
"Effect": "Allow",
"Action": "*",
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef",
"Condition": {
"condition": {}
}
}
]
}
This works for the 1st part only ie Denying to all Instances.
The 2nd part doesn't seem to work.
Don't the permissions work like that? Any help would be appreciated.
amazon-web-services amazon-ec2 amazon-iam
add a comment |
I am trying to create an IAM user for the AWS Console with permission to list and perform action on only 1 instance.
So I have a total of 6 Instances and I tried hiding 5 of them via IAM Policies by adding the below policy:
Breakdown
1. First took all the permissions away
2. Added permission to only one instance
{
"Statement": [
{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"condition": {}
}
},
{
"Effect": "Allow",
"Action": "*",
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef",
"Condition": {
"condition": {}
}
}
]
}
This works for the 1st part only ie Denying to all Instances.
The 2nd part doesn't seem to work.
Don't the permissions work like that? Any help would be appreciated.
amazon-web-services amazon-ec2 amazon-iam
I am trying to create an IAM user for the AWS Console with permission to list and perform action on only 1 instance.
So I have a total of 6 Instances and I tried hiding 5 of them via IAM Policies by adding the below policy:
Breakdown
1. First took all the permissions away
2. Added permission to only one instance
{
"Statement": [
{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"condition": {}
}
},
{
"Effect": "Allow",
"Action": "*",
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef",
"Condition": {
"condition": {}
}
}
]
}
This works for the 1st part only ie Denying to all Instances.
The 2nd part doesn't seem to work.
Don't the permissions work like that? Any help would be appreciated.
amazon-web-services amazon-ec2 amazon-iam
amazon-web-services amazon-ec2 amazon-iam
asked 2 hours ago
ServerInsightsServerInsights
2115
2115
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Your current policy would work in the AWS-CLI, e.g. aws ec2 stop-instance
should work.
However to actually use the web console you need a few more read-only permissions because the console tries to list and describe all the instances to build the list.
You may need at least ec2:DescribeInstances
to get a basic half-broken list.
If you only care about preventing that IAM user from modifying other instances you can give him a read-only access with ec2:Describe*
- that should make the console usable while preventing him from modifying any non-permitted instances.
I'm not aware of a way to restrict the listing of instances only to the one he can work with, he will probably see them all but can only manage that single one.
Hope that helps :)
add a comment |
You have to deny all, but in your condition, use ArnNotEquals "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef"
This will basically deny all other instance that does not have the same ARN as the instance that you want to be allowed.
See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN for more information
add a comment |
Thank you MLu and Sharuzzaman Ahmat Raslan!
Your inputs really helped me to get this done.
I am adding the summary of what I did below for others in case:
- First, need to make sure the right policy is attached to the user
group or in my case, the right policy is detached. The user had no
EC2 access.
Next, I used the Inline Policy to add access. I added the below policy which, as mentioned by MLu would allow not stop listing the instances but will not allow updating of the other instances
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "(add asterisk here)"
},
{
"Effect": "Allow",
"Action": "(add asterisk here)",
"Resource": "arn:aws:ec2:us-east-1:1234567890123:instance/i-xxxxxxxxxxxxxxxxx"
}
]
}
Hope this helps someone stuck to save some time.
PS: Sorry I just could not get it styled properely. Asterisks were making text italics.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
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%2fserverfault.com%2fquestions%2f963055%2faws-iam-restrict-console-access-to-only-one-instance%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your current policy would work in the AWS-CLI, e.g. aws ec2 stop-instance
should work.
However to actually use the web console you need a few more read-only permissions because the console tries to list and describe all the instances to build the list.
You may need at least ec2:DescribeInstances
to get a basic half-broken list.
If you only care about preventing that IAM user from modifying other instances you can give him a read-only access with ec2:Describe*
- that should make the console usable while preventing him from modifying any non-permitted instances.
I'm not aware of a way to restrict the listing of instances only to the one he can work with, he will probably see them all but can only manage that single one.
Hope that helps :)
add a comment |
Your current policy would work in the AWS-CLI, e.g. aws ec2 stop-instance
should work.
However to actually use the web console you need a few more read-only permissions because the console tries to list and describe all the instances to build the list.
You may need at least ec2:DescribeInstances
to get a basic half-broken list.
If you only care about preventing that IAM user from modifying other instances you can give him a read-only access with ec2:Describe*
- that should make the console usable while preventing him from modifying any non-permitted instances.
I'm not aware of a way to restrict the listing of instances only to the one he can work with, he will probably see them all but can only manage that single one.
Hope that helps :)
add a comment |
Your current policy would work in the AWS-CLI, e.g. aws ec2 stop-instance
should work.
However to actually use the web console you need a few more read-only permissions because the console tries to list and describe all the instances to build the list.
You may need at least ec2:DescribeInstances
to get a basic half-broken list.
If you only care about preventing that IAM user from modifying other instances you can give him a read-only access with ec2:Describe*
- that should make the console usable while preventing him from modifying any non-permitted instances.
I'm not aware of a way to restrict the listing of instances only to the one he can work with, he will probably see them all but can only manage that single one.
Hope that helps :)
Your current policy would work in the AWS-CLI, e.g. aws ec2 stop-instance
should work.
However to actually use the web console you need a few more read-only permissions because the console tries to list and describe all the instances to build the list.
You may need at least ec2:DescribeInstances
to get a basic half-broken list.
If you only care about preventing that IAM user from modifying other instances you can give him a read-only access with ec2:Describe*
- that should make the console usable while preventing him from modifying any non-permitted instances.
I'm not aware of a way to restrict the listing of instances only to the one he can work with, he will probably see them all but can only manage that single one.
Hope that helps :)
answered 1 hour ago
MLuMLu
9,79722445
9,79722445
add a comment |
add a comment |
You have to deny all, but in your condition, use ArnNotEquals "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef"
This will basically deny all other instance that does not have the same ARN as the instance that you want to be allowed.
See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN for more information
add a comment |
You have to deny all, but in your condition, use ArnNotEquals "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef"
This will basically deny all other instance that does not have the same ARN as the instance that you want to be allowed.
See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN for more information
add a comment |
You have to deny all, but in your condition, use ArnNotEquals "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef"
This will basically deny all other instance that does not have the same ARN as the instance that you want to be allowed.
See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN for more information
You have to deny all, but in your condition, use ArnNotEquals "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef"
This will basically deny all other instance that does not have the same ARN as the instance that you want to be allowed.
See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN for more information
answered 2 hours ago
Sharuzzaman Ahmat RaslanSharuzzaman Ahmat Raslan
2631213
2631213
add a comment |
add a comment |
Thank you MLu and Sharuzzaman Ahmat Raslan!
Your inputs really helped me to get this done.
I am adding the summary of what I did below for others in case:
- First, need to make sure the right policy is attached to the user
group or in my case, the right policy is detached. The user had no
EC2 access.
Next, I used the Inline Policy to add access. I added the below policy which, as mentioned by MLu would allow not stop listing the instances but will not allow updating of the other instances
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "(add asterisk here)"
},
{
"Effect": "Allow",
"Action": "(add asterisk here)",
"Resource": "arn:aws:ec2:us-east-1:1234567890123:instance/i-xxxxxxxxxxxxxxxxx"
}
]
}
Hope this helps someone stuck to save some time.
PS: Sorry I just could not get it styled properely. Asterisks were making text italics.
add a comment |
Thank you MLu and Sharuzzaman Ahmat Raslan!
Your inputs really helped me to get this done.
I am adding the summary of what I did below for others in case:
- First, need to make sure the right policy is attached to the user
group or in my case, the right policy is detached. The user had no
EC2 access.
Next, I used the Inline Policy to add access. I added the below policy which, as mentioned by MLu would allow not stop listing the instances but will not allow updating of the other instances
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "(add asterisk here)"
},
{
"Effect": "Allow",
"Action": "(add asterisk here)",
"Resource": "arn:aws:ec2:us-east-1:1234567890123:instance/i-xxxxxxxxxxxxxxxxx"
}
]
}
Hope this helps someone stuck to save some time.
PS: Sorry I just could not get it styled properely. Asterisks were making text italics.
add a comment |
Thank you MLu and Sharuzzaman Ahmat Raslan!
Your inputs really helped me to get this done.
I am adding the summary of what I did below for others in case:
- First, need to make sure the right policy is attached to the user
group or in my case, the right policy is detached. The user had no
EC2 access.
Next, I used the Inline Policy to add access. I added the below policy which, as mentioned by MLu would allow not stop listing the instances but will not allow updating of the other instances
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "(add asterisk here)"
},
{
"Effect": "Allow",
"Action": "(add asterisk here)",
"Resource": "arn:aws:ec2:us-east-1:1234567890123:instance/i-xxxxxxxxxxxxxxxxx"
}
]
}
Hope this helps someone stuck to save some time.
PS: Sorry I just could not get it styled properely. Asterisks were making text italics.
Thank you MLu and Sharuzzaman Ahmat Raslan!
Your inputs really helped me to get this done.
I am adding the summary of what I did below for others in case:
- First, need to make sure the right policy is attached to the user
group or in my case, the right policy is detached. The user had no
EC2 access.
Next, I used the Inline Policy to add access. I added the below policy which, as mentioned by MLu would allow not stop listing the instances but will not allow updating of the other instances
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "(add asterisk here)"
},
{
"Effect": "Allow",
"Action": "(add asterisk here)",
"Resource": "arn:aws:ec2:us-east-1:1234567890123:instance/i-xxxxxxxxxxxxxxxxx"
}
]
}
Hope this helps someone stuck to save some time.
PS: Sorry I just could not get it styled properely. Asterisks were making text italics.
answered 10 mins ago
ServerInsightsServerInsights
2115
2115
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- 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%2fserverfault.com%2fquestions%2f963055%2faws-iam-restrict-console-access-to-only-one-instance%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