Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steampipe throws unexpected EOF error when joining multiple tables on the JSON qual column #201

Closed
LalitLab opened this issue Jun 21, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@LalitLab
Copy link

I have faced similar error

> select
  sb.name,
  rpa.is_public,
  access_level,
  public_statement_ids
from
  aws_s3_bucket as sb 
  left join aws_resource_policy_analysis rpa on rpa.policy = sb.policy
2022-06-19 06:24:32.236 UTC [TRACE] steampipe: resolveQuery select
  sb.name,
  rpa.is_public,
  access_level,
  public_statement_ids
from
  aws_s3_bucket as sb 
  left join aws_resource_policy_analysis rpa on rpa.policy = sb.policy
Error: unexpected EOF

Database logs for the same: database-2022-06-19.log

Below query without join works fine with json quals

select 
  is_public, access_level, 
  allowed_organization_ids, 
  allowed_principal_account_ids, 
  allowed_principal_federated_identities, 
  allowed_principal_services, allowed_principals, 
  public_access_levels, 
  public_statement_ids 
from 
  aws_resource_policy_analysis 
where 
  policy = '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"*"},"Action":["s3:GetBucketLocation","s3:ListBucket"],"Resource":"arn:aws:s3:::test"},{"Sid":"OrganizationAccess","Effect":"Allow","Principal":{"AWS":"*"},"Action":["s3:GetBucketLocation","s3:ListBucket"],"Resource":"arn:aws:s3:::test","Condition":{"StringEquals":{"aws:PrincipalOrgID":["o-123456"]}}},{"Sid":"AccountPrincipals","Effect":"Allow","Principal":{"AWS":["arn:aws:iam::123456789012:user/victor@xyz.com","arn:aws:iam::111122223333:root"]},"Action":["s3:GetBucketLocation","s3:ListBucket"],"Resource":"arn:aws:s3:::test"},{"Sid":"FederatedPrincipals","Effect":"Allow","Principal":{"Federated":"arn:aws:iam::111011101110:saml-provider/AWSSSO_DO_NOT_DELETE"},"Action":["s3:GetBucketLocation","s3:ListBucket"],"Resource":"arn:aws:s3:::test"},{"Sid":"ServicePrincipals","Effect":"Allow","Principal":{"Service":["ecs.amazonaws.com","elasticloadbalancing.amazonaws.com"]},"Action":["s3:GetBucketLocation","s3:ListBucket"],"Resource":"arn:aws:s3:::test"},{"Sid":"PublicAccess","Effect":"Allow","Principal":{"AWS":"*"},"Action":["s3:GetBucketLocation","s3:ListBucket"],"Resource":"arn:aws:s3:::test"}]}'

To replicate the issue

select
  sb.name,
  rpa.is_public,
  access_level,
  public_statement_ids
from
  aws_s3_bucket as sb 
  left join aws_resource_policy_analysis rpa on rpa.policy = sb.policy
@LalitLab LalitLab added the bug Something isn't working label Jun 21, 2022
@LalitLab LalitLab changed the title Steampipe throws unexpected EOF error when joining multiple tables on the JSON qual column #192 Steampipe throws unexpected EOF error when joining multiple tables on the JSON qual column Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants