Skip to content

Commit

Permalink
Add database options to support managed databases + misc fixes (RedHa…
Browse files Browse the repository at this point in the history
…tProductSecurity#109)

This PR changes the way that the custom osidb.acl parameter is
initialized to be more managed database friendly and also removes an
unused image from the local dev environment compose file.

Closes OSIDB-639
  • Loading branch information
Adrian Torres authored Dec 19, 2022
2 parents 178a858 + 0f87351 commit a3c4a40
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
9 changes: 7 additions & 2 deletions config/settings_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@
"HOST": "postgres",
"PORT": "5432",
"ENGINE": "psqlextra.backend",
# prevent libpq from automatically trying to connect to the db via GSSAPI
"OPTIONS": {"gssencmode": "disable"},
"OPTIONS": {
# prevent libpq from automatically trying to connect to the db via GSSAPI
"gssencmode": "disable",
# this is a hack due to our inability to set a custom parameter either at
# the database or role level in managed databases such as AWS RDS
"options": "-c osidb.acl=''",
},
}
}

Expand Down
3 changes: 3 additions & 0 deletions config/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
"sslmode": "require",
# prevent libpq from automatically trying to connect to the db via GSSAPI
"gssencmode": "disable",
# this is a hack due to our inability to set a custom parameter either at
# the database or role level in managed databases such as AWS RDS
"options": "-c osidb.acl=''",
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions config/settings_prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
"sslmode": "require",
# prevent libpq from automatically trying to connect to the db via GSSAPI
"gssencmode": "disable",
# this is a hack due to our inability to set a custom parameter either at
# the database or role level in managed databases such as AWS RDS
"options": "-c osidb.acl=''",
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions config/settings_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"sslmode": "require",
# prevent libpq from automatically trying to connect to the db via GSSAPI
"gssencmode": "disable",
# this is a hack due to our inability to set a custom parameter either at
# the database or role level in managed databases such as AWS RDS
"options": "-c osidb.acl=''",
},
}
}
3 changes: 3 additions & 0 deletions config/settings_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
"sslmode": "require",
# prevent libpq from automatically trying to connect to the db via GSSAPI
"gssencmode": "disable",
# this is a hack due to our inability to set a custom parameter either at
# the database or role level in managed databases such as AWS RDS
"options": "-c osidb.acl=''",
},
}
}
Expand Down
10 changes: 0 additions & 10 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ services:
# osidb-data:
# condition: service_healthy

phpldapadmin:
image: docker.io/osixia/phpldapadmin:latest
container_name: phpldapadmin
environment:
PHPLDAPADMIN_LDAP_HOSTS: "ldap://testldap:1389"
PHPLDAPADMIN_HTTPS: "false"
ports:
- "${OSIDB_TESTRUNNER_PORT-8080}:80"
depends_on: ["testldap"]

testrunner:
container_name: testrunner
build:
Expand Down
1 change: 0 additions & 1 deletion etc/pg/postgresql.conf
Original file line number Diff line number Diff line change
Expand Up @@ -777,4 +777,3 @@ default_text_search_config = 'pg_catalog.english'
#------------------------------------------------------------------------------

# Add settings for extensions here
osidb.acl = ''
2 changes: 0 additions & 2 deletions osidb/migrations/0001_initial_squashed_0059_flaw__alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,8 +1347,6 @@ class Migration(migrations.Migration):
--enable row based security for following tables
ALTER TABLE osidb_flaw ENABLE ROW LEVEL SECURITY;
ALTER TABLE osidb_flaw FORCE ROW LEVEL SECURITY;
--set default value for osidb.acl parameter
SET osidb.acl TO '';
--following policies define fine grained read/write control on osidb_flaw entity
--policy for entity insert (eg. create)
DROP policy if exists acl_policy_flaw_create on osidb_flaw;
Expand Down

0 comments on commit a3c4a40

Please sign in to comment.