How to create Delegation Signer (DS) record for a subdomain with PowerDNS? - subdomain

I have a domain mydomain.com. The DNS servers for this domain are under my control and I'm running PowerDNS there. I've set up DNSSEC for my main domain mydomain.com and I've registered the keys at registrar. Everything works fine for the main domain. However when I create subdomains (zones) with PowerAdmin GUI then I get the following error for my subdomains from DNSSEC analysis tool at http://dnssec-debugger.verisignlabs.com/:
No DS records found for subdomain.mydomain.com in the mydomain.com zone
Question: how to add that DS record to mydomain.com zone with powerdns?

Note: I haven't used PowerAdmin, so this is a PowerDNS answer.
Assuming you have also signed these subdomains/zones, you would use pdnssec show-zone to see the DS records for them. Then, insert these DS records into the parent zone (mydomain.com), with fields set like this:
domain_id = id of domain.com
name = sub.mydomain.com
type = DS
content = copy/paste from pdnssec show-zone
You also need to insert NS records (as above, but with type=NS and content=name of your server), to get a valid delegation, even if it is local!
If you don't actually care about DNSSEC for the subdomains, just insert the NS records and leave out the DS. This will tell validators that the subdomain is deliberately insecure.

Related

ESP8266 and mySQL

To begin with, I set up my database which includes (an id (which is auto increment), username, email, and 2 more which are place0 and place1 (those two are boolean type)). Now my question is how can I connect an esp8266 directly to the database and update the booleans from 0 to 1 and back using a button for each one? Also, how can I read the boolean on the esp and turn an led for example? I need to make it update the values for a selected user not all of them....for example, I have users with id 1, 2, 3...i need to make the updates only on 1 if that one is selected...
Note that both the database and the esp8266 are in my house (on a local network)
Thanks very much
Nikolaos Konstantinou
NcCon
The best way I can think of is ESP8266 to Web Server(PHP/Python/NodeJS etc) to MySQL
Send the boolean values in the form of the HTTP Post method and handle the post method in Webserver then update the MYSQL table.
check out this link
For some reason, if you want to avoid webserver you can try micro python upymysql module which helps to directly communicate the database from ESP board uPyMySQL

SSRS When uploading report owner name is wrong

I have SQL 2014 professional version 12.0.5000.0 with SSRS runing. eI have created a report in report builder 3.0 which works and runs find.
However when I go to create a subscription and run I get the user a1234 (as a example ) don't exist.
I looked there is no user with that name added to SSRS or in our domain.
my user name is ah1234 (as a example )
I looked in the subscription table and the owner is me ? However, the subscription is showing the owner as a1234?
I checked the report I uploaded it says the owner is a1234.
I'm thinking it might be a active directory issue but not sure.
Has anyone has see this before if so how can I fix the owner name of the subscription?
I don't know how SSRS has corrupted the owner name but here is a trick (written on 2008 R2) to correct owner names (I use this when people leave & their Active Directory user id gets deleted leaving orphaned subs that will not run).
Note that it updates the Microsoft-supplied subscriptions table, you may not wish to do that.
First identify the SSRS owner id for the from-person & also that of the to-person (you may need to get the to-person to create a subscription first):
SELECT distinct [OwnerID], u.username
FROM [<ssrs-database>].[dbo].[Subscriptions] s
join [<ssrs-database>].[dbo].[Users] u on s.ownerid = u.userid
Now make a safe copy of the subscriptions list, e.g.:
SELECT * into temp.subscriptionscpy
FROM [<ssrs-database>].[dbo].[Subscriptions] s
Now make the change, e.g. (this one changes the owner of all relevant subs):
update [<ssrs-database>].[dbo].[Subscriptions]
set ownerid = 'DDD87598-8957-42C8-8DBC-A893E7174CB6'
where ownerid = 'EBF0E483-69E6-4458-B171-BA28FFCCDF3F'
Now check the owner is as you want it.

Get the IP address related to a RecentChange entry

I have an extension that needs to access the IP addresses associated with a recent change entry.
From the revision ID, I can access the Revision object and in turn the associated RecentChange but neither have any obvious methods to get the originating IP. It can only get the IP if it was an anonymous edit.
I have set $wgPutIPinRC so the IPs will be in the recentchanges table.
How can I get the IP address for the change?
It is not directly exposed as a property, but it is stored in the class as an attribute.
These can be read using the RecentChange::getAttribute() method passing the field name of rc_ip:
$ip_address = $this->recentchange->getAttribute( 'rc_ip' );
This still requires $wgPutIPinRC to be set for the data to be recorded in the first place.

Anyway to get dkims records for verifying ses domain in boto?

