Skip to content

Commit ed3be7b

Browse files
authored
Merge pull request #131 from cloudgraphdev/fix/CG-1332-aws-pci-ec2-check-1
fix(CG-1332): fix aws pci ec2 check 1
2 parents d0c1fc5 + 71b45cf commit ed3be7b

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/aws/pci-dss-3.2.1/rules/pci-dss-3.2.1-ec2-check-1.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
'https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html',
4444
],
4545
gql: `{
46-
queryawsEbs {
46+
queryawsEbsSnapshot {
4747
id
4848
arn
4949
accountId
@@ -54,13 +54,13 @@ export default {
5454
}
5555
}
5656
}`,
57-
resource: 'queryawsEbs[*]',
57+
resource: 'queryawsEbsSnapshot[*]',
5858
severity: 'low',
5959
conditions: {
60-
and: [
60+
or:[
6161
{
6262
path: '@.permissions',
63-
isEmpty: false,
63+
isEmpty: true,
6464
},
6565
{
6666
path: '@.permissions',
@@ -73,7 +73,7 @@ export default {
7373
},
7474
],
7575
},
76-
},
77-
],
76+
}
77+
]
7878
},
7979
}

src/aws/pci-dss-3.2.1/tests/pci-dss-3.2.1-ec2-checks.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('PCI Data Security Standard: 3.2.1', () => {
4040
describe('EC2 Check 1: Amazon EBS snapshots should not be publicly restorable', () => {
4141
test('Should pass when group is not set to all and it has a user id', async () => {
4242
const data = {
43-
queryawsEbs: [
43+
queryawsEbsSnapshot: [
4444
{
4545
id: cuid(),
4646
permissions: [
@@ -63,7 +63,7 @@ describe('PCI Data Security Standard: 3.2.1', () => {
6363

6464
test('Should fail when group is set to all', async () => {
6565
const data = {
66-
queryawsEbs: [
66+
queryawsEbsSnapshot: [
6767
{
6868
id: cuid(),
6969
permissions: [
@@ -86,7 +86,7 @@ describe('PCI Data Security Standard: 3.2.1', () => {
8686

8787
test('Should fail when group is not set to all, but it has not a user id', async () => {
8888
const data = {
89-
queryawsEbs: [
89+
queryawsEbsSnapshot: [
9090
{
9191
id: cuid(),
9292
permissions: [
@@ -109,7 +109,7 @@ describe('PCI Data Security Standard: 3.2.1', () => {
109109

110110
test('Should fail when it does not have configured permissions', async () => {
111111
const data = {
112-
queryawsEbs: [
112+
queryawsEbsSnapshot: [
113113
{
114114
id: cuid(),
115115
permissions: [],
@@ -122,7 +122,7 @@ describe('PCI Data Security Standard: 3.2.1', () => {
122122
{ ...data } as any
123123
)
124124

125-
expect(processedRule.result).toBe(Result.FAIL)
125+
expect(processedRule.result).toBe(Result.PASS)
126126
})
127127
})
128128

0 commit comments

Comments
 (0)