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

Bugfix managed identity name #117

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ The SQL Server database and objects are deployed on push to master and release b
All SQL scripts on azure-infrastructure must be idempotent.

Note: The Github Workflow is not allowed to create new external users, so you must run it locally. Se more here: https://github.com/equinor/radix-vulnerability-scanner/issues/54
Workaround:
```sh
sqlcmd -S ${SERVER_NAME}.database.windows.net -d ${DATABASE_NAME} -G --variables RADIX_ZONE=${RADIX_ZONE} -i createSchema.sql
```

## Deploy to cluster

Expand Down
12 changes: 6 additions & 6 deletions azure-infrastructure/createSchema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ END
GRANT SELECT ON SCHEMA::cost TO datareader


IF NOT EXISTS(SELECT 1 FROM sys.database_principals WHERE name = 'radix-id-vulnerability-scan-writer-$(RADIX_ZONE)')
IF NOT EXISTS(SELECT 1 FROM sys.database_principals WHERE name = 'radix-id-cost-allocation-writer-$(RADIX_ZONE)')
BEGIN
CREATE USER [radix-id-vulnerability-scan-writer-$(RADIX_ZONE)] FROM EXTERNAL PROVIDER;
CREATE USER [radix-id-cost-allocation-writer-$(RADIX_ZONE)] FROM EXTERNAL PROVIDER;
END
ALTER ROLE datawriter ADD MEMBER [radix-id-vulnerability-scan-writer-$(RADIX_ZONE)]
ALTER ROLE datawriter ADD MEMBER [radix-id-cost-allocation-writer-$(RADIX_ZONE)]

IF NOT EXISTS(SELECT 1 FROM sys.database_principals WHERE name = 'radix-id-vulnerability-scan-reader-$(RADIX_ZONE)')
IF NOT EXISTS(SELECT 1 FROM sys.database_principals WHERE name = 'radix-id-cost-allocation-reader-$(RADIX_ZONE)')
BEGIN
CREATE USER [radix-id-vulnerability-scan-reader-$(RADIX_ZONE)] FROM EXTERNAL PROVIDER;
CREATE USER [radix-id-cost-allocation-reader-$(RADIX_ZONE)] FROM EXTERNAL PROVIDER;
END
ALTER ROLE datareader ADD MEMBER [radix-id-vulnerability-scan-reader-$(RADIX_ZONE)]
ALTER ROLE datareader ADD MEMBER [radix-id-cost-allocation-reader-$(RADIX_ZONE)]
Loading