Tinkering around with verifying a couple of domains and found the manual process rather tedius. My DNS controller offers API access so I figured why not script the whole thing.
Trick is I can't figure out how to access the required TXT & CNAME records for DKIMS verification from boto, when I punch in
dkims = conn.verify_domain_dkim('DOMAIN.COM')
it adds DOMAIN.COM to the list of domains pending verification but doesn't provide the needed records, the returned value of dkims is
{'VerifyDomainDkimResponse': {
'ResponseMetadata': {'RequestId': 'REQUEST_ID_STRING'},
'VerifyDomainDkimResult': {'DkimTokens': {
'member': 'DKIMS_TOKEN_STRING'}}}}
Is there some undocumented way to take the REQUEST_ID or TOKEN_STRING to pull up these records?
UPDATE
If you have an aws account you can see the records I'm after at
https://console.aws.amazon.com/ses/home?region=us-west-2#verified-senders:domain
tab: Details:: Record Type: TXT (Text)
tab: DKIM:: DNS Record 1, 2, 3
these are the records required to add to the DNS controller to validate & allow DKIM signatures to take place
This is how I do it with python.
DOMINIO = 'mydomain.com'
from boto3 import Session
session = Session(
aws_access_key_id=MY_AWS_ACCESS_KEY_ID,
aws_secret_access_key=MY_AWS_SECRET_ACCESS_KEY,
region_name=MY_AWS_REGION_NAME)
client = session.client('ses')
# gets VerificationToken for the domain, that will be used to add a TXT record to the DNS
result = client.verify_domain_identity(Domain=DOMINIO)
txt = result.get('VerificationToken')
# gets DKIM tokens that will be used to add 3 CNAME records
result = client.verify_domain_dkim(Domain=DOMINIO)
dkim_tokens = result.get('DkimTokens') # this is a list
At the end of the code, you will have "txt" and "dkim_tokens" variables, a string and a list respectively.
You will need to add a TXT record to your dns, where the host name is "_amazonses" and the value is the value of "txt" variable.
Also you will need to add 3 CNAME records to your dns, one for each token present in "dkim_tokens" list, where the host name of each record is of the form of [dkimtoken]._domainkey and the target is [dkimtoken].dkim.amazonses.com
After adding the dns records, after some minutes (maybe a couple of hours), Amazon will detect and verify the domain, and will send you an email notification. After that, you can enable Dkim signature by doing this call:
client.set_identity_dkim_enabled(Identity=DOMINIO, DkimEnabled=True)
The methods used here are verify_domain_identity, verify_domain_dkim and set_identity_dkim_enabled.
You may also want to take a look a get_identity_verification_attributes and get_identity_dkim_attributes.
I think the get_identity_dkim_attributes method will return the information you are looking for. You pass in the domain name(s) you are interested in and it returns the status for that identity as well as the DKIM tokens.

Multiple individual users on one database

I have a .sql database with which i interact using Django .
The database in the beginning is filled with public data that can be accessed from anynone.
Multiple individual users can add rows into a table(private data).
How can a user see only the changes he made in the database(private data)?
I assume you're using django.contrib.auth. You just need to do something like:
from django.contrib.auth.models import User
# ...
class PrivateData(models.Model):
# ... private data fields ...
user = models.ForeignKey(User)
Then you can get just that user's fields with:
PrivateData.objects.filter(user=request.user)
EDIT: So, if your users are just IP addresses, and you're not using a login mechanism, you don't really need django.contrib.auth... though it's good to have anyway since you can use it to authenticate yourself and use the built-in admin stuff to manage your site.
If you just want to tie data to IP addresses, set up an IPUser model:
class IPUser(models.Model):
address = models.CharField(max_length=64, unique=True) # Big enough for IPv6
# Add whatever other discrete (not list) data you want to store with this address.
class PrivateData(models.Model):
# ... private data fields ...
user = models.ForeignKey(IPUser)
The view function looks something like:
def the_view(request):
remoteAddr = request.META['REMOTE_ADDR']
try:
theUser = IPUser.objects.get(address=remoteAddr)
except IPUser.DoesNotExist:
theUser = IPUser.objects.create(address=remoteAddr)
userModifiedData = PrivateData.objects.filter(user=theUser)
One thing to note: when you're testing this with manage.py runserver, you'll need to specify the IP address via environment variable:
$ REMOTE_ADDR=127.0.0.1 manage.py runserver
When you use Django with a real web server like Apache, the server will set the variable for you.
There are probably several ways to optimize this, but this should get you started.
I'm assuming that users have to log into this application. If yes, add a column to every table for the username. Add WHERE username = ? to every query so they can see only their data.
For data manipulation requests, make sure that the username matches the value for every row; forbid the operation if not true.